@@ -11,18 +11,14 @@ use witnet_config::defaults::{
11
11
PSEUDO_CONSENSUS_CONSTANTS_WIP0022_REWARD_COLLATERAL_RATIO ,
12
12
PSEUDO_CONSENSUS_CONSTANTS_WIP0027_COLLATERAL_AGE ,
13
13
} ;
14
- use witnet_crypto:: {
15
- hash:: { calculate_sha256, Sha256 } ,
16
- merkle:: { merkle_tree_root as crypto_merkle_tree_root, ProgressiveMerkleTree } ,
17
- signature:: { verify, PublicKey , Signature } ,
18
- } ;
14
+ use witnet_crypto:: { hash:: { calculate_sha256, Sha256 } , hash, merkle:: { merkle_tree_root as crypto_merkle_tree_root, ProgressiveMerkleTree } , signature:: { PublicKey , Signature , verify} } ;
19
15
use witnet_data_structures:: {
20
16
chain:: {
21
- tapi :: ActiveWips , Block , BlockMerkleRoots , CheckpointBeacon , CheckpointVRF ,
22
- ConsensusConstants , DataRequestOutput , DataRequestStage , DataRequestState , Epoch ,
23
- EpochConstants , Hash , Hashable , Input , KeyedSignature , OutputPointer , PublicKeyHash ,
24
- RADRequest , RADTally , RADType , Reputation , ReputationEngine , SignaturesToVerify ,
25
- StakeOutput , ValueTransferOutput ,
17
+ Block , BlockMerkleRoots , CheckpointBeacon , CheckpointVRF , ConsensusConstants ,
18
+ DataRequestOutput , DataRequestStage , DataRequestState , Epoch , EpochConstants ,
19
+ Hash , Hashable , Input , KeyedSignature , OutputPointer , PublicKeyHash , RADRequest ,
20
+ RADTally , RADType , Reputation , ReputationEngine , SignaturesToVerify , StakeOutput ,
21
+ tapi :: ActiveWips , ValueTransferOutput ,
26
22
} ,
27
23
data_request:: {
28
24
calculate_reward_collateral_ratio, calculate_tally_change, calculate_witness_reward,
@@ -50,7 +46,7 @@ use witnet_rad::{
50
46
error:: RadError ,
51
47
operators:: RadonOpCodes ,
52
48
script:: { create_radon_script_from_filters_and_reducer, unpack_radon_script} ,
53
- types:: { serial_iter_decode , RadonTypes } ,
49
+ types:: { RadonTypes , serial_iter_decode } ,
54
50
} ;
55
51
56
52
// TODO: move to a configuration
@@ -1986,10 +1982,10 @@ pub fn validate_block_transactions(
1986
1982
// }
1987
1983
}
1988
1984
1989
- ( Hash :: from ( st_mt. root ( ) ) , Hash :: from ( ut_mt. root ( ) ) )
1985
+ ( st_mt. root ( ) , ut_mt. root ( ) )
1990
1986
} else {
1991
1987
// Nullify stake and unstake merkle roots for the legacy protocol version
1992
- Default :: default ( )
1988
+ ( hash :: EMPTY_SHA256 , hash :: EMPTY_SHA256 )
1993
1989
} ;
1994
1990
1995
1991
// Validate Merkle Root
@@ -2000,12 +1996,12 @@ pub fn validate_block_transactions(
2000
1996
commit_hash_merkle_root : Hash :: from ( co_hash_merkle_root) ,
2001
1997
reveal_hash_merkle_root : Hash :: from ( re_hash_merkle_root) ,
2002
1998
tally_hash_merkle_root : Hash :: from ( ta_hash_merkle_root) ,
2003
- stake_hash_merkle_root : st_root,
2004
- unstake_hash_merkle_root : ut_root,
1999
+ stake_hash_merkle_root : Hash :: from ( st_root) ,
2000
+ unstake_hash_merkle_root : Hash :: from ( ut_root) ,
2005
2001
} ;
2006
2002
2007
2003
if merkle_roots != block. block_header . merkle_roots {
2008
- println ! (
2004
+ log :: debug !(
2009
2005
"{:?} vs {:?}" ,
2010
2006
merkle_roots, block. block_header. merkle_roots
2011
2007
) ;
0 commit comments