Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion withdraw/fpwithdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ func (w *FPWithdrawer) ProveWithdrawal() error {
}

func (w *FPWithdrawer) IsProofFinalized() (bool, error) {
return w.Portal.FinalizedWithdrawals(&bind.CallOpts{}, w.L2TxHash)
hash, err := w.getWithdrawalHash()
if err != nil {
return false, err
}

return w.Portal.FinalizedWithdrawals(&bind.CallOpts{}, hash)
}

func (w *FPWithdrawer) FinalizeWithdrawal() error {
Expand Down
18 changes: 17 additions & 1 deletion withdraw/withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,23 @@ func (w *Withdrawer) ProveWithdrawal() error {
}

func (w *Withdrawer) IsProofFinalized() (bool, error) {
return w.Portal.FinalizedWithdrawals(&bind.CallOpts{}, w.L2TxHash)
l2 := ethclient.NewClient(w.L2Client)
receipt, err := l2.TransactionReceipt(w.Ctx, w.L2TxHash)
if err != nil {
return false, err
}

ev, err := withdrawals.ParseMessagePassed(receipt)
if err != nil {
return false, err
}

hash, err := withdrawals.WithdrawalHash(ev)
if err != nil {
return false, err
}

return w.Portal.FinalizedWithdrawals(&bind.CallOpts{}, hash)
}

func (w *Withdrawer) FinalizeWithdrawal() error {
Expand Down