From 7dcf2547cc756e54c0e0aed09fca81feeb22c72f Mon Sep 17 00:00:00 2001 From: jouzo Date: Wed, 6 Sep 2023 19:08:35 +0100 Subject: [PATCH] Tame SignedTx debug output --- lib/ain-evm/src/transaction/mod.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/ain-evm/src/transaction/mod.rs b/lib/ain-evm/src/transaction/mod.rs index c24a57fa28..a0b8ea8e78 100644 --- a/lib/ain-evm/src/transaction/mod.rs +++ b/lib/ain-evm/src/transaction/mod.rs @@ -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 for SignedTx { type Error = TransactionError;