@@ -2978,6 +2978,7 @@ fn test_empty_commit(c_tx: &CommitTransaction) -> Result<(), failure::Error> {
29782978 let minimum_reppoe_difficulty = 1 ;
29792979 let utxo_diff = UtxoDiff :: new ( & utxo_set, block_number) ;
29802980 let superblock_period = 1 ;
2981+ let stakes = Stakes :: < PublicKeyHash , Wit , u32 , u64 > :: default ( ) ;
29812982
29822983 validate_commit_transaction (
29832984 c_tx,
@@ -2994,6 +2995,8 @@ fn test_empty_commit(c_tx: &CommitTransaction) -> Result<(), failure::Error> {
29942995 minimum_reppoe_difficulty,
29952996 & current_active_wips ( ) ,
29962997 superblock_period,
2998+ ProtocolVersion :: V1_7 ,
2999+ & stakes,
29973000 )
29983001 . map ( |_| ( ) )
29993002}
@@ -3035,6 +3038,8 @@ fn test_commit_with_dr_and_utxo_set(
30353038 . unwrap ( ) ;
30363039
30373040 let mut signatures_to_verify = vec ! [ ] ;
3041+ let stakes = Stakes :: < PublicKeyHash , Wit , u32 , u64 > :: default ( ) ;
3042+
30383043 validate_commit_transaction (
30393044 c_tx,
30403045 & dr_pool,
@@ -3050,6 +3055,8 @@ fn test_commit_with_dr_and_utxo_set(
30503055 minimum_reppoe_difficulty,
30513056 & current_active_wips ( ) ,
30523057 superblock_period,
3058+ ProtocolVersion :: V1_7 ,
3059+ & stakes,
30533060 ) ?;
30543061 verify_signatures_test ( signatures_to_verify) ?;
30553062
@@ -3125,6 +3132,8 @@ fn test_commit_difficult_proof() {
31253132
31263133 let mut signatures_to_verify = vec ! [ ] ;
31273134 let superblock_period = 8 ;
3135+ let stakes = Stakes :: < PublicKeyHash , Wit , u32 , u64 > :: default ( ) ;
3136+
31283137 let x = validate_commit_transaction (
31293138 & c_tx,
31303139 & dr_pool,
@@ -3140,6 +3149,8 @@ fn test_commit_difficult_proof() {
31403149 minimum_reppoe_difficulty,
31413150 & active_wips,
31423151 superblock_period,
3152+ ProtocolVersion :: V1_7 ,
3153+ & stakes,
31433154 )
31443155 . and_then ( |_| verify_signatures_test ( signatures_to_verify) ) ;
31453156
@@ -3203,6 +3214,7 @@ fn test_commit_with_collateral(
32033214 let c_tx = CommitTransaction :: new ( cb, vec ! [ cs] ) ;
32043215
32053216 let superblock_period = 1 ;
3217+ let stakes = Stakes :: < PublicKeyHash , Wit , u32 , u64 > :: default ( ) ;
32063218
32073219 validate_commit_transaction (
32083220 & c_tx,
@@ -3219,6 +3231,8 @@ fn test_commit_with_collateral(
32193231 minimum_reppoe_difficulty,
32203232 & current_active_wips ( ) ,
32213233 superblock_period,
3234+ ProtocolVersion :: V1_7 ,
3235+ & stakes,
32223236 )
32233237 . map ( |_| ( ) )
32243238}
@@ -3451,6 +3465,7 @@ fn commitment_invalid_proof() {
34513465 let mut signatures_to_verify = vec ! [ ] ;
34523466
34533467 let superblock_period = 1 ;
3468+ let stakes = Stakes :: < PublicKeyHash , Wit , u32 , u64 > :: default ( ) ;
34543469
34553470 let x = validate_commit_transaction (
34563471 & c_tx,
@@ -3467,6 +3482,8 @@ fn commitment_invalid_proof() {
34673482 minimum_reppoe_difficulty,
34683483 & current_active_wips ( ) ,
34693484 superblock_period,
3485+ ProtocolVersion :: V1_7 ,
3486+ & stakes,
34703487 )
34713488 . and_then ( |_| verify_signatures_test ( signatures_to_verify) ) ;
34723489
@@ -3530,6 +3547,7 @@ fn commitment_dr_in_reveal_stage() {
35303547 let mut signatures_to_verify = vec ! [ ] ;
35313548
35323549 let superblock_period = 1 ;
3550+ let stakes = Stakes :: < PublicKeyHash , Wit , u32 , u64 > :: default ( ) ;
35333551
35343552 let x = validate_commit_transaction (
35353553 & c_tx,
@@ -3546,6 +3564,8 @@ fn commitment_dr_in_reveal_stage() {
35463564 minimum_reppoe_difficulty,
35473565 & current_active_wips ( ) ,
35483566 superblock_period,
3567+ ProtocolVersion :: V1_7 ,
3568+ & stakes,
35493569 ) ;
35503570 assert_eq ! (
35513571 x. unwrap_err( ) . downcast:: <DataRequestError >( ) . unwrap( ) ,
@@ -3918,6 +3938,7 @@ fn commitment_collateral_zero_is_minimum() {
39183938 let c_tx = CommitTransaction :: new ( cb, vec ! [ cs] ) ;
39193939
39203940 let superblock_period = 1 ;
3941+ let stakes = Stakes :: < PublicKeyHash , Wit , u32 , u64 > :: default ( ) ;
39213942
39223943 validate_commit_transaction (
39233944 & c_tx,
@@ -3934,6 +3955,8 @@ fn commitment_collateral_zero_is_minimum() {
39343955 minimum_reppoe_difficulty,
39353956 & current_active_wips ( ) ,
39363957 superblock_period,
3958+ ProtocolVersion :: V1_7 ,
3959+ & stakes,
39373960 )
39383961 . map ( |_| ( ) )
39393962 } ;
@@ -4014,6 +4037,8 @@ fn commitment_timelock() {
40144037
40154038 let mut signatures_to_verify = vec ! [ ] ;
40164039 let superblock_period = 1 ;
4040+ let stakes = Stakes :: < PublicKeyHash , Wit , u32 , u64 > :: default ( ) ;
4041+
40174042 validate_commit_transaction (
40184043 & c_tx,
40194044 & dr_pool,
@@ -4029,6 +4054,8 @@ fn commitment_timelock() {
40294054 minimum_reppoe_difficulty,
40304055 & active_wips,
40314056 superblock_period,
4057+ ProtocolVersion :: V1_7 ,
4058+ & stakes,
40324059 )
40334060 . map ( |_| ( ) ) ?;
40344061
@@ -8964,7 +8991,7 @@ fn test_block_with_drpool<F: FnMut(&mut Block) -> bool>(
89648991
89658992fn test_block_with_drpool_and_utxo_set < F : FnMut ( & mut Block ) -> bool > (
89668993 mut mut_block : F ,
8967- dr_pool : DataRequestPool ,
8994+ mut dr_pool : DataRequestPool ,
89688995 mut utxo_set : UnspentOutputsPool ,
89698996 current_epoch : u32 ,
89708997) -> Result < ( ) , failure:: Error > {
@@ -9081,7 +9108,7 @@ fn test_block_with_drpool_and_utxo_set<F: FnMut(&mut Block) -> bool>(
90819108
90829109 validate_block_transactions (
90839110 & utxo_set,
9084- & dr_pool,
9111+ & mut dr_pool,
90859112 & b,
90869113 vrf_input,
90879114 & mut signatures_to_verify,
@@ -9244,7 +9271,7 @@ fn block_invalid_poe() {
92449271
92459272#[ test]
92469273fn block_difficult_proof ( ) {
9247- let dr_pool = DataRequestPool :: default ( ) ;
9274+ let mut dr_pool = DataRequestPool :: default ( ) ;
92489275 let vrf = & mut VrfCtx :: secp256k1 ( ) . unwrap ( ) ;
92499276
92509277 // Create a reputation engine with 512 identities
@@ -9340,7 +9367,7 @@ fn block_difficult_proof() {
93409367 let b = Block :: new ( block_header, block_sig, txns) ;
93419368
93429369 let x = {
9343- let x = || -> Result < _ , failure:: Error > {
9370+ let mut x = || -> Result < _ , failure:: Error > {
93449371 let mut signatures_to_verify = vec ! [ ] ;
93459372
93469373 validate_block (
@@ -9360,7 +9387,7 @@ fn block_difficult_proof() {
93609387
93619388 validate_block_transactions (
93629389 & utxo_set,
9363- & dr_pool,
9390+ & mut dr_pool,
93649391 & b,
93659392 vrf_input,
93669393 & mut signatures_to_verify,
@@ -9960,7 +9987,7 @@ fn test_blocks_with_limits(
99609987 unimplemented ! ( ) ;
99619988 }
99629989
9963- let dr_pool = DataRequestPool :: default ( ) ;
9990+ let mut dr_pool = DataRequestPool :: default ( ) ;
99649991 let vrf = & mut VrfCtx :: secp256k1 ( ) . unwrap ( ) ;
99659992 let rep_eng = ReputationEngine :: new ( 100 ) ;
99669993 let mut utxo_set = UnspentOutputsPool :: default ( ) ;
@@ -10072,7 +10099,7 @@ fn test_blocks_with_limits(
1007210099 // Do the expensive validation
1007310100 validate_block_transactions (
1007410101 & utxo_set,
10075- & dr_pool,
10102+ & mut dr_pool,
1007610103 & b,
1007710104 vrf_input,
1007810105 & mut signatures_to_verify,
@@ -10607,7 +10634,7 @@ fn genesis_block_value_overflow() {
1060710634 ] ,
1060810635 ) ;
1060910636
10610- let dr_pool = DataRequestPool :: default ( ) ;
10637+ let mut dr_pool = DataRequestPool :: default ( ) ;
1061110638 let rep_eng = ReputationEngine :: new ( 100 ) ;
1061210639 let utxo_set = UnspentOutputsPool :: default ( ) ;
1061310640 let stakes = Stakes :: < PublicKeyHash , Wit , u32 , u64 > :: default ( ) ;
@@ -10669,7 +10696,7 @@ fn genesis_block_value_overflow() {
1066910696 // Do the expensive validation
1067010697 let x = validate_block_transactions (
1067110698 & utxo_set,
10672- & dr_pool,
10699+ & mut dr_pool,
1067310700 & b,
1067410701 vrf_input,
1067510702 & mut signatures_to_verify,
@@ -10696,7 +10723,7 @@ fn genesis_block_full_validate() {
1069610723 let b = Block :: genesis ( bootstrap_hash, vec ! [ ] ) ;
1069710724 let vrf_input = CheckpointVRF :: default ( ) ;
1069810725
10699- let dr_pool = DataRequestPool :: default ( ) ;
10726+ let mut dr_pool = DataRequestPool :: default ( ) ;
1070010727 let rep_eng = ReputationEngine :: new ( 100 ) ;
1070110728 let utxo_set = UnspentOutputsPool :: default ( ) ;
1070210729 let stakes = Stakes :: < PublicKeyHash , Wit , u32 , u64 > :: default ( ) ;
@@ -10757,7 +10784,7 @@ fn genesis_block_full_validate() {
1075710784 // Do the expensive validation
1075810785 validate_block_transactions (
1075910786 & utxo_set,
10760- & dr_pool,
10787+ & mut dr_pool,
1076110788 & b,
1076210789 vrf_input,
1076310790 & mut signatures_to_verify,
@@ -10806,7 +10833,7 @@ fn validate_block_transactions_uses_block_number_in_utxo_diff() {
1080610833 initial_block_reward : INITIAL_BLOCK_REWARD ,
1080710834 halving_period : HALVING_PERIOD ,
1080810835 } ;
10809- let dr_pool = DataRequestPool :: default ( ) ;
10836+ let mut dr_pool = DataRequestPool :: default ( ) ;
1081010837 let vrf = & mut VrfCtx :: secp256k1 ( ) . unwrap ( ) ;
1081110838 let rep_eng = ReputationEngine :: new ( 100 ) ;
1081210839 let utxo_set = UnspentOutputsPool :: default ( ) ;
@@ -10848,7 +10875,7 @@ fn validate_block_transactions_uses_block_number_in_utxo_diff() {
1084810875
1084910876 validate_block_transactions (
1085010877 & utxo_set,
10851- & dr_pool,
10878+ & mut dr_pool,
1085210879 & b,
1085310880 vrf_input,
1085410881 & mut signatures_to_verify,
@@ -11015,7 +11042,7 @@ fn validate_commit_transactions_included_in_utxo_diff() {
1101511042
1101611043 validate_block_transactions (
1101711044 & utxo_set,
11018- & dr_pool,
11045+ & mut dr_pool,
1101911046 & b,
1102011047 vrf_input,
1102111048 & mut signatures_to_verify,
@@ -11181,7 +11208,7 @@ fn validate_required_tally_not_found() {
1118111208
1118211209 let e = validate_block_transactions (
1118311210 & UnspentOutputsPool :: default ( ) ,
11184- & dr_pool,
11211+ & mut dr_pool,
1118511212 & b,
1118611213 CheckpointVRF :: default ( ) ,
1118711214 & mut vec ! [ ] ,
0 commit comments