mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf: query accounts with &Address to avoid copying address (#13554)
This commit is contained in:
@ -939,17 +939,17 @@ mod tests {
|
||||
|
||||
// assert accounts
|
||||
assert_eq!(
|
||||
provider.basic_account(account1),
|
||||
provider.basic_account(&account1),
|
||||
Ok(Some(account1_info)),
|
||||
"Post changed of a account"
|
||||
);
|
||||
assert_eq!(
|
||||
provider.basic_account(account2),
|
||||
provider.basic_account(&account2),
|
||||
Ok(Some(account2_info)),
|
||||
"Post changed of a account"
|
||||
);
|
||||
assert_eq!(
|
||||
provider.basic_account(account3),
|
||||
provider.basic_account(&account3),
|
||||
Ok(Some(account3_info)),
|
||||
"Post changed of a account"
|
||||
);
|
||||
@ -1075,19 +1075,19 @@ mod tests {
|
||||
|
||||
// assert unwind stage
|
||||
assert_eq!(
|
||||
provider.basic_account(acc1),
|
||||
provider.basic_account(&acc1),
|
||||
Ok(Some(acc1_info)),
|
||||
"Pre changed of a account"
|
||||
);
|
||||
assert_eq!(
|
||||
provider.basic_account(acc2),
|
||||
provider.basic_account(&acc2),
|
||||
Ok(Some(acc2_info)),
|
||||
"Post changed of a account"
|
||||
);
|
||||
|
||||
let miner_acc = address!("2adc25665018aa1fe0e6bc666dac8fc2697ff9ba");
|
||||
assert_eq!(
|
||||
provider.basic_account(miner_acc),
|
||||
provider.basic_account(&miner_acc),
|
||||
Ok(None),
|
||||
"Third account should be unwound"
|
||||
);
|
||||
@ -1173,7 +1173,7 @@ mod tests {
|
||||
|
||||
// assert unwind stage
|
||||
let provider = test_db.factory.database_provider_rw().unwrap();
|
||||
assert_eq!(provider.basic_account(destroyed_address), Ok(None), "Account was destroyed");
|
||||
assert_eq!(provider.basic_account(&destroyed_address), Ok(None), "Account was destroyed");
|
||||
|
||||
assert_eq!(
|
||||
provider.tx_ref().get::<tables::PlainStorageState>(destroyed_address),
|
||||
|
||||
Reference in New Issue
Block a user