Skip to content

Commit fc26eaa

Browse files
committed
Merge #590: Use snake case for block hash parameters
bbf888c client: use snake case for block hash parameters (peter941221) Pull request description: Closes #462. This renames corepc-owned Rust parameter identifiers from `blockhash` to `block_hash`. Left unchanged: - Bitcoin Core RPC method/argument names such as `"blockhash"`; - serde wire-format renames; - external `bitcoin::block::Header::prev_blockhash` fields. Verified with: - `cargo +nightly-2025-09-12 fmt --all --check` - `cargo check --manifest-path client/Cargo.toml --all-targets --all-features` ACKs for top commit: tcharding: ACK bbf888c Tree-SHA512: 5f614820d994f018a6a5a94926b84f44bd21b8593520ee2b40717efd71014072add6765867a244c314a5f7c9f0786c5417cd867930f173e8386660bc5489eb61
2 parents 31df19b + bbf888c commit fc26eaa

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

client/src/client_sync/v17/hidden.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ macro_rules! impl_client_v17__sync_with_validation_interface_queue {
8282
macro_rules! impl_client_v17__reconsider_block {
8383
() => {
8484
impl Client {
85-
pub fn reconsider_block(&self, blockhash: bitcoin::BlockHash) -> Result<()> {
86-
self.call("reconsiderblock", &[into_json(blockhash)?])
85+
pub fn reconsider_block(&self, block_hash: bitcoin::BlockHash) -> Result<()> {
86+
self.call("reconsiderblock", &[into_json(block_hash)?])
8787
}
8888
}
8989
};

client/src/client_sync/v23/blockchain.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
macro_rules! impl_client_v23__get_block_from_peer {
1515
() => {
1616
impl Client {
17-
pub fn get_block_from_peer(&self, blockhash: BlockHash, peer_id: u32) -> Result<()> {
18-
match self.call("getblockfrompeer", &[into_json(blockhash)?, into_json(peer_id)?]) {
17+
pub fn get_block_from_peer(&self, block_hash: BlockHash, peer_id: u32) -> Result<()> {
18+
match self.call("getblockfrompeer", &[into_json(block_hash)?, into_json(peer_id)?])
19+
{
1920
Ok(serde_json::Value::Object(ref map)) if map.is_empty() => Ok(()),
2021
Ok(res) => Err(Error::Returned(res.to_string())),
2122
Err(err) => Err(err.into()),
@@ -36,8 +37,8 @@ macro_rules! impl_client_v23__get_deployment_info {
3637
}
3738

3839
/// Query deployment info at the given block hash.
39-
pub fn get_deployment_info(&self, blockhash: &BlockHash) -> Result<GetDeploymentInfo> {
40-
self.call("getdeploymentinfo", &[into_json(blockhash)?])
40+
pub fn get_deployment_info(&self, block_hash: &BlockHash) -> Result<GetDeploymentInfo> {
41+
self.call("getdeploymentinfo", &[into_json(block_hash)?])
4142
}
4243
}
4344
};

0 commit comments

Comments
 (0)