* Add more-legitimate conversion from legacy Transaction to SanitizedTransaction
* Add Banks method with preflight checks
* Expose BanksClient method with preflight checks
* Unwrap simulation err
* Add Bank simulation method that works on unfrozen Banks
* Add simpler api
* Better name: BanksTransactionResultWithSimulation
(cherry picked from commit 422a095647
)
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
@ -3119,6 +3119,15 @@ impl Bank {
|
||||
) -> TransactionSimulationResult {
|
||||
assert!(self.is_frozen(), "simulation bank must be frozen");
|
||||
|
||||
self.simulate_transaction_unchecked(transaction)
|
||||
}
|
||||
|
||||
/// Run transactions against a bank without committing the results; does not check if the bank
|
||||
/// is frozen, enabling use in single-Bank test frameworks
|
||||
pub fn simulate_transaction_unchecked(
|
||||
&self,
|
||||
transaction: SanitizedTransaction,
|
||||
) -> TransactionSimulationResult {
|
||||
let number_of_accounts = transaction.message().account_keys_len();
|
||||
let batch = self.prepare_simulation_batch(transaction);
|
||||
let mut timings = ExecuteTimings::default();
|
||||
|
Reference in New Issue
Block a user