Skip to content

Commit 1e03926

Browse files
Fix add_empty_account_with_anchor for future Anchor versions (coral-xyz/anchor#3163)
1 parent 2c4ff8f commit 1e03926

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/extensions/program_test.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl ProgramTestExtension for ProgramTest {
180180
anchor_data: T,
181181
executable: bool,
182182
) {
183-
let discriminator = &T::discriminator();
183+
let discriminator = &T::DISCRIMINATOR;
184184
let data = anchor_data
185185
.try_to_vec()
186186
.expect("Cannot serialize provided anchor account");
@@ -190,15 +190,15 @@ impl ProgramTestExtension for ProgramTest {
190190
self.add_account_with_data(pubkey, owner, &v, executable);
191191
}
192192

193-
//Note that the total size is 8 (disciminator) + size
193+
//Note that the total size is 8 (discriminator) + size
194194
#[cfg(feature = "anchor")]
195195
fn add_empty_account_with_anchor<T: AnchorSerialize + Discriminator>(
196196
&mut self,
197197
pubkey: Pubkey,
198198
owner: Pubkey,
199199
size: usize,
200200
) {
201-
let discriminator = &T::discriminator();
201+
let discriminator = &T::DISCRIMINATOR;
202202
let data = vec![0_u8; size];
203203
let mut v = Vec::new();
204204
v.extend_from_slice(discriminator);

0 commit comments

Comments
 (0)