Add config param to specify offset/length for single and program account info (bp #11515) (#11518)

* Add config param to specify offset/length for single and program account info (#11515)

* Add config param to specify dataSlice for account info and program accounts

* Use match instead of if

(cherry picked from commit 88ca04dbdb)

# Conflicts:
#	cli/src/cli.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
mergify[bot]
2020-08-11 00:03:18 +00:00
committed by GitHub
parent 23a381b995
commit 1589a41178
12 changed files with 210 additions and 26 deletions

View File

@@ -265,7 +265,7 @@ fn filter_account_result(
} else {
return (
Box::new(iter::once(UiAccount::encode(
pubkey, account, encoding, None,
pubkey, account, encoding, None, None,
))),
fork,
);
@@ -316,7 +316,7 @@ fn filter_program_results(
Box::new(
keyed_accounts.map(move |(pubkey, account)| RpcKeyedAccount {
pubkey: pubkey.to_string(),
account: UiAccount::encode(&pubkey, account, encoding.clone(), None),
account: UiAccount::encode(&pubkey, account, encoding.clone(), None, None),
}),
)
};
@@ -1033,6 +1033,7 @@ pub(crate) mod tests {
Some(RpcAccountInfoConfig {
commitment: Some(CommitmentConfig::recent()),
encoding: None,
data_slice: None,
}),
sub_id.clone(),
subscriber,
@@ -1517,6 +1518,7 @@ pub(crate) mod tests {
Some(RpcAccountInfoConfig {
commitment: Some(CommitmentConfig::single_gossip()),
encoding: None,
data_slice: None,
}),
sub_id0.clone(),
subscriber0,
@@ -1585,6 +1587,7 @@ pub(crate) mod tests {
Some(RpcAccountInfoConfig {
commitment: Some(CommitmentConfig::single_gossip()),
encoding: None,
data_slice: None,
}),
sub_id1.clone(),
subscriber1,