Skip to content

Commit

Permalink
docs: update ConfirmTxs usage
Browse files Browse the repository at this point in the history
  • Loading branch information
najeal committed Nov 22, 2024
1 parent 236c0e6 commit 33a5773
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/tutorials/morpheusvm/4_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,19 @@ This step will consist of the following:
- If the test takes longer than 2 seconds, it will fail
- Calling `ConfirmTxs` with our TX being passed in

The function `ConfirmTXs` is useful as it checks that our TX was
sent and that, if finalized, our transaction has the expected outputs. We have
The function `ConfirmTxs` is useful as it checks that our TX was
sent and that, if finalized, it returns the txs results. We have
the following:

```go
timeoutCtx, timeoutCtxFnc := context.WithDeadline(context.Background(), time.Now().Add(30*time.Second))
defer timeoutCtxFnc()

require.NoError(tn.ConfirmTxs(timeoutCtx, []*chain.Transaction{tx}))
results, err := tn.ConfirmTxs(timeoutCtx, []*chain.Transaction{tx})
require.NoError(err)
for _, result := range results {
require.True(result.Success)
}
```

## Registering our Tests
Expand Down

0 comments on commit 33a5773

Please sign in to comment.