Skip to content

Commit

Permalink
address review from pr #6374
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaSripal committed Jun 12, 2020
1 parent 60f7edf commit 912c4ad
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x/ibc/07-tendermint/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func GetCmdCreateClient(cdc *codec.Codec) *cobra.Command {
case "simple":
specs = []*ics23.ProofSpec{ics23.TendermintSpec}
default:
return fmt.Errorf("proof Spec: %s not supported", spc)
return fmt.Errorf("proof spec: %s isn't supported", spc)
}

msg := ibctmtypes.NewMsgCreateClient(
Expand Down
16 changes: 16 additions & 0 deletions x/ibc/07-tendermint/types/client_state_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package types_test

import (
ics23 "github.com/confio/ics23/go"
tmmath "github.com/tendermint/tendermint/libs/math"
lite "github.com/tendermint/tendermint/lite2"

Expand Down Expand Up @@ -60,6 +61,21 @@ func (suite *TendermintTestSuite) TestValidate() {
clientState: ibctmtypes.NewClientState(testClientID, lite.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, ibctmtypes.Header{}, commitmenttypes.GetSDKSpecs()),
expPass: false,
},
{
name: "trusting period not less than unbonding period",
clientState: ibctmtypes.NewClientState(testClientID, lite.DefaultTrustLevel, ubdPeriod, ubdPeriod, maxClockDrift, suite.header, commitmenttypes.GetSDKSpecs()),
expPass: false,
},
{
name: "proof specs is nil",
clientState: ibctmtypes.NewClientState(testClientID, lite.DefaultTrustLevel, ubdPeriod, ubdPeriod, maxClockDrift, suite.header, nil),
expPass: false,
},
{
name: "proof specs contains nil",
clientState: ibctmtypes.NewClientState(testClientID, lite.DefaultTrustLevel, ubdPeriod, ubdPeriod, maxClockDrift, suite.header, []*ics23.ProofSpec{ics23.TendermintSpec, nil}),
expPass: false,
},
}

for _, tc := range testCases {
Expand Down
2 changes: 2 additions & 0 deletions x/ibc/07-tendermint/types/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ func (suite *TendermintTestSuite) TestMsgCreateClientValidateBasic() {
{ibctmtypes.NewMsgCreateClient(exported.ClientTypeTendermint, ibctmtypes.Header{}, lite.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, commitmenttypes.GetSDKSpecs(), signer), false, "nil header"},
{ibctmtypes.NewMsgCreateClient(exported.ClientTypeTendermint, invalidHeader, lite.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, commitmenttypes.GetSDKSpecs(), signer), false, "invalid header"},
{ibctmtypes.NewMsgCreateClient(exported.ClientTypeTendermint, suite.header, lite.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, []*ics23.ProofSpec{nil}, signer), false, "invalid proof specs"},
{ibctmtypes.NewMsgCreateClient(exported.ClientTypeTendermint, suite.header, lite.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, nil, signer), false, "nil proof specs"},
{ibctmtypes.NewMsgCreateClient(exported.ClientTypeTendermint, suite.header, lite.DefaultTrustLevel, ubdPeriod, ubdPeriod, maxClockDrift, commitmenttypes.GetSDKSpecs(), signer), false, "trusting period not less than unbonding period"},
}

for i, tc := range cases {
Expand Down

0 comments on commit 912c4ad

Please sign in to comment.