Commit 6b9901b9 authored by Mark Tyneway's avatar Mark Tyneway

op-chain-ops: ensure proper usage with panic

parent 101a7164
......@@ -51,6 +51,10 @@ func (w *LegacyWithdrawal) Encode() ([]byte, error) {
return nil, fmt.Errorf("cannot encode LegacyWithdrawal: %w", err)
}
if w.MessageSender != predeploys.L2CrossDomainMessengerAddr {
panic(fmt.Sprintf("cannot encode with invalid message sender: %s", w.MessageSender.Hex()))
}
out := make([]byte, len(enc)+len(predeploys.L2CrossDomainMessengerAddr.Bytes()))
copy(out, enc)
copy(out[len(enc):], predeploys.L2CrossDomainMessengerAddr.Bytes())
......
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