Skip to content

Commit

Permalink
check success ack result in happy path unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
spoo-bar committed Oct 24, 2024
1 parent cc1cfbe commit 74f5cec
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ func TestMiddleware_DepositForBurn_Success(t *testing.T) {
res := middleware.OnRecvPacket(ctx, testPacket, nil)

require.True(t, res.Success())
var ack channeltypes.Acknowledgement
err := channeltypes.SubModuleCdc.UnmarshalJSON(res.Acknowledgement(), &ack)
require.NoError(t, err)
require.Equal(t, "{\"nonce\":10}", string(ack.GetResult()))
}

func TestMiddleware_DepositForBurnWithCaller_Success(t *testing.T) {
Expand Down Expand Up @@ -395,4 +399,8 @@ func TestMiddleware_DepositForBurnWithCaller_Success(t *testing.T) {
res := middleware.OnRecvPacket(ctx, testPacket, nil)

require.True(t, res.Success())
var ack channeltypes.Acknowledgement
err := channeltypes.SubModuleCdc.UnmarshalJSON(res.Acknowledgement(), &ack)
require.NoError(t, err)
require.Equal(t, "{\"nonce\":10}", string(ack.GetResult()))
}

0 comments on commit 74f5cec

Please sign in to comment.