File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
sp-domains-fraud-proof/src
domains/client/domain-operator/src Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ async fn benchmark_bundle_with_evm_tx(
39
39
mut alice : EvmDomainNode ,
40
40
mut ferdie : MockConsensusNode ,
41
41
) -> ( Vec < Vec < u8 > > , StorageProof ) {
42
- let account_infos = ( 1 ..tx_to_create)
42
+ let account_infos = ( 0 ..tx_to_create)
43
43
. map ( |i| address_build ( i as u128 ) )
44
44
. collect :: < Vec < AccountInfo > > ( ) ;
45
45
@@ -606,7 +606,7 @@ async fn test_evm_domain_block_fee() {
606
606
// Create more accounts and fund these accounts
607
607
let tx_to_create = 3 ;
608
608
let account_infos = ( 0 ..tx_to_create)
609
- . map ( |i| address_build ( i as u128 + 1 ) )
609
+ . map ( |i| address_build ( i as u128 ) )
610
610
. collect :: < Vec < AccountInfo > > ( ) ;
611
611
let alice_balance = alice. free_balance ( Alice . to_account_id ( ) ) ;
612
612
for ( i, account_info) in account_infos. iter ( ) . enumerate ( ) {
Original file line number Diff line number Diff line change @@ -26,8 +26,10 @@ pub struct AccountInfo {
26
26
}
27
27
28
28
/// Returns an AccountInfo struct with a deterministic address and private key.
29
- /// Seed zero produces an invalid private key.
30
- pub fn address_build ( seed : u128 ) -> AccountInfo {
29
+ /// Seed zero produces an invalid private key, so we add one to the supplied seed.
30
+ pub fn address_build ( mut seed : u128 ) -> AccountInfo {
31
+ seed += 1 ;
32
+
31
33
let mut seed_bytes = [ 0u8 ; 32 ] ;
32
34
seed_bytes[ 0 ..16 ] . copy_from_slice ( & seed. to_be_bytes ( ) ) ;
33
35
let private_key = H256 :: from_slice ( & seed_bytes) ;
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ async fn test_evm_domain_create_contracts_with_allow_list() {
237
237
// Create more accounts and fund those accounts
238
238
let tx_to_create = 5 ;
239
239
let account_infos = ( 0 ..tx_to_create)
240
- . map ( |i| address_build ( i as u128 + 1 ) )
240
+ . map ( |i| address_build ( i as u128 ) )
241
241
. collect :: < Vec < AccountInfo > > ( ) ;
242
242
let alice_balance = alice. free_balance ( Alice . to_account_id ( ) ) ;
243
243
for ( i, account_info) in account_infos. iter ( ) . enumerate ( ) {
@@ -4657,7 +4657,7 @@ async fn test_domain_sudo_calls() {
4657
4657
// once the call is executed in the domain, list will be updated.
4658
4658
let accounts_to_create = 4 ;
4659
4659
let account_infos = ( 0 ..accounts_to_create)
4660
- . map ( |i| address_build ( i as u128 + 1 ) )
4660
+ . map ( |i| address_build ( i as u128 ) )
4661
4661
. collect :: < Vec < AccountInfo > > ( ) ;
4662
4662
4663
4663
// Start with a redundant set to make sure the test framework works.
You can’t perform that action at this time.
0 commit comments