Revert "Count compute units even when transaction errors (#22059)" (#22174)

This reverts commit eaa8c67bde.
This commit is contained in:
carllin
2021-12-30 02:42:32 -05:00
committed by GitHub
parent 135af08b8b
commit 33d0b5e011
13 changed files with 97 additions and 295 deletions

View File

@@ -1,12 +1,12 @@
use {
crate::{bank::Bank, cost_model::ExecutionCost},
crate::bank::Bank,
solana_sdk::transaction::{Result, SanitizedTransaction},
std::borrow::Cow,
};
// Represents the results of trying to lock a set of accounts
pub struct TransactionBatch<'a, 'b> {
lock_results: Vec<Result<ExecutionCost>>,
lock_results: Vec<Result<()>>,
bank: &'a Bank,
sanitized_txs: Cow<'b, [SanitizedTransaction]>,
pub(crate) needs_unlock: bool,
@@ -14,7 +14,7 @@ pub struct TransactionBatch<'a, 'b> {
impl<'a, 'b> TransactionBatch<'a, 'b> {
pub fn new(
lock_results: Vec<Result<ExecutionCost>>,
lock_results: Vec<Result<()>>,
bank: &'a Bank,
sanitized_txs: Cow<'b, [SanitizedTransaction]>,
) -> Self {
@@ -27,7 +27,7 @@ impl<'a, 'b> TransactionBatch<'a, 'b> {
}
}
pub fn lock_results(&self) -> &Vec<Result<ExecutionCost>> {
pub fn lock_results(&self) -> &Vec<Result<()>> {
&self.lock_results
}