Skip to content

Commit

Permalink
Add zero timestamp to TestIbcTimeoutDeserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Nov 20, 2023
1 parent 2041b18 commit 1fef48f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions types/ibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,15 @@ func TestIbcTimeoutDeserialization(t *testing.T) {
},
Timestamp: 0,
}, timeout3)

// Zero timestamp
// This is not very useful but something a contract developer can do in the current type
// system by setting timestamp to IbcTimeout::with_timestamp(Timestamp::from_nanos(0))
var timeout4 IBCTimeout
err = json.Unmarshal([]byte(`{"block":null,"timestamp":"0"}`), &timeout4)
require.NoError(t, err)
assert.Equal(t, IBCTimeout{
Block: nil,
Timestamp: 0,
}, timeout4)
}

0 comments on commit 1fef48f

Please sign in to comment.