Remove credit-only account handling (#6726)

* Renaming
- credit-only/credit-debit to read-only/read-write
- debitable to writable

* Remove credit handling, making credit-only accounts read-only

* Update programs to remove deprecated credit-only account designation

* Use readonly and writable instead of underscored types
This commit is contained in:
Tyera Eulberg
2019-11-05 09:38:35 -07:00
committed by GitHub
parent cea13e964c
commit c6931dcb07
20 changed files with 344 additions and 621 deletions

View File

@ -423,7 +423,7 @@ mod tests {
let mut to_account = Account::new(1, 0, &Pubkey::new(&[3; 32])); // account owner should not matter
transfer_lamports(
&mut KeyedAccount::new(&from, true, &mut from_account),
&mut KeyedAccount::new_credit_only(&to, false, &mut to_account),
&mut KeyedAccount::new(&to, false, &mut to_account),
50,
)
.unwrap();
@ -435,7 +435,7 @@ mod tests {
// Attempt to move more lamports than remaining in from_account
let result = transfer_lamports(
&mut KeyedAccount::new(&from, true, &mut from_account),
&mut KeyedAccount::new_credit_only(&to, false, &mut to_account),
&mut KeyedAccount::new(&to, false, &mut to_account),
100,
);
assert_eq!(result, Err(SystemError::ResultWithNegativeLamports.into()));
@ -445,7 +445,7 @@ mod tests {
// test unsigned transfer of zero
assert!(transfer_lamports(
&mut KeyedAccount::new(&from, false, &mut from_account),
&mut KeyedAccount::new_credit_only(&to, false, &mut to_account),
&mut KeyedAccount::new(&to, false, &mut to_account),
0,
)
.is_ok(),);