Sanitize transactions during RPC preflight test
This commit is contained in:
committed by
mergify[bot]
parent
3f73affb2e
commit
29b3265dc7
@ -47,6 +47,7 @@ use solana_sdk::{
|
|||||||
native_loader, nonce,
|
native_loader, nonce,
|
||||||
program_utils::limited_deserialize,
|
program_utils::limited_deserialize,
|
||||||
pubkey::Pubkey,
|
pubkey::Pubkey,
|
||||||
|
sanitize::Sanitize,
|
||||||
signature::{Keypair, Signature},
|
signature::{Keypair, Signature},
|
||||||
slot_hashes::SlotHashes,
|
slot_hashes::SlotHashes,
|
||||||
slot_history::SlotHistory,
|
slot_history::SlotHistory,
|
||||||
@ -1346,7 +1347,11 @@ impl Bank {
|
|||||||
&'a self,
|
&'a self,
|
||||||
txs: &'b [Transaction],
|
txs: &'b [Transaction],
|
||||||
) -> TransactionBatch<'a, 'b> {
|
) -> TransactionBatch<'a, 'b> {
|
||||||
let mut batch = TransactionBatch::new(vec![Ok(()); txs.len()], &self, txs, None);
|
let lock_results: Vec<_> = txs
|
||||||
|
.iter()
|
||||||
|
.map(|tx| tx.sanitize().map_err(|e| e.into()))
|
||||||
|
.collect();
|
||||||
|
let mut batch = TransactionBatch::new(lock_results, &self, txs, None);
|
||||||
batch.needs_unlock = false;
|
batch.needs_unlock = false;
|
||||||
batch
|
batch
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user