Slimmer implementation of credit-only accounts (#4592)

* Add credit-only debit/data check to verify_instruction

* Store credits and pass to accounts_db

* Add InstructionErrors and tests

* Relax account locks for credit-only accounts

* Collect credit-only account credits before passing to accounts_db to store properly

* Convert System Transfer  accounts to credit-only, and fixup test

* Functionalize collect_accounts to unit test

* Review comments

* Rebase
This commit is contained in:
Tyera Eulberg
2019-06-10 20:50:02 -06:00
committed by GitHub
parent 9259d342ac
commit 807c69d97c
11 changed files with 474 additions and 127 deletions

View File

@@ -52,6 +52,12 @@ pub enum InstructionError {
/// Program modified the data of an account that doesn't belong to it
ExternalAccountDataModified,
/// Credit-only account spent lamports
CreditOnlyLamportSpend,
/// Credit-only account modified data
CreditOnlyDataModified,
/// An account was referenced more than once in a single instruction
DuplicateAccountIndex,