Skip to content

Commit

Permalink
Add basic type tests
Browse files Browse the repository at this point in the history
  • Loading branch information
h5law committed Jul 23, 2023
1 parent 3566d56 commit afbcdb6
Show file tree
Hide file tree
Showing 5 changed files with 608 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ibc/client/types/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (cs *ClientState) Validate() error {
if lenWasmChecksum == 0 {
return errors.New("wasm checksum cannot be empty")
}
if lenWasmChecksum > 32 { // sha256 output is 256 bits long
if lenWasmChecksum != 32 { // sha256 output is 256 bits long
return fmt.Errorf("expected 32, got %d", lenWasmChecksum)
}

Expand Down
3 changes: 3 additions & 0 deletions ibc/client/types/height.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func (h *Height) Increment() modules.Height {
}

func (h *Height) Decrement() modules.Height {
if h.RevisionHeight == 0 {
return h
}
return &Height{
RevisionNumber: h.RevisionNumber,
RevisionHeight: h.RevisionHeight - 1,
Expand Down
Loading

0 comments on commit afbcdb6

Please sign in to comment.