1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use super::{Checked, IntoChecked};
use crate::checked_transaction::CheckPredicates;
use crate::prelude::*;
use fuel_tx::ConsensusParameters;
use fuel_types::BlockHeight;
pub trait TransactionBuilderExt<Tx>
where
Tx: IntoChecked,
{
fn finalize_checked(
&mut self,
height: BlockHeight,
params: &ConsensusParameters,
gas_costs: &GasCosts,
) -> Checked<Tx>;
fn finalize_checked_basic(&mut self, height: BlockHeight, params: &ConsensusParameters) -> Checked<Tx>;
}
impl<Tx: ExecutableTransaction> TransactionBuilderExt<Tx> for TransactionBuilder<Tx>
where
Self: Finalizable<Tx>,
Checked<Tx>: CheckPredicates,
{
fn finalize_checked(
&mut self,
height: BlockHeight,
params: &ConsensusParameters,
gas_costs: &GasCosts,
) -> Checked<Tx> {
self.finalize()
.into_checked(height, params, gas_costs)
.expect("failed to check tx")
}
fn finalize_checked_basic(&mut self, height: BlockHeight, params: &ConsensusParameters) -> Checked<Tx> {
self.finalize()
.into_checked_basic(height, params)
.expect("failed to check tx")
}
}