Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 73c3455

Browse files
mvinesmergify[bot]
authored andcommitted
Rename get_account() -> get_account_data()
1 parent 1e88c13 commit 73c3455

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

feature-proposal/program/tests/functional.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ fn program_test() -> ProgramTest {
3434
pc
3535
}
3636

37-
fn get_account<T: Pack>(
37+
/// Fetch and unpack account data
38+
fn get_account_data<T: Pack>(
3839
banks_client: &mut BanksClient,
3940
address: Pubkey,
4041
) -> impl Future<Output = std::io::Result<T>> + '_ {
@@ -85,7 +86,7 @@ async fn test_basic() {
8586
assert_eq!(feature_id_acccount.data.len(), Feature::size_of());
8687

8788
// Confirm mint account state
88-
let mint = get_account::<spl_token::state::Mint>(&mut banks_client, mint_address)
89+
let mint = get_account_data::<spl_token::state::Mint>(&mut banks_client, mint_address)
8990
.await
9091
.unwrap();
9192
assert_eq!(mint.supply, 42);
@@ -95,7 +96,7 @@ async fn test_basic() {
9596

9697
// Confirm delivery token account state
9798
let delivery_token =
98-
get_account::<spl_token::state::Account>(&mut banks_client, delivery_token_address)
99+
get_account_data::<spl_token::state::Account>(&mut banks_client, delivery_token_address)
99100
.await
100101
.unwrap();
101102
assert_eq!(delivery_token.amount, 42);
@@ -105,7 +106,7 @@ async fn test_basic() {
105106

106107
// Confirm acceptance token account state
107108
let acceptance_token =
108-
get_account::<spl_token::state::Account>(&mut banks_client, acceptance_token_address)
109+
get_account_data::<spl_token::state::Account>(&mut banks_client, acceptance_token_address)
109110
.await
110111
.unwrap();
111112
assert_eq!(acceptance_token.amount, 0);
@@ -131,7 +132,7 @@ async fn test_basic() {
131132
assert_eq!(feature_id_acccount.owner, system_program::id());
132133

133134
assert!(matches!(
134-
get_account::<FeatureProposal>(&mut banks_client, feature_proposal.pubkey()).await,
135+
get_account_data::<FeatureProposal>(&mut banks_client, feature_proposal.pubkey()).await,
135136
Ok(FeatureProposal::Pending(_))
136137
));
137138

@@ -175,7 +176,7 @@ async fn test_basic() {
175176

176177
// Confirm feature proposal account state
177178
assert!(matches!(
178-
get_account::<FeatureProposal>(&mut banks_client, feature_proposal.pubkey()).await,
179+
get_account_data::<FeatureProposal>(&mut banks_client, feature_proposal.pubkey()).await,
179180
Ok(FeatureProposal::Accepted {
180181
tokens_upon_acceptance: 42
181182
})

0 commit comments

Comments
 (0)