Skip to content

Commit dda3e36

Browse files
committed
fix(jsonrpc): use versioned hash to query block confirmation status
1 parent b0e5e3e commit dda3e36

File tree

1 file changed

+3
-3
lines changed
  • node/src/actors/json_rpc

1 file changed

+3
-3
lines changed

node/src/actors/json_rpc/api.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use witnet_data_structures::{
2727
tapi::ActiveWips, Block, DataRequestOutput, Epoch, Hash, Hashable, KeyedSignature,
2828
PublicKeyHash, RADType, StakeOutput, StateMachine, SyncStatus,
2929
},
30-
get_environment,
31-
proto::versioning::ProtocolVersion,
30+
get_environment, get_protocol_version,
31+
proto::versioning::{ProtocolVersion, VersionedHashable},
3232
staking::prelude::*,
3333
transaction::Transaction,
3434
vrf::VrfMessage,
@@ -742,7 +742,7 @@ pub async fn get_block(params: Params) -> Result<Value, Error> {
742742
match res {
743743
Ok(Ok(mut output)) => {
744744
let block_epoch = output.block_header.beacon.checkpoint;
745-
let block_hash = output.hash();
745+
let block_hash = output.versioned_hash(get_protocol_version(Some(block_epoch)));
746746

747747
let dr_weight = match serde_json::to_value(output.dr_weight()) {
748748
Ok(x) => x,

0 commit comments

Comments
 (0)