Refactor: Sanitized transaction creation (#23558)
* Refactor: SanitizedTransaction::try_create optionally computes hash * Refactor: Add SimpleAddressLoader
This commit is contained in:
@ -60,7 +60,7 @@ use {
|
||||
shred_version::compute_shred_version,
|
||||
stake::{self, state::StakeState},
|
||||
system_program,
|
||||
transaction::{DisabledAddressLoader, SanitizedTransaction},
|
||||
transaction::{MessageHash, SanitizedTransaction, SimpleAddressLoader},
|
||||
},
|
||||
solana_stake_program::stake_state::{self, PointValue},
|
||||
solana_vote_program::{
|
||||
@ -242,9 +242,9 @@ fn output_slot(
|
||||
let tx_signature = transaction.signatures[0];
|
||||
let sanitize_result = SanitizedTransaction::try_create(
|
||||
transaction,
|
||||
Hash::default(),
|
||||
MessageHash::Compute,
|
||||
None,
|
||||
&DisabledAddressLoader,
|
||||
SimpleAddressLoader::Disabled,
|
||||
);
|
||||
|
||||
match sanitize_result {
|
||||
@ -794,9 +794,9 @@ fn compute_slot_cost(blockstore: &Blockstore, slot: Slot) -> Result<(), String>
|
||||
.filter_map(|transaction| {
|
||||
SanitizedTransaction::try_create(
|
||||
transaction,
|
||||
Hash::default(),
|
||||
MessageHash::Compute,
|
||||
None,
|
||||
&DisabledAddressLoader,
|
||||
SimpleAddressLoader::Disabled,
|
||||
)
|
||||
.map_err(|err| {
|
||||
warn!("Failed to compute cost of transaction: {:?}", err);
|
||||
|
Reference in New Issue
Block a user