Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(app)!: cosmos SDK v0.46 upgrade #1244

Merged
merged 38 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4b3f44e
wip: remove cosmwasm
aleem1314 Jul 7, 2022
e3699aa
wip
aleem1314 Jul 8, 2022
b7a0bb9
refactor: remove experimental config
aleem1314 Jul 12, 2022
848b08d
refactor: fix imports
aleem1314 Jul 12, 2022
f3b165e
wip: migrating regen app
aleem1314 Jul 12, 2022
db76e51
wip: fixing tests
aleem1314 Jul 12, 2022
ba2bf1c
fix: fix imports
aleem1314 Jul 13, 2022
a1f2c5d
Merge branch 'master' of https://github.com/regen-network/regen-ledge…
aleem1314 Jul 18, 2022
3b4a5df
fix: resolve build errors
aleem1314 Jul 18, 2022
dc2c5cb
chore: remove ecocredit migrations
aleem1314 Jul 25, 2022
e30ddf8
Merge branch 'master' into aleem/857-sdk-v0.46
aleem1314 Jul 25, 2022
c600659
chore: cleanup
aleem1314 Jul 25, 2022
fef7838
refactor: bump sdk version to rc3
aleem1314 Jul 25, 2022
a137cf2
chore: update Makefile
aleem1314 Jul 25, 2022
e636cce
fix: fix simulations
aleem1314 Jul 26, 2022
487bc6d
Merge branch 'master' into aleem/857-sdk-v0.46
aleem1314 Jul 26, 2022
664278a
chore: run make tidy
aleem1314 Jul 26, 2022
7f09b82
fix: fix failing tests
aleem1314 Jul 26, 2022
ae8e514
wip: fix integration tests
aleem1314 Jul 26, 2022
14ab5bb
chore: fix failing test
aleem1314 Jul 27, 2022
bc0ccfa
chore: try fixing tests
aleem1314 Jul 27, 2022
c9de3cd
update network.go
aleem1314 Jul 27, 2022
d72698e
try fix cli tests
aleem1314 Jul 27, 2022
5bf06a3
chore: fix tests
aleem1314 Jul 28, 2022
44a1014
chore: fix failing tests
aleem1314 Jul 28, 2022
4083d80
chore: fix failing tests
aleem1314 Jul 28, 2022
2d7ac5e
Merge branch 'master' into aleem/857-sdk-v0.46
aleem1314 Jul 28, 2022
cca7587
chore: cleanup
aleem1314 Jul 29, 2022
1669f61
chore: update test.yml
aleem1314 Jul 29, 2022
a3bfed7
wip
aleem1314 Jul 29, 2022
2ebe49a
chore: update scripts
aleem1314 Jul 30, 2022
1482427
Update app/encoding.go
aleem1314 Aug 2, 2022
c1b86b4
Update app/app.go
aleem1314 Aug 2, 2022
be2e491
chore: review changes
aleem1314 Aug 2, 2022
fdcb556
chore: fix failing tests
aleem1314 Aug 2, 2022
1127910
chore: register data module types with authz
aleem1314 Aug 2, 2022
9aaa8d3
Update app/app.go
aleem1314 Aug 3, 2022
fafe166
Merge branch 'master' into aleem/857-sdk-v0.46
aleem1314 Aug 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ jobs:
- name: test liveness
run: |
./contrib/localnet_liveness.sh 100 5 50 localhost
if: env.GIT_DIFF
if: env.GIT_DIFF
4 changes: 2 additions & 2 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require (
github.com/cosmos/cosmos-sdk/orm v1.0.0-alpha.11
github.com/gogo/protobuf v1.3.2
google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf
google.golang.org/grpc v1.44.0
google.golang.org/protobuf v1.27.1
google.golang.org/grpc v1.45.0
google.golang.org/protobuf v1.28.0
)

require (
Expand Down
6 changes: 4 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,9 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg=
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand All @@ -250,8 +251,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
Expand Down
211 changes: 105 additions & 106 deletions app/app.go

Large diffs are not rendered by default.

29 changes: 12 additions & 17 deletions app/app_test.go
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
package app

import (
"encoding/json"
"os"
"testing"

"github.com/cosmos/cosmos-sdk/simapp"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"
)

func TestSimAppExportAndBlockedAddrs(t *testing.T) {
encCfg := MakeEncodingConfig()
db := dbm.NewMemDB()
app := NewRegenApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encCfg, simapp.EmptyAppOptions{}, emptyWasmOpts)
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
app := NewAppWithCustomOptions(t, false, SetupOptions{
Logger: logger,
DB: db,
InvCheckPeriod: 0,
EncConfig: encCfg,
HomePath: DefaultNodeHome,
SkipUpgradeHeights: map[int64]bool{},
AppOpts: EmptyAppOptions{},
})

for acc := range maccPerms {
require.Equal(t, true, app.BankKeeper.BlockedAddr(app.AccountKeeper.GetModuleAddress(acc)),
"ensure that all module account addresses are properly blocked in bank keeper")
}

genesisState := NewDefaultGenesisState(encCfg.Marshaler)
stateBytes, err := json.MarshalIndent(genesisState, "", " ")
require.NoError(t, err)

// Initialize the chain
app.InitChain(
abci.RequestInitChain{
Validators: []abci.ValidatorUpdate{},
AppStateBytes: stateBytes,
},
)
app.Commit()

// Making a new app object with the db, so that initchain hasn't been called
app2 := NewRegenApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encCfg, simapp.EmptyAppOptions{}, emptyWasmOpts)
_, err = app2.ExportAppStateAndValidators(false, []string{})
app2 := NewRegenApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encCfg, EmptyAppOptions{})
_, err := app2.ExportAppStateAndValidators(false, []string{})
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
}

Expand Down
21 changes: 15 additions & 6 deletions app/encoding.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
package app

import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/std"
"github.com/cosmos/cosmos-sdk/x/auth/tx"
)

// EncodingConfig specifies the concrete encoding types to use for a given app.
aleem1314 marked this conversation as resolved.
Show resolved Hide resolved
// This is provided for compatibility between protobuf and amino implementations.
type EncodingConfig struct {
InterfaceRegistry types.InterfaceRegistry
Codec codec.Codec
TxConfig client.TxConfig
Amino *codec.LegacyAmino
}

// MakeEncodingConfig creates an EncodingConfig
func MakeEncodingConfig() params.EncodingConfig {
func MakeEncodingConfig() EncodingConfig {
amino := codec.NewLegacyAmino()
interfaceRegistry := types.NewInterfaceRegistry()
marshaler := codec.NewProtoCodec(interfaceRegistry)
txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes)
codec := codec.NewProtoCodec(interfaceRegistry)
txCfg := tx.NewTxConfig(codec, tx.DefaultSignModes)

encodingConfig := params.EncodingConfig{
encodingConfig := EncodingConfig{
InterfaceRegistry: interfaceRegistry,
Marshaler: marshaler,
Codec: codec,
TxConfig: txCfg,
Amino: amino,
}
Expand Down
67 changes: 0 additions & 67 deletions app/experimental_ante.go

This file was deleted.

161 changes: 0 additions & 161 deletions app/experimental_appconfig.go

This file was deleted.

Loading