Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeTransaction::is_simple_vote_transaction #3099

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions runtime-transaction/src/runtime_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ impl<T> StaticMeta for RuntimeTransaction<T> {
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
Expand Down Expand Up @@ -107,7 +107,7 @@ impl RuntimeTransaction<SanitizedVersionedTransaction> {
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,
},
Expand All @@ -122,7 +122,7 @@ impl RuntimeTransaction<SanitizedTransaction> {
reserved_account_keys: &HashSet<Pubkey>,
) -> Result<Self> {
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,
Expand Down Expand Up @@ -305,7 +305,7 @@ mod tests {
RuntimeTransaction::<SanitizedVersionedTransaction>::try_from(svt, None, is_simple_vote)
.unwrap()
.meta
.is_simple_vote_tx
.is_simple_vote_transaction
}

assert!(!get_is_simple_vote(
Expand Down Expand Up @@ -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::<SanitizedTransaction>::try_from(
statically_loaded_transaction,
Expand All @@ -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]
Expand All @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions runtime-transaction/src/transaction_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ComputeBudgetLimits>;
}
Expand All @@ -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,
}
Loading