Skip to content

Commit

Permalink
feat(clients): rename WithdrawalCallMsg methods
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Rename `WithdrawalCallMsg.ToCallMsg` to
`WithdrawalCallMsg.ToL1CallMsg` and `WithdrawalCallMsg.ToZkCallMsg`
to `WithdrawalCallMsg.ToCallMsg`.
  • Loading branch information
danijelTxFusion committed Nov 4, 2024
1 parent 487b902 commit bd63b3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions clients/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit bd63b3d

Please sign in to comment.