Skip to content

Commit

Permalink
added String method to TxOrCall
Browse files Browse the repository at this point in the history
  • Loading branch information
EWCunha committed Feb 21, 2025
1 parent 76875c5 commit 4bc8b08
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package multicall

import (
"fmt"
"math/big"

"github.com/ethereum/go-ethereum"
Expand Down Expand Up @@ -32,7 +33,29 @@ type TxOrCall struct {
AccessList types.AccessList
}

type TxOrCallInterface interface {
func (t *TxOrCall) String() string {
return fmt.Sprintf(`TxOrCall{
From: %s,
To: %s,
Gas: %d,
GasPrice: %s,
Value: %s,
Data: %s,
Nonce: %d,
BlockNumber: %s,
AccessList: %v,
}
`,
t.From.Hex(),
t.To.Hex(),
t.Gas,
t.GasPrice.String(),
t.Value.String(),
common.Bytes2Hex(t.Data),
t.Nonce,
t.BlockNumber.String(),
t.AccessList,
)
}

func FromTxToTxOrCall(tx *types.Transaction, from common.Address, blockNumber *big.Int) TxOrCall {
Expand Down

0 comments on commit 4bc8b08

Please sign in to comment.