Commit 16204388 authored by Mark Tyneway's avatar Mark Tyneway

op-chain-ops: add getter for cdm

Adds a getter to the `LegacyWithdrawal` that converts
it into a `CrossDomainMessage`. This simplifies some
code when doing migrated legacy withdrawals.
parent e65a7bb0
...@@ -170,3 +170,16 @@ func (w *LegacyWithdrawal) Value() (*big.Int, error) { ...@@ -170,3 +170,16 @@ func (w *LegacyWithdrawal) Value() (*big.Int, error) {
return value, nil return value, nil
} }
// CrossDomainMessage turns the LegacyWithdrawal into
// a CrossDomainMessage
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),
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment