Skip to content

Commit

Permalink
chore: print discriminators in getAccountState.sh (Lightprotocol#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
ananas-block authored May 1, 2024
1 parent 4d3d73e commit 041048a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion programs/compressed-pda/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,13 @@ async fn regenerate_accounts() {
for (name, pubkey) in pubkeys {
// Fetch account data. Adjust this part to match how you retrieve and structure your account data.
let account = context.banks_client.get_account(pubkey).await.unwrap();
println!(
"{} DISCRIMINATOR {:?}",
name,
account.as_ref().unwrap().data[0..8].to_vec()
);
let account = CliAccount::new(&pubkey, &account.unwrap(), true);

// Serialize the account data to JSON. Adjust according to your data structure.
let json_data = serde_json::to_vec(&account).unwrap();

Expand All @@ -995,7 +1001,6 @@ async fn regenerate_accounts() {
async_write(file_path.clone(), json_data).await.unwrap();
}
}

#[derive(Debug)]
pub struct MockIndexer {
pub merkle_tree_pubkey: Pubkey,
Expand Down
2 changes: 1 addition & 1 deletion scripts/getAccountState.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
# group_pda
#
# to add more accounts to regenerate, add them to setup_test_programs_with_accounts and test script
cd programs/compressed-pda && cargo test-sbf regenerate_accounts -- --ignored && cd -
cd programs/compressed-pda && cargo test-sbf regenerate_accounts -- --ignored --nocapture && cd -

0 comments on commit 041048a

Please sign in to comment.