Merge PR #5527: Bump Tendermint Version to v0.33.0

* Bump Tendermint version to v0.33.0

* Deprecate old cmn package with new packages

* Update update DB APIs

* More DB updates

* Bump IAVL to v0.13.0

* Handle error returned by iavl.NewMutableTree

* Fix some IAVL stuffs

* Update IAVL

* More updates

* Passing tests

* Fix unit tests

Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com>
This commit is contained in:
Alexander Bezobchuk
2020-01-16 13:46:51 -08:00
committed by Jack Zampolin
co-authored by Jack Zampolin
parent c92a7389ff
commit c1991e31bd
88 changed files with 577 additions and 344 deletions
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"os"
abci "github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"
bam "github.com/cosmos/cosmos-sdk/baseapp"
@@ -289,7 +289,7 @@ func NewSimApp(
if loadLatest {
err := app.LoadLatestVersion(app.keys[bam.MainStoreKey])
if err != nil {
cmn.Exit(err.Error())
tmos.Exit(err.Error())
}
}
+2 -1
View File
@@ -5,8 +5,9 @@ import (
"os"
"testing"
"github.com/cosmos/cosmos-sdk/x/simulation"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/cosmos/cosmos-sdk/x/simulation"
)
// Profile with:
+2 -2
View File
@@ -5,7 +5,7 @@ import (
"fmt"
"io/ioutil"
cmn "github.com/tendermint/tendermint/libs/common"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"
@@ -109,7 +109,7 @@ func PrintStats(db dbm.DB) {
// GetSimulationLog unmarshals the KVPair's Value to the corresponding type based on the
// each's module store key and the prefix bytes of the KVPair's key.
func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, cdc *codec.Codec, kvAs, kvBs []cmn.KVPair) (log string) {
func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, cdc *codec.Codec, kvAs, kvBs []tmkv.Pair) (log string) {
for i := 0; i < len(kvAs); i++ {
if len(kvAs[i].Value) == 0 && len(kvBs[i].Value) == 0 {
+7 -10
View File
@@ -5,40 +5,37 @@ import (
"testing"
"github.com/stretchr/testify/require"
cmn "github.com/tendermint/tendermint/libs/common"
tmkv "github.com/tendermint/tendermint/libs/kv"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/x/auth"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
)
func TestGetSimulationLog(t *testing.T) {
cdc := MakeCodec()
decoders := make(sdk.StoreDecoderRegistry)
decoders[auth.StoreKey] = func(cdc *codec.Codec, kvAs, kvBs cmn.KVPair) string { return "10" }
decoders[auth.StoreKey] = func(cdc *codec.Codec, kvAs, kvBs tmkv.Pair) string { return "10" }
tests := []struct {
store string
kvPairs []cmn.KVPair
kvPairs []tmkv.Pair
expectedLog string
}{
{
"Empty",
[]cmn.KVPair{{}},
[]tmkv.Pair{{}},
"",
},
{
auth.StoreKey,
[]cmn.KVPair{{Key: auth.GlobalAccountNumberKey, Value: cdc.MustMarshalBinaryLengthPrefixed(uint64(10))}},
[]tmkv.Pair{{Key: auth.GlobalAccountNumberKey, Value: cdc.MustMarshalBinaryLengthPrefixed(uint64(10))}},
"10",
},
{
"OtherStore",
[]cmn.KVPair{{Key: []byte("key"), Value: []byte("value")}},
[]tmkv.Pair{{Key: []byte("key"), Value: []byte("value")}},
fmt.Sprintf("store A %X => %X\nstore B %X => %X\n", []byte("key"), []byte("value"), []byte("key"), []byte("value")),
},
}