From 0a57915daa0f06cc57e56c51c5434a186c8bb2f3 Mon Sep 17 00:00:00 2001 From: Andrei Silviu Dragnea Date: Wed, 14 Aug 2024 16:59:04 +0100 Subject: [PATCH] Fix add_empty_account_with_anchor for future Anchor versions (https://github.com/coral-xyz/anchor/pull/3163) --- src/extensions/program_test.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extensions/program_test.rs b/src/extensions/program_test.rs index deb1f49..f81779d 100644 --- a/src/extensions/program_test.rs +++ b/src/extensions/program_test.rs @@ -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"); @@ -190,7 +190,7 @@ 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( &mut self, @@ -198,7 +198,7 @@ impl ProgramTestExtension for ProgramTest { 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);