Skip to content

Commit

Permalink
fix: check if autodeposit is already running
Browse files Browse the repository at this point in the history
  • Loading branch information
Alok committed Jul 8, 2024
1 parent 49555a9 commit 0a33aea
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions p2p/integrationtest/real-bidder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,23 @@ func main() {
return
}

resp, err := bidderClient.AutoDeposit(context.Background(), &pb.DepositRequest{
Amount: minDeposit.String(),
})
status, err := bidderClient.AutoDepositStatus(context.Background(), &pb.EmptyMessage{})
if err != nil {
logger.Error("failed to auto deposit", "err", err)
logger.Error("failed to get auto deposit status", "err", err)
return
}
logger.Info("auto deposit", "amount", resp.AmountPerWindow, "window", resp.StartBlockNumber)

if !status.IsWorking {
resp, err := bidderClient.AutoDeposit(context.Background(), &pb.DepositRequest{
Amount: minDeposit.String(),
})
if err != nil {
logger.Error("failed to auto deposit", "err", err)
return
}
logger.Info("auto deposit", "amount", resp.AmountPerWindow, "window", resp.StartBlockNumber)
}

type blockWithTxns struct {
blockNum int64
txns []string
Expand Down

0 comments on commit 0a33aea

Please sign in to comment.