Skip to content

Commit

Permalink
Merge pull request #474 from CosmWasm/zero-timestamp-test
Browse files Browse the repository at this point in the history
Add zero timestamp to TestIbcTimeoutDeserialization
  • Loading branch information
webmaster128 authored Nov 21, 2023
2 parents bf6268b + 7bfb78f commit e596b1c
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 e596b1c

Please sign in to comment.