From ba999e1f9ae891f3ca75bab9aa86c49ef3c7d37f Mon Sep 17 00:00:00 2001 From: Andrew Fitzgerald Date: Mon, 7 Oct 2024 12:57:25 -0500 Subject: [PATCH] RuntimeTransaction::is_simple_vote_transaction --- runtime-transaction/src/runtime_transaction.rs | 16 ++++++++-------- runtime-transaction/src/transaction_meta.rs | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/runtime-transaction/src/runtime_transaction.rs b/runtime-transaction/src/runtime_transaction.rs index 14c13138025b31..1dbd44bed70bf6 100644 --- a/runtime-transaction/src/runtime_transaction.rs +++ b/runtime-transaction/src/runtime_transaction.rs @@ -45,8 +45,8 @@ impl StaticMeta for RuntimeTransaction { fn message_hash(&self) -> &Hash { &self.meta.message_hash } - fn is_simple_vote_tx(&self) -> bool { - self.meta.is_simple_vote_tx + fn is_simple_vote_transaction(&self) -> bool { + self.meta.is_simple_vote_transaction } fn signature_details(&self) -> &TransactionSignatureDetails { &self.meta.signature_details @@ -107,7 +107,7 @@ impl RuntimeTransaction { transaction: sanitized_versioned_tx, meta: TransactionMeta { message_hash, - is_simple_vote_tx, + is_simple_vote_transaction: is_simple_vote_tx, signature_details, compute_budget_instruction_details, }, @@ -122,7 +122,7 @@ impl RuntimeTransaction { reserved_account_keys: &HashSet, ) -> Result { let hash = *statically_loaded_runtime_tx.message_hash(); - let is_simple_vote_tx = statically_loaded_runtime_tx.is_simple_vote_tx(); + let is_simple_vote_tx = statically_loaded_runtime_tx.is_simple_vote_transaction(); let sanitized_transaction = SanitizedTransaction::try_new( statically_loaded_runtime_tx.transaction, hash, @@ -305,7 +305,7 @@ mod tests { RuntimeTransaction::::try_from(svt, None, is_simple_vote) .unwrap() .meta - .is_simple_vote_tx + .is_simple_vote_transaction } assert!(!get_is_simple_vote( @@ -342,7 +342,7 @@ mod tests { .unwrap(); assert_eq!(hash, *statically_loaded_transaction.message_hash()); - assert!(!statically_loaded_transaction.is_simple_vote_tx()); + assert!(!statically_loaded_transaction.is_simple_vote_transaction()); let dynamically_loaded_transaction = RuntimeTransaction::::try_from( statically_loaded_transaction, @@ -353,7 +353,7 @@ mod tests { dynamically_loaded_transaction.expect("created from statically loaded tx"); assert_eq!(hash, *dynamically_loaded_transaction.message_hash()); - assert!(!dynamically_loaded_transaction.is_simple_vote_tx()); + assert!(!dynamically_loaded_transaction.is_simple_vote_transaction()); } #[test] @@ -377,7 +377,7 @@ mod tests { .unwrap(); assert_eq!(&hash, runtime_transaction_static.message_hash()); - assert!(!runtime_transaction_static.is_simple_vote_tx()); + assert!(!runtime_transaction_static.is_simple_vote_transaction()); let signature_details = &runtime_transaction_static.meta.signature_details; assert_eq!(1, signature_details.num_transaction_signatures()); diff --git a/runtime-transaction/src/transaction_meta.rs b/runtime-transaction/src/transaction_meta.rs index 6ddce57e11dc5b..6e10d233636674 100644 --- a/runtime-transaction/src/transaction_meta.rs +++ b/runtime-transaction/src/transaction_meta.rs @@ -24,7 +24,7 @@ use { /// for example: message hash, simple-vote-tx flag, limits set by instructions pub trait StaticMeta { fn message_hash(&self) -> &Hash; - fn is_simple_vote_tx(&self) -> bool; + fn is_simple_vote_transaction(&self) -> bool; fn signature_details(&self) -> &TransactionSignatureDetails; fn compute_budget_limits(&self, feature_set: &FeatureSet) -> Result; } @@ -39,7 +39,7 @@ pub trait DynamicMeta: StaticMeta {} #[derive(Debug)] pub struct TransactionMeta { pub(crate) message_hash: Hash, - pub(crate) is_simple_vote_tx: bool, + pub(crate) is_simple_vote_transaction: bool, pub(crate) signature_details: TransactionSignatureDetails, pub(crate) compute_budget_instruction_details: ComputeBudgetInstructionDetails, }