Rename userdata to data (#3282)

* Rename userdata to data

Instead of saying "userdata", which is ambiguous and imprecise,
say "instruction data" or "account data".

Also, add `ProgramError::InvalidInstructionData`

Fixes #2761
This commit is contained in:
Greg Fitzgerald
2019-03-14 10:48:27 -06:00
committed by GitHub
parent de13082347
commit c1eec0290e
42 changed files with 245 additions and 254 deletions

View File

@@ -451,7 +451,7 @@ impl AccountsDB {
// when squashing.
let acc = &mut account.clone();
if account.lamports == 0 {
acc.userdata.resize(0, 0);
acc.data.resize(0, 0);
}
loop {
@@ -1617,7 +1617,7 @@ mod tests {
}
fn compare_account(account1: &Account, account2: &Account) -> bool {
if account1.userdata != account2.userdata
if account1.data != account2.data
|| account1.owner != account2.owner
|| account1.executable != account2.executable
|| account1.lamports != account2.lamports