Skip to content

Commit

Permalink
Fix add_empty_account_with_anchor for future Anchor versions (coral-x…
Browse files Browse the repository at this point in the history
  • Loading branch information
andreisilviudragnea committed Aug 14, 2024
1 parent f0d5f07 commit 0a57915
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/extensions/program_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl ProgramTestExtension for ProgramTest {
anchor_data: T,
executable: bool,
) {
let discriminator = &T::discriminator();
let discriminator = &T::DISCRIMINATOR;
let data = anchor_data
.try_to_vec()
.expect("Cannot serialize provided anchor account");
Expand All @@ -190,15 +190,15 @@ impl ProgramTestExtension for ProgramTest {
self.add_account_with_data(pubkey, owner, &v, executable);
}

//Note that the total size is 8 (disciminator) + size
//Note that the total size is 8 (discriminator) + size
#[cfg(feature = "anchor")]
fn add_empty_account_with_anchor<T: AnchorSerialize + Discriminator>(
&mut self,
pubkey: Pubkey,
owner: Pubkey,
size: usize,
) {
let discriminator = &T::discriminator();
let discriminator = &T::DISCRIMINATOR;
let data = vec![0_u8; size];
let mut v = Vec::new();
v.extend_from_slice(discriminator);
Expand Down

0 comments on commit 0a57915

Please sign in to comment.