Skip to content

Commit

Permalink
op-withdrawer: support txs with multiple deposits (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog authored Jan 7, 2025
1 parent 4830610 commit 5bcd633
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions op-withdrawer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,14 @@ func DepositHash(cliCtx *cli.Context) error {
if err != nil {
return err
}
if len(deposits) != 1 {
return fmt.Errorf("expected 1 deposit, got %d", len(deposits))
if len(deposits) == 0 {
return fmt.Errorf("no deposits found")
}

hash := types.NewTx(deposits[0]).Hash()
fmt.Println(hash.Hex())
// a single tx can contain multiple deposits; print them all
for _, deposit := range deposits {
fmt.Println(types.NewTx(deposit).Hash().Hex())
}

return nil
}

0 comments on commit 5bcd633

Please sign in to comment.