Skip to content

Commit 1a5aed6

Browse files
authored
svm-test-harness: rename modified to resulting accts (anza-xyz#9679)
fix-instr: modified to resulting accts
1 parent 9938b5c commit 1a5aed6

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

svm-test-harness/fixture/src/instr_effects.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ use {solana_account::Account, solana_instruction_error::InstructionError, solana
66
pub struct InstrEffects {
77
pub result: Option<InstructionError>,
88
pub custom_err: Option<u32>,
9-
pub modified_accounts: Vec<(Pubkey, Account)>,
9+
pub resulting_accounts: Vec<(Pubkey, Account)>,
1010
pub cu_avail: u64,
1111
pub return_data: Vec<u8>,
1212
pub logs: Vec<String>,
1313
}
1414

1515
impl InstrEffects {
16-
/// Returns the modified account for the given pubkey, if it exists.
16+
/// Returns the resulting account for the given pubkey, if it exists.
1717
pub fn get_account(&self, pubkey: &Pubkey) -> Option<&Account> {
18-
self.modified_accounts
18+
self.resulting_accounts
1919
.iter()
2020
.find(|(pk, _)| pk == pubkey)
2121
.map(|(_, acc)| acc)
@@ -31,7 +31,7 @@ impl From<InstrEffects> for ProtoInstrEffects {
3131
let InstrEffects {
3232
result,
3333
custom_err,
34-
modified_accounts,
34+
resulting_accounts,
3535
cu_avail,
3636
return_data,
3737
..
@@ -47,7 +47,7 @@ impl From<InstrEffects> for ProtoInstrEffects {
4747
})
4848
.unwrap_or_default(),
4949
custom_err: custom_err.unwrap_or_default(),
50-
modified_accounts: modified_accounts.into_iter().map(Into::into).collect(),
50+
modified_accounts: resulting_accounts.into_iter().map(Into::into).collect(),
5151
cu_avail,
5252
return_data,
5353
}

svm-test-harness/instr/src/harness.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub fn execute_instr(
206206
None
207207
},
208208
result: result.err(),
209-
modified_accounts: transaction_context
209+
resulting_accounts: transaction_context
210210
.deconstruct_without_keys()
211211
.unwrap()
212212
.into_iter()
@@ -406,14 +406,14 @@ mod tests {
406406

407407
// Verify account changes.
408408
let from_account = effects
409-
.modified_accounts
409+
.resulting_accounts
410410
.iter()
411411
.find(|(k, _)| k == &from_pubkey)
412412
.unwrap();
413413
assert_eq!(from_account.1.lamports, 999);
414414

415415
let to_account = effects
416-
.modified_accounts
416+
.resulting_accounts
417417
.iter()
418418
.find(|(k, _)| k == &to_pubkey)
419419
.unwrap();

0 commit comments

Comments
 (0)