Skip to content

Commit

Permalink
Fix Unregistered interface types.Evidence (#8221)
Browse files Browse the repository at this point in the history
* fix Unregistered interface

* add test

Co-authored-by: Anil Kumar Kammari <[email protected]>
  • Loading branch information
2 people authored and zmanian committed Dec 29, 2020
1 parent 7c1da3d commit 9ec864f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/rpc/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec/legacy"
"github.com/cosmos/cosmos-sdk/types/rest"
)

Expand Down Expand Up @@ -69,7 +70,7 @@ func getBlock(clientCtx client.Context, height *int64) ([]byte, error) {
return nil, err
}

return clientCtx.LegacyAmino.MarshalJSON(res)
return legacy.Cdc.MarshalJSON(res)
}

// get the current blockchain height
Expand Down
14 changes: 14 additions & 0 deletions client/rpc/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ import (
"testing"

"github.com/stretchr/testify/suite"
ctypes "github.com/tendermint/tendermint/rpc/core/types"

"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/codec/legacy"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
"github.com/cosmos/cosmos-sdk/testutil/network"
"github.com/cosmos/cosmos-sdk/types/rest"
)

type IntegrationTestSuite struct {
Expand Down Expand Up @@ -42,6 +45,17 @@ func (s *IntegrationTestSuite) TestStatusCommand() {
s.Require().Contains(out.String(), fmt.Sprintf("\"moniker\":\"%s\"", val0.Moniker))
}

func (s *IntegrationTestSuite) TestLatestBlocks() {
val0 := s.network.Validators[0]

res, err := rest.GetRequest(fmt.Sprintf("%s/blocks/latest", val0.APIAddress))
s.Require().NoError(err)

var result ctypes.ResultBlock
err = legacy.Cdc.UnmarshalJSON(res, &result)
s.Require().NoError(err)
}

func TestIntegrationTestSuite(t *testing.T) {
suite.Run(t, new(IntegrationTestSuite))
}

0 comments on commit 9ec864f

Please sign in to comment.