Skip to content

Commit

Permalink
fix most of lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mossid committed Jul 7, 2019
1 parent 4d8fa26 commit 3616fca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions x/ibc/04-channel/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (man Handshaker) OpenTry(ctx sdk.Context,
return
}

if !obj.counterparty.nextTimeout.Is(ctx, uint64(timeoutHeight)) {
if !obj.counterparty.nextTimeout.Is(ctx, timeoutHeight) {
err = errors.New("unexpected counterparty timeout value")
return
}
Expand Down Expand Up @@ -248,7 +248,7 @@ func (man Handshaker) OpenAck(ctx sdk.Context,
return
}

if !obj.counterparty.nextTimeout.Is(ctx, uint64(timeoutHeight)) {
if !obj.counterparty.nextTimeout.Is(ctx, timeoutHeight) {
err = errors.New("unexpected counterparty timeout value")
return
}
Expand All @@ -262,7 +262,7 @@ func (man Handshaker) OpenAck(ctx sdk.Context,
}
*/

obj.nextTimeout.Set(ctx, uint64(nextTimeoutHeight))
obj.nextTimeout.Set(ctx, nextTimeoutHeight)
obj.available.Set(ctx, true)

return
Expand Down Expand Up @@ -304,7 +304,7 @@ func (man Handshaker) OpenConfirm(ctx sdk.Context, connid, chanid string, timeou
// TODO
/*
func (obj HandshakeObject) OpenTimeout(ctx sdk.Context) error {
if !(uint64(obj.connection.Client().ConsensusState(ctx).GetHeight()) > obj.nextTimeout.Get(ctx)) {
if !(obj.connection.Client().ConsensusState(ctx).GetHeight()) > obj.nextTimeout.Get(ctx)) {
return errors.New("timeout height not yet reached")
}
Expand Down Expand Up @@ -388,7 +388,7 @@ func (obj HandshakeObject) CloseAck(ctx sdk.Context, timeoutHeight uint64) error
}
func (obj HandshakeObject) CloseTimeout(ctx sdk.Context) error {
if !(uint64(obj.client.ConsensusState(ctx).GetHeight()) > obj.nextTimeout.Get(ctx)) {
if !(obj.client.ConsensusState(ctx).GetHeight()) > obj.nextTimeout.Get(ctx)) {
return errors.New("timeout height not yet reached")
}
Expand Down
5 changes: 2 additions & 3 deletions x/ibc/04-channel/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ type Object struct {
chanid string
connid string

protocol state.Mapping
channel state.Value
channel state.Value

seqsend state.Integer
seqrecv state.Integer
Expand Down Expand Up @@ -249,7 +248,7 @@ func (obj Object) Send(ctx sdk.Context, packet Packet) error {
return errors.New("cannot send packets on this channel")
}

if uint64(obj.connection.Client().ConsensusState(ctx).GetHeight()) >= packet.Timeout() {
if obj.connection.Client().ConsensusState(ctx).GetHeight() >= packet.Timeout() {
return errors.New("timeout height higher than the latest known")
}

Expand Down

0 comments on commit 3616fca

Please sign in to comment.