Skip to content

Commit

Permalink
remove extraneous tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry committed Feb 29, 2024
1 parent 4ea93f0 commit 36f958c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 55 deletions.
28 changes: 1 addition & 27 deletions sdk/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ mod tests {
hash::hash,
instruction::AccountMeta,
signature::{Keypair, Presigner, Signer},
system_instruction, sysvar,
system_instruction,
},
bincode::{deserialize, serialize, serialized_size},
std::mem::size_of,
Expand Down Expand Up @@ -1579,32 +1579,6 @@ mod tests {
assert!(uses_durable_nonce(&tx).is_none());
}

#[test]
fn tx_uses_ro_nonce_account() {
let from_keypair = Keypair::new();
let from_pubkey = from_keypair.pubkey();
let nonce_keypair = Keypair::new();
let nonce_pubkey = nonce_keypair.pubkey();
let account_metas = vec![
AccountMeta::new_readonly(nonce_pubkey, false),
#[allow(deprecated)]
AccountMeta::new_readonly(sysvar::recent_blockhashes::id(), false),
AccountMeta::new_readonly(nonce_pubkey, true),
];
let nonce_instruction = Instruction::new_with_bincode(
system_program::id(),
&system_instruction::SystemInstruction::AdvanceNonceAccount,
account_metas,
);
let tx = Transaction::new_signed_with_payer(
&[nonce_instruction],
Some(&from_pubkey),
&[&from_keypair, &nonce_keypair],
Hash::default(),
);
assert!(uses_durable_nonce(&tx).is_none());
}

#[test]
fn tx_uses_nonce_wrong_first_nonce_ix_fail() {
let from_keypair = Keypair::new();
Expand Down
29 changes: 1 addition & 28 deletions sdk/src/transaction/versioned/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ mod tests {
crate::{
message::Message as LegacyMessage,
signer::{keypair::Keypair, Signer},
system_instruction, sysvar,
system_instruction,
},
solana_program::{
instruction::{AccountMeta, Instruction},
Expand Down Expand Up @@ -319,33 +319,6 @@ mod tests {
assert!(!tx.uses_durable_nonce());
}

#[test]
fn tx_uses_ro_nonce_account() {
let from_keypair = Keypair::new();
let from_pubkey = from_keypair.pubkey();
let nonce_keypair = Keypair::new();
let nonce_pubkey = nonce_keypair.pubkey();
let account_metas = vec![
AccountMeta::new_readonly(nonce_pubkey, false),
#[allow(deprecated)]
AccountMeta::new_readonly(sysvar::recent_blockhashes::id(), false),
AccountMeta::new_readonly(nonce_pubkey, true),
];
let nonce_instruction = Instruction::new_with_bincode(
system_program::id(),
&system_instruction::SystemInstruction::AdvanceNonceAccount,
account_metas,
);
let tx = Transaction::new_signed_with_payer(
&[nonce_instruction],
Some(&from_pubkey),
&[&from_keypair, &nonce_keypair],
Hash::default(),
);
let tx = VersionedTransaction::from(tx);
assert!(!tx.uses_durable_nonce());
}

#[test]
fn tx_uses_nonce_wrong_first_nonce_ix_fail() {
let from_keypair = Keypair::new();
Expand Down

0 comments on commit 36f958c

Please sign in to comment.