Skip to content

Commit

Permalink
Merge pull request ethereum-optimism#4731 from ethereum-optimism/feat…
Browse files Browse the repository at this point in the history
…/lwd-cdm

op-chain-ops: add getter for cdm
  • Loading branch information
mergify[bot] authored Jan 20, 2023
2 parents 2c26ac3 + 22ce313 commit 73f0cdd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions op-chain-ops/crossdomain/legacy_withdrawal.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,17 @@ func (w *LegacyWithdrawal) Value() (*big.Int, error) {

return value, nil
}

// CrossDomainMessage turns the LegacyWithdrawal into
// a CrossDomainMessage. LegacyWithdrawals do not have
// the concept of value or gaslimit, so set them to 0.
func (w *LegacyWithdrawal) CrossDomainMessage() *CrossDomainMessage {
return &CrossDomainMessage{
Nonce: w.Nonce,
Sender: w.Sender,
Target: w.Target,
Value: new(big.Int),
GasLimit: new(big.Int),
Data: []byte(w.Data),
}
}

0 comments on commit 73f0cdd

Please sign in to comment.