Skip to content

Commit

Permalink
remove SignableTransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
hal3e committed Jan 11, 2024
1 parent 7949ffd commit faa7e3a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/fuels-core/src/types/wrappers/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,8 @@ pub trait GasValidation {

#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
pub trait SignableTransaction {
async fn sign_with(&mut self, signer: &impl Signer, chain_id: ChainId) -> Result<Signature>;
}

pub trait Transaction:
Into<FuelTransaction> + EstimablePredicates + GasValidation + SignableTransaction + Clone + Debug
Into<FuelTransaction> + EstimablePredicates + GasValidation + Clone + Debug
{
fn fee_checked_from_tx(
&self,
Expand Down Expand Up @@ -222,6 +218,8 @@ pub trait Transaction:
fn append_witness(&mut self, witness: Witness) -> Result<usize>;

fn used_coins(&self) -> HashMap<(Bech32Address, AssetId), Vec<CoinTypeId>>;

async fn sign_with(&mut self, signer: &impl Signer, chain_id: ChainId) -> Result<Signature>;
}

impl From<TransactionType> for FuelTransaction {
Expand Down Expand Up @@ -296,6 +294,8 @@ macro_rules! impl_tx_wrapper {
}
}

#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
impl Transaction for $wrapper {
fn max_gas(&self, consensus_parameters: &ConsensusParameters) -> u64 {
self.tx.max_gas(
Expand Down Expand Up @@ -407,11 +407,7 @@ macro_rules! impl_tx_wrapper {
})
.into_group_map()
}
}

#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
impl SignableTransaction for $wrapper {
async fn sign_with(
&mut self,
signer: &impl Signer,
Expand Down

0 comments on commit faa7e3a

Please sign in to comment.