Skip to content

Commit

Permalink
cherry-pick 8a8aeef
Browse files Browse the repository at this point in the history
Problem: the latest SDK is not used (#583)

Solution: bumped the Cosmos SDK version, updated the changelog + removed
the broadcast mode hardcoding in CLI (as it can now be configured in app.toml)
+ ignoring the amino lint for now
  • Loading branch information
tomtau committed Jun 22, 2021
1 parent e6ebc94 commit b11736f
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 17 deletions.
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
# Changelog

*June 22, 2021*

## v2.1.0
This version is based on Cosmos SDK 0.42.6 and Tendermint 0.34.11 which, among other changes, contain state sync-related fixes.

### Features
- [565](https://github.com/crypto-org-chain/chain-main/pull/565) NFT module query denom by name

*May 18, 2021*

## v2.0.1
This pre-release version is the same as v2.0.0, but contains an upgrade-critical fix.
This released version is the same as v2.0.0, but contains an upgrade-critical fix.
NOTE that the upgrade plan name is still expected to be "v2.0.0".
*WARNING*: DO NOT UPGRADE to this binary yet; the upgrade instructions are to be provided later.
*WARNING*: please follow the upgrade instructions described here: https://crypto.org/docs/getting-started/upgrade_guide.html#the-canis-major-upgrade-guide-v1-to-v2-0-0

### Bug Fixes
- [552](https://github.com/crypto-org-chain/chain-main/pull/552) nft module store initialized after upgrade
- [552](https://github.com/crypto-org-chain/chain-main/pull/552) NFT module store initialized after upgrade

*May 14, 2021*

## v2.0.0
This pre-release version contains the scope of [ADR-003](https://github.com/crypto-org-chain/chain-main/blob/master/doc/architecture/adr-003.md) for the mainnet upgrade. It also upgrades to the latest version of Tendermint (0.34.10).
*WARNING*: DO NOT UPGRADE to this binary yet; the upgrade instructions are to be provided later.
*WARNING*: please follow the upgrade instructions described here: https://crypto.org/docs/getting-started/upgrade_guide.html#the-canis-major-upgrade-guide-v1-to-v2-0-0

### Breaking changes
- [516](https://github.com/crypto-org-chain/chain-main/pull/516) NFT module added
Expand Down
6 changes: 6 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ var (
// ChainApp extends an ABCI application, but with most of its parameters exported.
// They are exported for convenience in creating helper functions, as object
// capabilities aren't needed for testing.
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
type ChainApp struct {
*baseapp.BaseApp
legacyAmino *codec.LegacyAmino
Expand Down Expand Up @@ -499,6 +501,8 @@ func (app *ChainApp) ModuleAccountAddrs() map[string]bool {
//
// NOTE: This is solely to be used for testing purposes as it may be desirable
// for modules to register their own custom testing types.
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func (app *ChainApp) LegacyAmino() *codec.LegacyAmino {
return app.legacyAmino
}
Expand Down Expand Up @@ -603,6 +607,8 @@ func GetMaccPerms() map[string][]string {
}

// initParamsKeeper init params keeper and its subspaces
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func initParamsKeeper(appCodec codec.BinaryMarshaler, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper {
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)

Expand Down
2 changes: 2 additions & 0 deletions app/params/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (

// EncodingConfig specifies the concrete encoding types to use for a given app.
// This is provided for compatibility between protobuf and amino implementations.
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
type EncodingConfig struct {
InterfaceRegistry types.InterfaceRegistry
Marshaler codec.Marshaler
Expand Down
2 changes: 2 additions & 0 deletions app/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (

// App implements the common methods for a Cosmos SDK-based application
// specific blockchain.
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
type App interface {
// The assigned name of the app.
Name() string
Expand Down
1 change: 0 additions & 1 deletion cmd/chain-maind/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
WithLegacyAmino(encodingConfig.Amino).
WithInput(os.Stdin).
WithAccountRetriever(types.AccountRetriever{}).
WithBroadcastMode(flags.BroadcastBlock).
WithHomeDir(app.DefaultNodeHome).
WithViper("CRO")

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.16

require (
github.com/confluentinc/bincover v0.1.0
github.com/cosmos/cosmos-sdk v0.42.5
github.com/cosmos/cosmos-sdk v0.42.6
github.com/cosmos/ledger-go v0.9.2 // indirect
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.2
Expand All @@ -17,7 +17,7 @@ require (
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
github.com/tendermint/tendermint v0.34.10
github.com/tendermint/tendermint v0.34.11
github.com/tendermint/tm-db v0.6.4
github.com/tidwall/gjson v1.7.5
google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f
Expand Down
7 changes: 4 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cosmos/cosmos-sdk v0.42.5 h1:tXttRklrAUUrFopfe9aMXpfiArF6MH2QRRqq0Lxyd5w=
github.com/cosmos/cosmos-sdk v0.42.5/go.mod h1:3JyT+Ud7QRTO1/ikncNqVhaF526ZKNqh2HGMqXn+QHE=
github.com/cosmos/cosmos-sdk v0.42.6 h1:ps1QWfvaX6VLNcykA7wzfii/5IwBfYgTIik6NOVDq/c=
github.com/cosmos/cosmos-sdk v0.42.6/go.mod h1:kh37gwYQoWdgR7N/9zeqW2rJ7cnP2W4A7nqIaf6m3zg=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
Expand Down Expand Up @@ -572,8 +572,9 @@ github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoM
github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4=
github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg=
github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ=
github.com/tendermint/tendermint v0.34.10 h1:wBOc/It8sh/pVH9np2V5fBvRmIyFN/bUrGPx+eAHexs=
github.com/tendermint/tendermint v0.34.10/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0=
github.com/tendermint/tendermint v0.34.11 h1:q1Yh76oG4QbS07xhmIJh5iAE0fYpJ8P8YKYtjnWfJRY=
github.com/tendermint/tendermint v0.34.11/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0=
github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI=
github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8=
github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ=
Expand Down
12 changes: 6 additions & 6 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,12 @@
sha256 = "0nxbn0m7lr4dg0yrwnvlkfiyg3ndv8vdpssjx7b714nivpc6ar0y"

["github.com/cosmos/cosmos-sdk"]
sumVersion = "v0.42.5"
sumVersion = "v0.42.6"
["github.com/cosmos/cosmos-sdk".fetch]
type = "git"
url = "https://github.com/cosmos/cosmos-sdk"
rev = "842b06003f97d31e4ec83847e9fe8185d51a1fc7"
sha256 = "1wrkqmngdjdxaxz5hrcdihj5clvmf62pqjl0gq648nbfwbmwbzi5"
rev = "a7e19ad4588bcceeeeab522f5807b9ff22e91a8c"
sha256 = "1ysk7bqivhg5d3dcgksl91jmcc3nakvfkgfiry408v66vk8hbpx6"

["github.com/cosmos/go-bip39"]
sumVersion = "v1.0.0"
Expand Down Expand Up @@ -2215,12 +2215,12 @@
sha256 = "1zcms3l5fihzg8nf4vhdk18qpn1jkbm3rpkjfpskfcrgzlxk6vi5"

["github.com/tendermint/tendermint"]
sumVersion = "v0.34.10"
sumVersion = "v0.34.11"
["github.com/tendermint/tendermint".fetch]
type = "git"
url = "https://github.com/tendermint/tendermint"
rev = "68eceda0b57ec1d2db6bf9254355bb092a8dcb85"
sha256 = "124xiqxa2f4pnhsz173wr40wk31wf4xl3r9ixqa6d0myff86l64v"
rev = "c2908ef785bb5ca6e015910368e4b7a32821b9ff"
sha256 = "0x9hf09qqdjf77fwk8sdc1dzr7akndwbpylnhi6aaihg4an0aqvp"

["github.com/tendermint/tm-db"]
sumVersion = "v0.6.4"
Expand Down
2 changes: 1 addition & 1 deletion third_party/cosmos-sdk
Submodule cosmos-sdk updated 123 files
4 changes: 4 additions & 0 deletions x/chainmain/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func (AppModuleBasic) Name() string {
}

// RegisterLegacyAminoCodec does nothing. IBC does not support amino.
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {}

// RegisterInterfaces registers the module's interface types
Expand Down Expand Up @@ -115,6 +117,8 @@ func (AppModule) Route() sdk.Route { return sdk.Route{} }
func (AppModule) QuerierRoute() string { return "" }

// LegacyQuerierHandler returns the capability module's Querier.
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil }

// RegisterQueryService registers a GRPC query service to respond to the
Expand Down
2 changes: 2 additions & 0 deletions x/nft/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ var (
isCheckTx = false
)

// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
type KeeperSuite struct {
suite.Suite

Expand Down
16 changes: 16 additions & 0 deletions x/nft/keeper/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
)

// NewQuerier is the module level router for state queries
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {
return func(ctx sdk.Context, path []string, req abci.RequestQuery) (res []byte, err error) {
switch path[0] {
Expand All @@ -38,6 +40,8 @@ func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {
}
}

// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func querySupply(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
var params types.QuerySupplyParams

Expand All @@ -58,6 +62,8 @@ func querySupply(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerier
return bz, nil
}

// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func queryOwner(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
var params types.QueryOwnerParams

Expand All @@ -80,6 +86,8 @@ func queryOwner(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierC
return bz, nil
}

// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func queryCollection(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
var params types.QueryCollectionParams

Expand All @@ -101,6 +109,8 @@ func queryCollection(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQue
return bz, nil
}

// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func queryDenom(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
var params types.QueryDenomParams

Expand All @@ -122,6 +132,8 @@ func queryDenom(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierC
return bz, nil
}

// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func queryDenomByName(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
var params types.QueryDenomByNameParams

Expand All @@ -143,6 +155,8 @@ func queryDenomByName(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQu
return bz, nil
}

// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func queryDenoms(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
denoms := k.GetDenoms(ctx)

Expand All @@ -154,6 +168,8 @@ func queryDenoms(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerier
return bz, nil
}

// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func queryNFT(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
var params types.QueryNFTParams

Expand Down
4 changes: 4 additions & 0 deletions x/nft/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ type AppModuleBasic struct {
func (AppModuleBasic) Name() string { return types.ModuleName }

// RegisterLegacyAminoCodec registers the NFT module's types on the LegacyAmino codec.
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
types.RegisterLegacyAminoCodec(cdc)
}
Expand Down Expand Up @@ -133,6 +135,8 @@ func (am AppModule) Route() sdk.Route {
func (AppModule) QuerierRoute() string { return types.RouterKey }

// LegacyQuerierHandler returns the NFT module sdk.Querier.
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {
return keeper.NewQuerier(am.keeper, legacyQuerierCdc)
}
Expand Down
2 changes: 2 additions & 0 deletions x/nft/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ func init() {
}

// RegisterLegacyAminoCodec concrete types on codec
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgIssueDenom{}, "chainmain/nft/MsgIssueDenom", nil)
cdc.RegisterConcrete(&MsgTransferNFT{}, "chainmain/nft/MsgTransferNFT", nil)
Expand Down
4 changes: 4 additions & 0 deletions x/supply/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ func (AppModuleBasic) Name() string {
}

// RegisterLegacyAminoCodec does nothing. IBC does not support amino.
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {}

// RegisterInterfaces registers the module's interface types
Expand Down Expand Up @@ -121,6 +123,8 @@ func (AppModule) Route() sdk.Route { return sdk.Route{} }
func (AppModule) QuerierRoute() string { return types.RouterKey }

// LegacyQuerierHandler returns the capability module's Querier.
// (Amino is still needed for Ledger at the moment)
// nolint: staticcheck
func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {
return nil
}
Expand Down

0 comments on commit b11736f

Please sign in to comment.