@@ -556,7 +556,7 @@ where
556556 {
557557 let height1_u64 = rng. gen_range :: < u64 , _ > ( 1 ..i64:: MAX as u64 ) ;
558558 let height1 = height1_u64. into ( ) ;
559- let random_block_timestamp = BlockTimestamp :: from_int_seconds ( rng. gen :: < u64 > ( ) ) ;
559+ let random_block_timestamp = BlockTimestamp :: from_int_seconds ( rng. random :: < u64 > ( ) ) ;
560560 let aux_data1 =
561561 BlockAuxData :: new ( owning_block1. into ( ) , height1, random_block_timestamp) ;
562562 db_tx. set_block_aux_data ( owning_block1, & aux_data1) . await . unwrap ( ) ;
@@ -602,7 +602,7 @@ where
602602 let mut db_tx = storage. transaction_rw ( ) . await . unwrap ( ) ;
603603
604604 let random_block_id = Id :: < Block > :: random_using ( & mut rng) ;
605- let random_block_timestamp = BlockTimestamp :: from_int_seconds ( rng. gen :: < u64 > ( ) ) ;
605+ let random_block_timestamp = BlockTimestamp :: from_int_seconds ( rng. random :: < u64 > ( ) ) ;
606606 let block = db_tx. get_block_aux_data ( random_block_id) . await . unwrap ( ) ;
607607 assert ! ( block. is_none( ) ) ;
608608
@@ -619,7 +619,7 @@ where
619619 // Test overwrite
620620 let height2_u64 = rng. gen_range :: < u64 , _ > ( 1 ..i64:: MAX as u64 ) ;
621621 let height2 = height2_u64. into ( ) ;
622- let random_block_timestamp = BlockTimestamp :: from_int_seconds ( rng. gen :: < u64 > ( ) ) ;
622+ let random_block_timestamp = BlockTimestamp :: from_int_seconds ( rng. random :: < u64 > ( ) ) ;
623623 let aux_data2 =
624624 BlockAuxData :: new ( existing_block_id. into ( ) , height2, random_block_timestamp) ;
625625 db_tx. set_block_aux_data ( existing_block_id, & aux_data2) . await . unwrap ( ) ;
@@ -652,7 +652,7 @@ where
652652 let random_tx_id = Id :: < Transaction > :: random_using ( & mut rng) ;
653653 let outpoint = UtxoOutPoint :: new (
654654 OutPointSourceId :: Transaction ( random_tx_id) ,
655- rng. gen :: < u32 > ( ) ,
655+ rng. random :: < u32 > ( ) ,
656656 ) ;
657657 let output = TxOutput :: Transfer (
658658 OutputValue :: Coin ( Amount :: from_atoms ( rng. gen_range ( 1 ..1000 ) ) ) ,
@@ -768,7 +768,7 @@ where
768768 let random_tx_id = Id :: < Transaction > :: random_using ( & mut rng) ;
769769 let outpoint = UtxoOutPoint :: new (
770770 OutPointSourceId :: Transaction ( random_tx_id) ,
771- rng. gen :: < u32 > ( ) ,
771+ rng. random :: < u32 > ( ) ,
772772 ) ;
773773 let output = TxOutput :: Transfer (
774774 OutputValue :: Coin ( Amount :: from_atoms ( rng. gen_range ( 1 ..1000 ) ) ) ,
@@ -820,7 +820,7 @@ where
820820 let random_tx_id = Id :: < Transaction > :: random_using ( & mut rng) ;
821821 let locked_outpoint = UtxoOutPoint :: new (
822822 OutPointSourceId :: Transaction ( random_tx_id) ,
823- rng. gen :: < u32 > ( ) ,
823+ rng. random :: < u32 > ( ) ,
824824 ) ;
825825 let locked_output = TxOutput :: Transfer (
826826 OutputValue :: Coin ( Amount :: from_atoms ( rng. gen_range ( 1 ..1000 ) ) ) ,
@@ -879,7 +879,7 @@ where
879879 let random_tx_id = Id :: < Transaction > :: random_using ( & mut rng) ;
880880 let outpoint2 = UtxoOutPoint :: new (
881881 OutPointSourceId :: Transaction ( random_tx_id) ,
882- rng. gen :: < u32 > ( ) ,
882+ rng. random :: < u32 > ( ) ,
883883 ) ;
884884 let output2 = TxOutput :: Transfer (
885885 OutputValue :: Coin ( Amount :: from_atoms ( rng. gen_range ( 1 ..1000 ) ) ) ,
@@ -1118,10 +1118,10 @@ where
11181118
11191119 {
11201120 let random_pool_id = PoolId :: random_using ( & mut rng) ;
1121- let random_block_height = BlockHeight :: new ( rng. gen :: < u32 > ( ) as u64 ) ;
1121+ let random_block_height = BlockHeight :: new ( rng. random :: < u32 > ( ) as u64 ) ;
11221122 let ( _, vrf_pk) = VRFPrivateKey :: new_from_rng ( & mut rng, VRFKeyKind :: Schnorrkel ) ;
1123- let amount_to_stake = Amount :: from_atoms ( rng. gen :: < u128 > ( ) ) ;
1124- let cost_per_block = Amount :: from_atoms ( rng. gen :: < u128 > ( ) ) ;
1123+ let amount_to_stake = Amount :: from_atoms ( rng. random :: < u128 > ( ) ) ;
1124+ let cost_per_block = Amount :: from_atoms ( rng. random :: < u128 > ( ) ) ;
11251125
11261126 let ( _, pk) = PrivateKey :: new_from_rng ( & mut rng, KeyKind :: Secp256k1Schnorr ) ;
11271127
@@ -1152,13 +1152,13 @@ where
11521152 let ( _, vrf_pk) = VRFPrivateKey :: new_from_rng ( & mut rng, VRFKeyKind :: Schnorrkel ) ;
11531153 let ( _, pk) = PrivateKey :: new_from_rng ( & mut rng, KeyKind :: Secp256k1Schnorr ) ;
11541154 let amount_to_stake = {
1155- let mut amount_to_stake = Amount :: from_atoms ( rng. gen :: < u128 > ( ) ) ;
1155+ let mut amount_to_stake = Amount :: from_atoms ( rng. random :: < u128 > ( ) ) ;
11561156 while amount_to_stake == random_pool_data. staker_balance ( ) . unwrap ( ) {
1157- amount_to_stake = Amount :: from_atoms ( rng. gen :: < u128 > ( ) ) ;
1157+ amount_to_stake = Amount :: from_atoms ( rng. random :: < u128 > ( ) ) ;
11581158 }
11591159 amount_to_stake
11601160 } ;
1161- let cost_per_block = Amount :: from_atoms ( rng. gen :: < u128 > ( ) ) ;
1161+ let cost_per_block = Amount :: from_atoms ( rng. random :: < u128 > ( ) ) ;
11621162 let margin_ratio_per_thousand = rng. gen_range ( 1 ..=1000 ) ;
11631163 let random_pool_data2 = PoolData :: new (
11641164 Destination :: PublicKey ( pk) ,
@@ -1169,9 +1169,9 @@ where
11691169 cost_per_block,
11701170 ) ;
11711171 let random_block_height2 = {
1172- let mut height = BlockHeight :: new ( rng. gen :: < u32 > ( ) as u64 ) ;
1172+ let mut height = BlockHeight :: new ( rng. random :: < u32 > ( ) as u64 ) ;
11731173 while height == random_block_height {
1174- height = BlockHeight :: new ( rng. gen :: < u32 > ( ) as u64 )
1174+ height = BlockHeight :: new ( rng. random :: < u32 > ( ) as u64 )
11751175 }
11761176 height
11771177 } ;
@@ -1220,8 +1220,8 @@ where
12201220 // update the first one
12211221 let ( _, vrf_pk) = VRFPrivateKey :: new_from_rng ( & mut rng, VRFKeyKind :: Schnorrkel ) ;
12221222 let ( _, pk) = PrivateKey :: new_from_rng ( & mut rng, KeyKind :: Secp256k1Schnorr ) ;
1223- let amount_to_stake = Amount :: from_atoms ( rng. gen :: < u128 > ( ) ) ;
1224- let cost_per_block = Amount :: from_atoms ( rng. gen :: < u128 > ( ) ) ;
1223+ let amount_to_stake = Amount :: from_atoms ( rng. random :: < u128 > ( ) ) ;
1224+ let cost_per_block = Amount :: from_atoms ( rng. random :: < u128 > ( ) ) ;
12251225 let margin_ratio_per_thousand = rng. gen_range ( 1 ..=1000 ) ;
12261226 let random_pool_data_new = PoolData :: new (
12271227 Destination :: PublicKey ( pk. clone ( ) ) ,
@@ -1346,10 +1346,10 @@ where
13461346 let ( _, pk) = PrivateKey :: new_from_rng ( & mut rng, KeyKind :: Secp256k1Schnorr ) ;
13471347 let random_pool_id = PoolId :: random_using ( & mut rng) ;
13481348 let random_pool_id2 = PoolId :: random_using ( & mut rng) ;
1349- let random_balance = Amount :: from_atoms ( rng. gen :: < u128 > ( ) ) ;
1350- let random_balance2 = Amount :: from_atoms ( rng. gen :: < u128 > ( ) ) ;
1351- let random_nonce = AccountNonce :: new ( rng. gen :: < u64 > ( ) ) ;
1352- let random_nonce2 = AccountNonce :: new ( rng. gen :: < u64 > ( ) ) ;
1349+ let random_balance = Amount :: from_atoms ( rng. random :: < u128 > ( ) ) ;
1350+ let random_balance2 = Amount :: from_atoms ( rng. random :: < u128 > ( ) ) ;
1351+ let random_nonce = AccountNonce :: new ( rng. random :: < u64 > ( ) ) ;
1352+ let random_nonce2 = AccountNonce :: new ( rng. random :: < u64 > ( ) ) ;
13531353
13541354 let random_delegation = Delegation :: new (
13551355 random_block_height,
@@ -1406,8 +1406,8 @@ where
14061406 assert_eq ! ( delegation, & random_delegation2) ;
14071407
14081408 // update delegation on new height
1409- let random_balance = Amount :: from_atoms ( rng. gen :: < u128 > ( ) ) ;
1410- let random_nonce = AccountNonce :: new ( rng. gen :: < u64 > ( ) ) ;
1409+ let random_balance = Amount :: from_atoms ( rng. random :: < u128 > ( ) ) ;
1410+ let random_nonce = AccountNonce :: new ( rng. random :: < u64 > ( ) ) ;
14111411
14121412 let random_delegation_new = Delegation :: new (
14131413 random_block_height,
@@ -2176,7 +2176,7 @@ fn random_order(
21762176 initially_asked : ask_amount,
21772177 ask_balance : ask_amount,
21782178 is_frozen : false ,
2179- next_nonce : AccountNonce :: new ( rng. gen :: < u64 > ( ) ) ,
2179+ next_nonce : AccountNonce :: new ( rng. random :: < u64 > ( ) ) ,
21802180 } ;
21812181 ( order_id, order)
21822182}
0 commit comments