Skip to content

Commit

Permalink
Tame SignedTx debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouzo committed Sep 6, 2023
1 parent 227b80c commit 7dcf254
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib/ain-evm/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,31 @@ impl From<&LegacyTransaction> for LegacyUnsignedTransaction {
}
}

#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, PartialEq, Eq)]
pub struct SignedTx {
pub transaction: TransactionV2,
pub sender: H160,
pub pubkey: PublicKey,
}

impl fmt::Debug for SignedTx {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("SignedTx")
.field("hash", &self.hash())
.field("nonce", &self.nonce())
.field("to", &self.to())
.field("action", &self.action())
.field("value", &self.value())
.field("gas_limit", &self.gas_limit())
.field("max_fee_per_gas", &self.max_fee_per_gas())
.field("max_priority_fee_per_gas", &self.max_priority_fee_per_gas())
.field("access_list", &self.access_list())
.field("input", &hex::encode(self.data()))
.field("sender", &self.sender)
.finish()
}
}

impl TryFrom<TransactionV2> for SignedTx {
type Error = TransactionError;

Expand Down

0 comments on commit 7dcf254

Please sign in to comment.