Fix getProgramAccounts RPC (#5024)

* Use scan_accounts to load accounts by program_id

* Add bank test

* Use get_program_accounts in RPC
This commit is contained in:
Tyera Eulberg
2019-07-11 12:58:28 -06:00
committed by GitHub
parent 2c8d6f87e6
commit b2c776eabc
3 changed files with 80 additions and 7 deletions

View File

@ -73,7 +73,7 @@ impl JsonRpcRequestProcessor {
pub fn get_program_accounts(&self, program_id: &Pubkey) -> Result<Vec<(String, Account)>> {
Ok(self
.bank()
.get_program_accounts_modified_since_parent(&program_id)
.get_program_accounts(&program_id)
.into_iter()
.map(|(pubkey, account)| (pubkey.to_string(), account))
.collect())