From a71facc3bfbb4a660df04789ae33c3f42fd5d351 Mon Sep 17 00:00:00 2001 From: danijelTxFusion Date: Tue, 5 Nov 2024 00:13:31 +0100 Subject: [PATCH] feat(clients): rename `WithdrawalCallMsg` methods BREAKING CHANGE: Rename `WithdrawalCallMsg.ToCallMsg` to `WithdrawalCallMsg.ToL1CallMsg` and `WithdrawalCallMsg.ToZkCallMsg` to `WithdrawalCallMsg.ToCallMsg`. --- clients/client.go | 4 ++-- clients/types.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/clients/client.go b/clients/client.go index 96cd4a3..4a0793f 100644 --- a/clients/client.go +++ b/clients/client.go @@ -1065,9 +1065,9 @@ func (c *Client) EstimateGasWithdraw(ctx context.Context, msg WithdrawalCallMsg) if errBridge != nil { return 0, fmt.Errorf("failed to getBridgeContracts: %w", errBridge) } - callMsg, err = msg.ToZkCallMsg(&contracts.L2SharedBridge) + callMsg, err = msg.ToCallMsg(&contracts.L2SharedBridge) } else { - callMsg, err = msg.ToZkCallMsg(nil) + callMsg, err = msg.ToCallMsg(nil) if err != nil { return 0, err } diff --git a/clients/types.go b/clients/types.go index a530e14..945a8fb 100644 --- a/clients/types.go +++ b/clients/types.go @@ -138,7 +138,7 @@ type WithdrawalCallMsg struct { CustomSignature hexutil.Bytes } -func (m *WithdrawalCallMsg) ToCallMsg(defaultL2Bridge *common.Address) (*ethereum.CallMsg, error) { +func (m *WithdrawalCallMsg) ToL1CallMsg(defaultL2Bridge *common.Address) (*ethereum.CallMsg, error) { if m.Token == utils.L2BaseTokenAddress { ethTokenAbi, err := ethtoken.IEthTokenMetaData.GetAbi() if err != nil { @@ -186,8 +186,8 @@ func (m *WithdrawalCallMsg) ToCallMsg(defaultL2Bridge *common.Address) (*ethereu } } -func (m *WithdrawalCallMsg) ToZkCallMsg(defaultL2Bridge *common.Address) (*types.CallMsg, error) { - msg, err := m.ToCallMsg(defaultL2Bridge) +func (m *WithdrawalCallMsg) ToCallMsg(defaultL2Bridge *common.Address) (*types.CallMsg, error) { + msg, err := m.ToL1CallMsg(defaultL2Bridge) if err != nil { return nil, err }