Skip to content

Commit

Permalink
Add custom timeout in transaction result sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranbt committed Jan 11, 2024
1 parent 3c93c40 commit b494114
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion suave/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,15 @@ type TransactionResult struct {
}

func (t *TransactionResult) Wait() (*types.Receipt, error) {
return t.WaitWithTimeout(10 * time.Second)
}

func (t *TransactionResult) WaitWithTimeout(timeout time.Duration) (*types.Receipt, error) {
if t.receipt != nil {
return t.receipt, nil
}

timer := time.NewTimer(10 * time.Second)
timer := time.NewTimer(timeout)

var receipt *types.Receipt
var err error
Expand Down

0 comments on commit b494114

Please sign in to comment.