File tree 3 files changed +8
-6
lines changed
sp-domains-fraud-proof/src
domains/client/domain-operator/src
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 @@ -290,7 +290,7 @@ async fn test_evm_domain_create_contracts_with_allow_list() {
290
290
// Create more accounts and fund these accounts
291
291
let tx_to_create = 5 ;
292
292
let account_infos = ( 0 ..tx_to_create)
293
- . map ( |i| address_build ( i as u128 + 1 ) )
293
+ . map ( |i| address_build ( i as u128 ) )
294
294
. collect :: < Vec < AccountInfo > > ( ) ;
295
295
let alice_balance = alice. free_balance ( Alice . to_account_id ( ) ) ;
296
296
for ( i, account_info) in account_infos. iter ( ) . enumerate ( ) {
@@ -4710,7 +4710,7 @@ async fn test_domain_sudo_calls() {
4710
4710
// once the call is executed in the domain, list will be updated.
4711
4711
let accounts_to_create = 4 ;
4712
4712
let account_infos = ( 0 ..accounts_to_create)
4713
- . map ( |i| address_build ( i as u128 + 1 ) )
4713
+ . map ( |i| address_build ( i as u128 ) )
4714
4714
. collect :: < Vec < AccountInfo > > ( ) ;
4715
4715
4716
4716
// Start with a redundant set to make sure the test framework works.
You can’t perform that action at this time.
0 commit comments