perf: query accounts with &Address to avoid copying address (#13554)

This commit is contained in:
Hai | RISE
2024-12-25 19:31:28 +07:00
committed by GitHub
parent 14c1c0be69
commit 031f430b8f
27 changed files with 74 additions and 71 deletions

View File

@ -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),