diff --git a/go.mod b/go.mod index eb6397130d..6f3f799435 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ replace ( ) require ( + cosmossdk.io/core v1.0.0 cosmossdk.io/math v1.3.0 cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 @@ -83,7 +84,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 github.com/tbruyelle/mdgofmt v0.1.3 - github.com/vektra/mockery/v2 v2.40.1 + github.com/vektra/mockery/v2 v2.46.0 go.etcd.io/bbolt v1.4.0-alpha.1 golang.org/x/mod v0.21.0 golang.org/x/sync v0.8.0 @@ -110,7 +111,6 @@ require ( connectrpc.com/otelconnect v0.7.0 // indirect cosmossdk.io/api v0.8.0 // indirect cosmossdk.io/collections v0.4.1-0.20240802064046-23fac2f1b8ab // indirect - cosmossdk.io/core v1.0.0 // indirect cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.4.1 // indirect diff --git a/go.sum b/go.sum index ca86f3a6cb..f94be37fc8 100644 --- a/go.sum +++ b/go.sum @@ -1286,8 +1286,8 @@ github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZy github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= -github.com/vektra/mockery/v2 v2.40.1 h1:8D01rBqloDLDHKZGXkyUD9Yj5Z+oDXBqDZ+tRXYM/oA= -github.com/vektra/mockery/v2 v2.40.1/go.mod h1:dPzGtjT0/Uu4hqpF6QNHwz+GLago7lq1bxdj9wHbGKo= +github.com/vektra/mockery/v2 v2.46.0 h1:DKIFj6hAPGwmOYiWfWzdsQtBgU8ozPXo3Bwbmf+Ku80= +github.com/vektra/mockery/v2 v2.46.0/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= diff --git a/ignite/internal/plugin/testdata/execute_fail/go.mod b/ignite/internal/plugin/testdata/execute_fail/go.mod index de0044a45d..a6ceaf395f 100644 --- a/ignite/internal/plugin/testdata/execute_fail/go.mod +++ b/ignite/internal/plugin/testdata/execute_fail/go.mod @@ -1,14 +1,14 @@ module execute_fail -go 1.23 +go 1.23.1 replace ( - github.com/ignite/cli/v29 => ../../../../.. github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.1 + github.com/ignite/cli/v29 => ../../../../.. ) require ( - github.com/hashicorp/go-plugin v1.6.0 + github.com/hashicorp/go-plugin v1.6.1 github.com/ignite/cli/v29 v29.0.0 ) @@ -16,21 +16,21 @@ require ( dario.cat/mergo v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v1.0.0 // indirect - github.com/aymanbagabas/go-osc52 v1.2.1 // indirect + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/charmbracelet/lipgloss v0.6.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-sdk v0.50.9 // indirect + github.com/cosmos/cosmos-sdk v0.52.0 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/color v1.17.0 // indirect github.com/fatih/structs v1.1.0 // indirect - github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/getsentry/sentry-go v0.28.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/go-git/go-git/v5 v5.12.0 // indirect @@ -54,7 +54,7 @@ require ( github.com/gorilla/css v1.0.0 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect @@ -63,12 +63,12 @@ require ( github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect github.com/microcosm-cc/bluemonday v1.0.23 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/muesli/reflow v0.3.0 // indirect - github.com/muesli/termenv v0.14.0 // indirect + github.com/muesli/termenv v0.15.2 // indirect github.com/oklog/run v1.1.0 // indirect github.com/otiai10/copy v1.14.0 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect @@ -83,18 +83,18 @@ require ( github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - go.etcd.io/bbolt v1.3.9 // indirect - golang.org/x/crypto v0.26.0 // indirect - golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.28.0 // indirect + go.etcd.io/bbolt v1.4.0-alpha.1 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.29.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.23.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect - golang.org/x/tools v0.24.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/tools v0.25.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect - google.golang.org/grpc v1.64.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.66.1 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/ignite/internal/plugin/testdata/execute_ok/go.mod b/ignite/internal/plugin/testdata/execute_ok/go.mod index a54a8bd828..426f9ae534 100644 --- a/ignite/internal/plugin/testdata/execute_ok/go.mod +++ b/ignite/internal/plugin/testdata/execute_ok/go.mod @@ -1,6 +1,6 @@ module execute_ok -go 1.23 +go 1.23.1 replace ( github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.1 @@ -8,7 +8,7 @@ replace ( ) require ( - github.com/hashicorp/go-plugin v1.6.0 + github.com/hashicorp/go-plugin v1.6.1 github.com/ignite/cli/v29 v29.0.0 ) @@ -16,21 +16,21 @@ require ( dario.cat/mergo v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v1.0.0 // indirect - github.com/aymanbagabas/go-osc52 v1.2.1 // indirect + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/charmbracelet/lipgloss v0.6.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-sdk v0.50.9 // indirect + github.com/cosmos/cosmos-sdk v0.52.0 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/color v1.17.0 // indirect github.com/fatih/structs v1.1.0 // indirect - github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/getsentry/sentry-go v0.28.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/go-git/go-git/v5 v5.12.0 // indirect @@ -54,7 +54,7 @@ require ( github.com/gorilla/css v1.0.0 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect @@ -63,12 +63,12 @@ require ( github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect github.com/microcosm-cc/bluemonday v1.0.23 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/muesli/reflow v0.3.0 // indirect - github.com/muesli/termenv v0.14.0 // indirect + github.com/muesli/termenv v0.15.2 // indirect github.com/oklog/run v1.1.0 // indirect github.com/otiai10/copy v1.14.0 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect @@ -83,18 +83,18 @@ require ( github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - go.etcd.io/bbolt v1.3.9 // indirect - golang.org/x/crypto v0.26.0 // indirect - golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.28.0 // indirect + go.etcd.io/bbolt v1.4.0-alpha.1 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.29.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.23.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect - golang.org/x/tools v0.24.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/tools v0.25.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect - google.golang.org/grpc v1.64.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.66.1 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/ignite/pkg/cosmosanalysis/app/app_test.go b/ignite/pkg/cosmosanalysis/app/app_test.go index 548abdbe10..b8899197fa 100644 --- a/ignite/pkg/cosmosanalysis/app/app_test.go +++ b/ignite/pkg/cosmosanalysis/app/app_test.go @@ -98,7 +98,7 @@ func TestFindRegisteredModules(t *testing.T) { { name: "new basic manager with only a app.go", path: "testdata/modules/single_app", - expectedModules: basicModules, + expectedModules: append(basicModules, "github.com/cosmos/ibc-go/v7/modules/core"), }, { name: "with runtime api routes", @@ -134,95 +134,6 @@ func TestFindRegisteredModules(t *testing.T) { "github.com/cosmos/cosmos-sdk/client/grpc/node", }, }, - { - name: "gaia", - path: "testdata/modules/gaia", - expectedModules: []string{ - "github.com/cosmos/cosmos-sdk/x/auth", - "cosmossdk.io/x/bank", - "cosmossdk.io/x/capability", - "cosmossdk.io/x/staking", - "cosmossdk.io/x/mint", - "cosmossdk.io/x/distribution", - "cosmossdk.io/x/gov", - "cosmossdk.io/x/params", - "cosmossdk.io/x/crisis", - "cosmossdk.io/x/slashing", - "cosmossdk.io/x/feegrant", - "cosmossdk.io/x/authz", - "cosmossdk.io/x/group", - "github.com/cosmos/ibc-go/v5/modules/core", - "cosmossdk.io/x/upgrade", - "cosmossdk.io/x/evidence", - "github.com/cosmos/ibc-go/v5/modules/apps/transfer", - "github.com/gravity-devs/liquidity/v2/x/liquidity", - "github.com/strangelove-ventures/packet-forward-middleware/v2/router", - "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts", - "github.com/cosmos/gaia/v8/x/icamauth", - "github.com/cosmos/cosmos-sdk/client/docs/statik", - }, - }, - { - name: "spn", - path: "testdata/modules/spn", - expectedModules: []string{ - "github.com/cosmos/cosmos-sdk/x/auth", - "github.com/cosmos/cosmos-sdk/x/auth/tx", - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice", - "github.com/cosmos/cosmos-sdk/client/grpc/node", - "cosmossdk.io/x/bank", - "cosmossdk.io/x/capability", - "cosmossdk.io/x/staking", - "github.com/ignite/modules/x/mint", - "cosmossdk.io/x/distribution", - "cosmossdk.io/x/gov", - "cosmossdk.io/x/params", - "cosmossdk.io/x/crisis", - "cosmossdk.io/x/slashing", - "cosmossdk.io/x/feegrant", - "cosmossdk.io/x/authz", - "github.com/cosmos/ibc-go/v6/modules/core", - "cosmossdk.io/x/upgrade", - "cosmossdk.io/x/evidence", - "github.com/cosmos/ibc-go/v6/modules/apps/transfer", - "github.com/tendermint/spn/x/participation", - "github.com/ignite/modules/x/claim", - "github.com/tendermint/spn/x/profile", - "github.com/tendermint/spn/x/launch", - "github.com/tendermint/spn/x/campaign", - "github.com/tendermint/spn/x/monitoringc", - "github.com/tendermint/spn/x/monitoringp", - "github.com/tendermint/spn/x/reward", - "github.com/tendermint/fundraising/x/fundraising", - }, - }, - { - name: "juno", - path: "testdata/modules/juno", - expectedModules: []string{ - "github.com/cosmos/cosmos-sdk/x/auth", - "cosmossdk.io/x/bank", - "cosmossdk.io/x/capability", - "cosmossdk.io/x/staking", - "github.com/CosmosContracts/juno/v10/x/mint", - "cosmossdk.io/x/distribution", - "cosmossdk.io/x/gov", - "cosmossdk.io/x/params", - "cosmossdk.io/x/crisis", - "cosmossdk.io/x/slashing", - "github.com/cosmos/ibc-go/v3/modules/core", - "cosmossdk.io/x/feegrant", - "cosmossdk.io/x/upgrade", - "cosmossdk.io/x/evidence", - "github.com/cosmos/ibc-go/v3/modules/apps/transfer", - "cosmossdk.io/x/authz", - "github.com/CosmWasm/wasmd/x/wasm", - "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts", - "github.com/cosmos/cosmos-sdk/x/auth/tx", - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice", - "github.com/cosmos/cosmos-sdk/client/grpc/node", - }, - }, } for _, tt := range cases { @@ -254,7 +165,7 @@ func TestDiscoverModules(t *testing.T) { { name: "new basic manager with only a app.go", path: "testdata/modules/single_app", - expectedModules: basicModules, + expectedModules: append(basicModules, "github.com/cosmos/ibc-go/v7/modules/core"), }, { name: "with app_config.go file", @@ -266,94 +177,6 @@ func TestDiscoverModules(t *testing.T) { path: "testdata/modules/runtime", expectedModules: basicModules, }, - { - name: "gaia", - path: "testdata/modules/gaia", - expectedModules: []string{ - "github.com/cosmos/cosmos-sdk/x/auth", - "cosmossdk.io/x/bank", - "cosmossdk.io/x/capability", - "cosmossdk.io/x/staking", - "cosmossdk.io/x/mint", - "cosmossdk.io/x/distribution", - "cosmossdk.io/x/gov", - "cosmossdk.io/x/params", - "cosmossdk.io/x/crisis", - "cosmossdk.io/x/slashing", - "cosmossdk.io/x/feegrant", - "cosmossdk.io/x/authz", - "cosmossdk.io/x/group", - "github.com/cosmos/ibc-go/v5/modules/core", - "cosmossdk.io/x/upgrade", - "cosmossdk.io/x/evidence", - "github.com/cosmos/ibc-go/v5/modules/apps/transfer", - "github.com/gravity-devs/liquidity/v2/x/liquidity", - "github.com/strangelove-ventures/packet-forward-middleware/v2/router", - "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts", - "github.com/cosmos/gaia/v8/x/icamauth", - }, - }, - { - name: "spn", - path: "testdata/modules/spn", - expectedModules: []string{ - "github.com/cosmos/cosmos-sdk/x/auth", - "github.com/cosmos/cosmos-sdk/x/auth/tx", - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice", - "github.com/cosmos/cosmos-sdk/client/grpc/node", - "cosmossdk.io/x/bank", - "cosmossdk.io/x/capability", - "cosmossdk.io/x/staking", - "github.com/ignite/modules/x/mint", - "cosmossdk.io/x/distribution", - "cosmossdk.io/x/gov", - "cosmossdk.io/x/params", - "cosmossdk.io/x/crisis", - "cosmossdk.io/x/slashing", - "cosmossdk.io/x/feegrant", - "cosmossdk.io/x/authz", - "github.com/cosmos/ibc-go/v6/modules/core", - "cosmossdk.io/x/upgrade", - "cosmossdk.io/x/evidence", - "github.com/cosmos/ibc-go/v6/modules/apps/transfer", - "github.com/tendermint/spn/x/participation", - "github.com/ignite/modules/x/claim", - "github.com/tendermint/spn/x/profile", - "github.com/tendermint/spn/x/launch", - "github.com/tendermint/spn/x/campaign", - "github.com/tendermint/spn/x/monitoringc", - "github.com/tendermint/spn/x/monitoringp", - "github.com/tendermint/spn/x/reward", - "github.com/tendermint/fundraising/x/fundraising", - }, - }, - { - name: "juno", - path: "testdata/modules/juno", - expectedModules: []string{ - "github.com/cosmos/cosmos-sdk/x/auth", - "cosmossdk.io/x/bank", - "cosmossdk.io/x/capability", - "cosmossdk.io/x/staking", - "github.com/CosmosContracts/juno/v10/x/mint", - "cosmossdk.io/x/distribution", - "cosmossdk.io/x/gov", - "cosmossdk.io/x/params", - "cosmossdk.io/x/crisis", - "cosmossdk.io/x/slashing", - "github.com/cosmos/ibc-go/v3/modules/core", - "cosmossdk.io/x/feegrant", - "cosmossdk.io/x/upgrade", - "cosmossdk.io/x/evidence", - "github.com/cosmos/ibc-go/v3/modules/apps/transfer", - "cosmossdk.io/x/authz", - "github.com/CosmWasm/wasmd/x/wasm", - "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts", - "github.com/cosmos/cosmos-sdk/x/auth/tx", - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice", - "github.com/cosmos/cosmos-sdk/client/grpc/node", - }, - }, } for _, tt := range cases { diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/app_config/app.go b/ignite/pkg/cosmosanalysis/app/testdata/modules/app_config/app.go index c26b0eef3d..ea8ca40aa5 100644 --- a/ignite/pkg/cosmosanalysis/app/testdata/modules/app_config/app.go +++ b/ignite/pkg/cosmosanalysis/app/testdata/modules/app_config/app.go @@ -1,6 +1,10 @@ package app import ( + bankkeeper "cosmossdk.io/x/bank/keeper" + govkeeper "cosmossdk.io/x/gov/keeper" + paramstypes "cosmossdk.io/x/params/types" + stakingkeeper "cosmossdk.io/x/staking/keeper" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" @@ -9,10 +13,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/gogo/protobuf/codec" abci "github.com/tendermint/tendermint/abci/types" fookeeper "github.com/username/test/x/foo/keeper" diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/app.go b/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/app.go deleted file mode 100644 index daa505eea0..0000000000 --- a/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/app.go +++ /dev/null @@ -1,1098 +0,0 @@ -package gaia - -import ( - "fmt" - "io" - stdlog "log" - "net/http" - "os" - "path/filepath" - - "cosmossdk.io/client/v2/autocli" - sdkerrors "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/server/api" - "github.com/cosmos/cosmos-sdk/server/config" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/simapp" - "github.com/cosmos/cosmos-sdk/store/streaming" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/cosmos-sdk/x/auth/ante" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - "github.com/cosmos/cosmos-sdk/x/authz" - authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" - "github.com/cosmos/cosmos-sdk/x/bank" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - distr "github.com/cosmos/cosmos-sdk/x/distribution" - distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/cosmos/cosmos-sdk/x/gov" - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/cosmos-sdk/x/group" - groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" - groupmodule "github.com/cosmos/cosmos-sdk/x/group/module" - "github.com/cosmos/cosmos-sdk/x/mint" - mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/params" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - "github.com/cosmos/cosmos-sdk/x/slashing" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts" - icacontroller "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller" - icacontrollerkeeper "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/keeper" - icacontrollertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" - icahost "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/ibc-go/v5/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v5/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v5/modules/core" - ibcclient "github.com/cosmos/ibc-go/v5/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v5/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" - ibcchanneltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v5/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v5/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper" - ibctestingtypes "github.com/cosmos/ibc-go/v5/testing/types" - "github.com/gorilla/mux" - "github.com/gravity-devs/liquidity/v2/x/liquidity" - liquiditykeeper "github.com/gravity-devs/liquidity/v2/x/liquidity/keeper" - liquiditytypes "github.com/gravity-devs/liquidity/v2/x/liquidity/types" - "github.com/rakyll/statik/fs" - "github.com/spf13/cast" - "github.com/strangelove-ventures/packet-forward-middleware/v2/router" - routerkeeper "github.com/strangelove-ventures/packet-forward-middleware/v2/router/keeper" - routertypes "github.com/strangelove-ventures/packet-forward-middleware/v2/router/types" - abci "github.com/tendermint/tendermint/abci/types" - tmjson "github.com/tendermint/tendermint/libs/json" - "github.com/tendermint/tendermint/libs/log" - tmos "github.com/tendermint/tendermint/libs/os" - dbm "github.com/tendermint/tm-db" - - "github.com/ignite/cli/v29/ignite/pkg/errors" - - gaiaante "github.com/cosmos/gaia/v8/ante" - gaiaappparams "github.com/cosmos/gaia/v8/app/params" - "github.com/cosmos/gaia/v8/x/globalfee" - "github.com/cosmos/gaia/v8/x/icamauth" - icamauthkeeper "github.com/cosmos/gaia/v8/x/icamauth/keeper" - icamauthtypes "github.com/cosmos/gaia/v8/x/icamauth/types" - - // unnamed import of statik for swagger UI support - _ "github.com/cosmos/cosmos-sdk/client/docs/statik" -) - -var ( - // DefaultNodeHome default home directories for the application daemon - DefaultNodeHome string - - // ModuleBasics defines the module BasicManager is in charge of setting up basic, - // non-dependant module elements, such as codec registration - // and genesis verification. - ModuleBasics = module.NewBasicManager( - auth.AppModuleBasic{}, - genutil.AppModuleBasic{}, - bank.AppModuleBasic{}, - capability.AppModuleBasic{}, - staking.AppModuleBasic{}, - mint.AppModuleBasic{}, - distr.AppModuleBasic{}, - gov.NewAppModuleBasic( - []govclient.ProposalHandler{ - paramsclient.ProposalHandler, - distrclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, - }, - ), - params.AppModuleBasic{}, - crisis.AppModuleBasic{}, - slashing.AppModuleBasic{}, - feegrantmodule.AppModuleBasic{}, - authzmodule.AppModuleBasic{}, - groupmodule.AppModuleBasic{}, - ibc.AppModuleBasic{}, - upgrade.AppModuleBasic{}, - evidence.AppModuleBasic{}, - transfer.AppModuleBasic{}, - vesting.AppModuleBasic{}, - liquidity.AppModuleBasic{}, - router.AppModuleBasic{}, - ica.AppModuleBasic{}, - icamauth.AppModuleBasic{}, - globalfee.AppModule{}, - ) - - // module account permissions - maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - icatypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - } -) - -var ( - _ simapp.App = (*GaiaApp)(nil) - _ servertypes.Application = (*GaiaApp)(nil) -) - -// GaiaApp 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. -type GaiaApp struct { //nolint: revive - *baseapp.BaseApp - legacyAmino *codec.LegacyAmino - appCodec codec.Codec - interfaceRegistry types.InterfaceRegistry - invCheckPeriod uint - - // keys to access the substores - keys map[string]*storetypes.KVStoreKey - tkeys map[string]*storetypes.TransientStoreKey - memKeys map[string]*storetypes.MemoryStoreKey - - // keepers - AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - MintKeeper mintkeeper.Keeper - DistrKeeper distrkeeper.Keeper - GovKeeper govkeeper.Keeper - CrisisKeeper crisiskeeper.Keeper - UpgradeKeeper upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - IBCKeeper *ibckeeper.Keeper - ICAControllerKeeper icacontrollerkeeper.Keeper - ICAHostKeeper icahostkeeper.Keeper - ICAMauthKeeper icamauthkeeper.Keeper - EvidenceKeeper evidencekeeper.Keeper - TransferKeeper ibctransferkeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - GroupKeeper groupkeeper.Keeper - AuthzKeeper authzkeeper.Keeper - LiquidityKeeper liquiditykeeper.Keeper - - RouterKeeper routerkeeper.Keeper - - // make scoped keepers public for test purposes - ScopedIBCKeeper capabilitykeeper.ScopedKeeper - ScopedTransferKeeper capabilitykeeper.ScopedKeeper - ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper - ScopedICAHostKeeper capabilitykeeper.ScopedKeeper - ScopedICAMauthKeeper capabilitykeeper.ScopedKeeper - - // the module manager - mm *module.Manager - - // simulation manager - sm *module.SimulationManager - configurator module.Configurator -} - -func init() { - userHomeDir, err := os.UserHomeDir() - if err != nil { - stdlog.Println("Failed to get home dir %2", err) - } - - DefaultNodeHome = filepath.Join(userHomeDir, ".gaia") -} - -// NewGaiaApp returns a reference to an initialized Gaia. -func NewGaiaApp( - logger log.Logger, - db dbm.DB, traceStore io.Writer, - loadLatest bool, - skipUpgradeHeights map[int64]bool, - homePath string, - invCheckPeriod uint, - encodingConfig gaiaappparams.EncodingConfig, - appOpts servertypes.AppOptions, - baseAppOptions ...func(*baseapp.BaseApp), -) *GaiaApp { - appCodec := encodingConfig.Codec - legacyAmino := encodingConfig.Amino - interfaceRegistry := encodingConfig.InterfaceRegistry - - bApp := baseapp.NewBaseApp( - appName, - logger, - db, - encodingConfig.TxConfig.TxDecoder(), - baseAppOptions...) - bApp.SetCommitMultiStoreTracer(traceStore) - bApp.SetVersion(version.Version) - bApp.SetInterfaceRegistry(interfaceRegistry) - - keys := sdk.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, - minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, - evidencetypes.StoreKey, liquiditytypes.StoreKey, ibctransfertypes.StoreKey, - capabilitytypes.StoreKey, feegrant.StoreKey, authzkeeper.StoreKey, routertypes.StoreKey, icacontrollertypes.StoreKey, icahosttypes.StoreKey, icamauthtypes.StoreKey, group.StoreKey, - ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) - - // configure state listening capabilities using AppOptions - // we are doing nothing with the returned streamingServices and waitGroup in this case - if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, keys); err != nil { - tmos.Exit(err.Error()) - } - - app := &GaiaApp{ - BaseApp: bApp, - legacyAmino: legacyAmino, - appCodec: appCodec, - interfaceRegistry: interfaceRegistry, - invCheckPeriod: invCheckPeriod, - keys: keys, - tkeys: tkeys, - memKeys: memKeys, - } - - app.ParamsKeeper = initParamsKeeper( - appCodec, - legacyAmino, - keys[paramstypes.StoreKey], - tkeys[paramstypes.TStoreKey], - ) - - // set the BaseApp's parameter store - bApp.SetParamStore( - app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()), - ) - - // add capability keeper and ScopeToModule for ibc module - app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) - scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) - scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) - scopedICAMauthKeeper := app.CapabilityKeeper.ScopeToModule(icamauthtypes.ModuleName) - scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) - scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) - - app.CapabilityKeeper.Seal() - - // add keepers - app.AccountKeeper = authkeeper.NewAccountKeeper( - appCodec, - keys[authtypes.StoreKey], - app.GetSubspace(authtypes.ModuleName), - authtypes.ProtoBaseAccount, - maccPerms, - sdk.Bech32MainPrefix, - ) - app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, - keys[banktypes.StoreKey], - app.AccountKeeper, - app.GetSubspace(banktypes.ModuleName), - app.BlockedModuleAccountAddrs(), - ) - - app.AuthzKeeper = authzkeeper.NewKeeper( - keys[authzkeeper.StoreKey], - appCodec, - app.MsgServiceRouter(), - app.AccountKeeper, - ) - - groupConfig := group.DefaultConfig() - /* - Example of setting group params: - groupConfig.MaxMetadataLen = 1000 - */ - app.GroupKeeper = groupkeeper.NewKeeper( - keys[group.StoreKey], - appCodec, - app.MsgServiceRouter(), - app.AccountKeeper, - groupConfig, - ) - - app.FeeGrantKeeper = feegrantkeeper.NewKeeper( - appCodec, - keys[feegrant.StoreKey], - app.AccountKeeper, - ) - stakingKeeper := stakingkeeper.NewKeeper( - appCodec, - keys[stakingtypes.StoreKey], - app.AccountKeeper, - app.BankKeeper, - app.GetSubspace(stakingtypes.ModuleName), - ) - app.MintKeeper = mintkeeper.NewKeeper( - appCodec, - keys[minttypes.StoreKey], - app.GetSubspace(minttypes.ModuleName), - &stakingKeeper, - app.AccountKeeper, - app.BankKeeper, - authtypes.FeeCollectorName, - ) - app.DistrKeeper = distrkeeper.NewKeeper( - appCodec, - keys[distrtypes.StoreKey], - app.GetSubspace(distrtypes.ModuleName), - app.AccountKeeper, - app.BankKeeper, - &stakingKeeper, - authtypes.FeeCollectorName, - ) - app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, - keys[slashingtypes.StoreKey], - &stakingKeeper, - app.GetSubspace(slashingtypes.ModuleName), - ) - app.CrisisKeeper = crisiskeeper.NewKeeper( - app.GetSubspace(crisistypes.ModuleName), - invCheckPeriod, - app.BankKeeper, - authtypes.FeeCollectorName, - ) - app.LiquidityKeeper = liquiditykeeper.NewKeeper( - appCodec, - keys[liquiditytypes.StoreKey], - app.GetSubspace(liquiditytypes.ModuleName), - app.BankKeeper, - app.AccountKeeper, - app.DistrKeeper, - ) - - // register the staking hooks - // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks - app.StakingKeeper = *stakingKeeper.SetHooks( - stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), - ) - - // set the governance module account as the authority for conducting upgrades - // UpgradeKeeper must be created before IBCKeeper - app.UpgradeKeeper = upgradekeeper.NewKeeper( - skipUpgradeHeights, - keys[upgradetypes.StoreKey], - appCodec, - homePath, - app.BaseApp, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - // UpgradeKeeper must be created before IBCKeeper - app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, - keys[ibchost.StoreKey], - app.GetSubspace(ibchost.ModuleName), - app.StakingKeeper, - app.UpgradeKeeper, - scopedIBCKeeper, - ) - - // register the proposal types - - govRouter := govv1beta1.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - govConfig := govtypes.DefaultConfig() - /* - Example of setting gov params: - govConfig.MaxMetadataLen = 10000 - */ - app.GovKeeper = govkeeper.NewKeeper( - appCodec, - keys[govtypes.StoreKey], - app.GetSubspace(govtypes.ModuleName), - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - govRouter, - app.MsgServiceRouter(), - govConfig, - ) - - app.TransferKeeper = ibctransferkeeper.NewKeeper( - appCodec, - keys[ibctransfertypes.StoreKey], - app.GetSubspace(ibctransfertypes.ModuleName), - app.IBCKeeper.ChannelKeeper, - app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, - app.AccountKeeper, - app.BankKeeper, - scopedTransferKeeper, - ) - transferModule := transfer.NewAppModule(app.TransferKeeper) - transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) - - app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( - appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), - app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, - scopedICAControllerKeeper, app.MsgServiceRouter(), - ) - - app.ICAHostKeeper = icahostkeeper.NewKeeper( - appCodec, keys[icahosttypes.StoreKey], - app.GetSubspace(icahosttypes.SubModuleName), - app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, - app.AccountKeeper, - scopedICAHostKeeper, - app.MsgServiceRouter(), - ) - icaModule := ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper) - - app.ICAMauthKeeper = icamauthkeeper.NewKeeper( - appCodec, - keys[icamauthtypes.StoreKey], - app.ICAControllerKeeper, - scopedICAMauthKeeper, - ) - icaMauthModule := icamauth.NewAppModule(appCodec, app.ICAMauthKeeper) - icaMauthIBCModule := icamauth.NewIBCModule(app.ICAMauthKeeper) - - icaControllerIBCModule := icacontroller.NewIBCMiddleware(icaMauthIBCModule, app.ICAControllerKeeper) - icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) - app.RouterKeeper = routerkeeper.NewKeeper(appCodec, keys[routertypes.StoreKey], app.GetSubspace(routertypes.ModuleName), app.TransferKeeper, app.DistrKeeper) - - routerModule := router.NewAppModule(app.RouterKeeper, transferIBCModule) - // create static IBC router, add transfer route, then set and seal it - ibcRouter := porttypes.NewRouter() - ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule). - AddRoute(icahosttypes.SubModuleName, icaHostIBCModule). - AddRoute(ibctransfertypes.ModuleName, transferIBCModule). - AddRoute(icamauthtypes.ModuleName, icaControllerIBCModule) - app.IBCKeeper.SetRouter(ibcRouter) - - // create evidence keeper with router - evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, - keys[evidencetypes.StoreKey], - &app.StakingKeeper, - app.SlashingKeeper, - ) - - app.EvidenceKeeper = *evidenceKeeper - - skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) - - // NOTE: Any module instantiated in the module manager that is later modified - // must be passed by reference here. - app.mm = module.NewManager( - genutil.NewAppModule( - app.AccountKeeper, - app.StakingKeeper, - app.BaseApp.DeliverTx, - encodingConfig.TxConfig, - ), - auth.NewAppModule(appCodec, app.AccountKeeper, nil), - vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), - gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - upgrade.NewAppModule(app.UpgradeKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - ibc.NewAppModule(app.IBCKeeper), - params.NewAppModule(app.ParamsKeeper), - liquidity.NewAppModule(appCodec, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.DistrKeeper), - globalfee.NewAppModule(app.GetSubspace(globalfee.ModuleName)), - transferModule, - icaModule, - icaMauthModule, - routerModule, - routerModule, - ) - - // During begin block slashing happens after distr.BeginBlocker so that - // there is nothing left over in the validator fee pool, so as to keep the - // CanWithdrawInvariant invariant. - // NOTE: staking module is required if HistoricalEntries param > 0 - // NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC) - app.mm.SetOrderBeginBlockers( - // upgrades should be run first - upgradetypes.ModuleName, - capabilitytypes.ModuleName, - minttypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - evidencetypes.ModuleName, - stakingtypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - govtypes.ModuleName, - crisistypes.ModuleName, - liquiditytypes.ModuleName, - ibctransfertypes.ModuleName, - ibchost.ModuleName, - icatypes.ModuleName, - routertypes.ModuleName, - genutiltypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - group.ModuleName, - paramstypes.ModuleName, - vestingtypes.ModuleName, - icatypes.ModuleName, - icamauthtypes.ModuleName, - globalfee.ModuleName, - ) - app.mm.SetOrderEndBlockers( - crisistypes.ModuleName, - govtypes.ModuleName, - stakingtypes.ModuleName, - liquiditytypes.ModuleName, - ibctransfertypes.ModuleName, - ibchost.ModuleName, - icatypes.ModuleName, - routertypes.ModuleName, - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - minttypes.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - group.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - vestingtypes.ModuleName, - icatypes.ModuleName, - icamauthtypes.ModuleName, - globalfee.ModuleName, - ) - - // NOTE: The genutils module must occur after staking so that pools are - // properly initialized with tokens from genesis accounts. - // NOTE: The genutils module must also occur after auth so that it can access the params from auth. - // NOTE: Capability module must occur first so that it can initialize any capabilities - // so that other modules that want to create or claim capabilities afterwards in InitChain - // can do so safely. - app.mm.SetOrderInitGenesis( - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - stakingtypes.ModuleName, - slashingtypes.ModuleName, - govtypes.ModuleName, - minttypes.ModuleName, - crisistypes.ModuleName, - genutiltypes.ModuleName, - ibctransfertypes.ModuleName, - ibchost.ModuleName, - icatypes.ModuleName, - evidencetypes.ModuleName, - liquiditytypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - group.ModuleName, - routertypes.ModuleName, - icatypes.ModuleName, - icamauthtypes.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - vestingtypes.ModuleName, - globalfee.ModuleName, - ) - - // Uncomment if you want to set a custom migration order here. - // app.mm.SetOrderMigrations(custom order) - - app.mm.RegisterInvariants(&app.CrisisKeeper) - app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) - - app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - app.mm.RegisterServices(app.configurator) - - // create the simulation manager and define the order of the modules for deterministic simulations - // - // NOTE: this is not required apps that don't use the simulator for fuzz testing - // transactions - app.sm = module.NewSimulationManager( - auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - params.NewAppModule(app.ParamsKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - liquidity.NewAppModule(appCodec, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.DistrKeeper), - ibc.NewAppModule(app.IBCKeeper), - transferModule, - ) - - app.sm.RegisterStoreDecoders() - - // initialize stores - app.MountKVStores(keys) - app.MountTransientStores(tkeys) - app.MountMemoryStores(memKeys) - - bypassMinFeeMsgTypes := cast.ToStringSlice(appOpts.Get(gaiaappparams.BypassMinFeeMsgTypesKey)) - if bypassMinFeeMsgTypes == nil { - bypassMinFeeMsgTypes = GetDefaultBypassFeeMessages() - } - - anteHandler, err := gaiaante.NewAnteHandler( - gaiaante.HandlerOptions{ - HandlerOptions: ante.HandlerOptions{ - AccountKeeper: app.AccountKeeper, - BankKeeper: app.BankKeeper, - FeegrantKeeper: app.FeeGrantKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - SigGasConsumer: ante.DefaultSigVerificationGasConsumer, - // TxFeeChecker is not the default fee check, it will not check if the fee meets min_gas_price, this is checked in NewFeeWithBypassDecorator already. - TxFeeChecker: func(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, int64, error) { - feeTx, ok := tx.(sdk.FeeTx) - if !ok { - return nil, 0, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") - } - - feeCoins := feeTx.GetFee() - priority := gaiaante.GetTxPriority(feeCoins) - - return feeCoins, priority, nil - }, - }, - IBCkeeper: app.IBCKeeper, - BypassMinFeeMsgTypes: bypassMinFeeMsgTypes, - GlobalFeeSubspace: app.GetSubspace(globalfee.ModuleName), - }, - ) - if err != nil { - panic(errors.Errorf("failed to create AnteHandler: %w", err)) - } - - app.SetAnteHandler(anteHandler) - app.SetInitChainer(app.InitChainer) - app.SetBeginBlocker(app.BeginBlocker) - app.SetEndBlocker(app.EndBlocker) - - app.UpgradeKeeper.SetUpgradeHandler( - upgradeName, - func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - fromVM[icatypes.ModuleName] = icaModule.ConsensusVersion() - // create ICS27 Controller submodule params - controllerParams := icacontrollertypes.Params{} - // create ICS27 Host submodule params - hostParams := icahosttypes.Params{ - HostEnabled: true, - AllowMessages: []string{ - authzMsgExec, - authzMsgGrant, - authzMsgRevoke, - bankMsgSend, - bankMsgMultiSend, - distrMsgSetWithdrawAddr, - distrMsgWithdrawValidatorCommission, - distrMsgFundCommunityPool, - distrMsgWithdrawDelegatorReward, - feegrantMsgGrantAllowance, - feegrantMsgRevokeAllowance, - govMsgVoteWeighted, - govMsgSubmitProposal, - govMsgDeposit, - govMsgVote, - stakingMsgEditValidator, - stakingMsgDelegate, - stakingMsgUndelegate, - stakingMsgBeginRedelegate, - stakingMsgCreateValidator, - vestingMsgCreateVestingAccount, - ibcMsgTransfer, - liquidityMsgCreatePool, - liquidityMsgSwapWithinBatch, - liquidityMsgDepositWithinBatch, - liquidityMsgWithdrawWithinBatch, - }, - } - - ctx.Logger().Info("start to init interchainaccount module...") - // initialize ICS27 module - icaModule.InitModule(ctx, controllerParams, hostParams) - ctx.Logger().Info("Start to run module migrations...") - - return app.mm.RunMigrations(ctx, app.configurator, fromVM) - }, - ) - - upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() - if err != nil { - panic(fmt.Sprintf("failed to read upgrade info from disk %s", err)) - } - - if upgradeInfo.Name == upgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { - storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{icahosttypes.StoreKey}, - } - - // configure store loader that checks if version == upgradeHeight and applies store upgrades - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) - } - - if loadLatest { - if err := app.LoadLatestVersion(); err != nil { - tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err)) - } - } - - app.ScopedIBCKeeper = scopedIBCKeeper - app.ScopedTransferKeeper = scopedTransferKeeper - app.ScopedICAControllerKeeper = scopedICAControllerKeeper - app.ScopedICAHostKeeper = scopedICAHostKeeper - app.ScopedICAMauthKeeper = scopedICAMauthKeeper - - return app -} - -func GetDefaultBypassFeeMessages() []string { - return []string{ - sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), - sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), - sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), - } -} - -// Name returns the name of the App -func (app *GaiaApp) Name() string { return app.BaseApp.Name() } - -// BeginBlocker application updates every begin block -func (app *GaiaApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) -} - -// EndBlocker application updates every end block -func (app *GaiaApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.mm.EndBlock(ctx, req) -} - -// InitChainer application update at chain initialization -func (app *GaiaApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { - var genesisState GenesisState - if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { - panic(err) - } - - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) -} - -// LoadHeight loads a particular height -func (app *GaiaApp) LoadHeight(height int64) error { - return app.LoadVersion(height) -} - -// ModuleAccountAddrs returns all the app's module account addresses. -func (app *GaiaApp) ModuleAccountAddrs() map[string]bool { - modAccAddrs := make(map[string]bool) - for acc := range maccPerms { - modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true - } - - return modAccAddrs -} - -// BlockedModuleAccountAddrs returns all the app's blocked module account -// addresses. -func (app *GaiaApp) BlockedModuleAccountAddrs() map[string]bool { - modAccAddrs := app.ModuleAccountAddrs() - - // remove module accounts that are ALLOWED to received funds - // - // TODO: Blocked on updating to v0.46.x - // delete(modAccAddrs, authtypes.NewModuleAddress(grouptypes.ModuleName).String()) - delete(modAccAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String()) - - return modAccAddrs -} - -// LegacyAmino returns GaiaApp's amino codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *GaiaApp) LegacyAmino() *codec.LegacyAmino { - return app.legacyAmino -} - -// AppCodec returns Gaia's app codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *GaiaApp) AppCodec() codec.Codec { - return app.appCodec -} - -// InterfaceRegistry returns Gaia's InterfaceRegistry -func (app *GaiaApp) InterfaceRegistry() types.InterfaceRegistry { - return app.interfaceRegistry -} - -// GetKey returns the KVStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *GaiaApp) GetKey(storeKey string) *storetypes.KVStoreKey { - return app.keys[storeKey] -} - -// GetTKey returns the TransientStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *GaiaApp) GetTKey(storeKey string) *storetypes.TransientStoreKey { - return app.tkeys[storeKey] -} - -// GetMemKey returns the MemStoreKey for the provided mem key. -// -// NOTE: This is solely used for testing purposes. -func (app *GaiaApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { - return app.memKeys[storeKey] -} - -// GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. -func (app *GaiaApp) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - -// SimulationManager implements the SimulationApp interface -func (app *GaiaApp) SimulationManager() *module.SimulationManager { - return app.sm -} - -// RegisterAPIRoutes registers all application module routes with the provided -// API server. -func (app *GaiaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { - clientCtx := apiSvr.ClientCtx - // Register new tx routes from grpc-gateway. - authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // Register legacy and grpc-gateway routes for all modules. - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // register swagger API from root so that other applications can override easily - if apiConfig.Swagger { - RegisterSwaggerAPI(apiSvr.Router) - } -} - -// RegisterTxService implements the Application.RegisterTxService method. -func (app *GaiaApp) RegisterTxService(clientCtx client.Context) { - authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) -} - -// RegisterTendermintService implements the Application.RegisterTendermintService method. -func (app *GaiaApp) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( - clientCtx, - app.BaseApp.GRPCQueryRouter(), - app.interfaceRegistry, - app.Query, - ) -} - -// RegisterSwaggerAPI registers swagger route with API Server -func RegisterSwaggerAPI(rtr *mux.Router) { - statikFS, err := fs.New() - if err != nil { - panic(err) - } - - staticServer := http.FileServer(statikFS) - rtr.PathPrefix("/swagger/").Handler(http.StripPrefix("/swagger/", staticServer)) -} - -// initParamsKeeper init params keeper and its subspaces -func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper { - paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) - - paramsKeeper.Subspace(authtypes.ModuleName) - paramsKeeper.Subspace(banktypes.ModuleName) - paramsKeeper.Subspace(stakingtypes.ModuleName) - paramsKeeper.Subspace(minttypes.ModuleName) - paramsKeeper.Subspace(distrtypes.ModuleName) - paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) - paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(liquiditytypes.ModuleName) - paramsKeeper.Subspace(ibctransfertypes.ModuleName) - paramsKeeper.Subspace(ibchost.ModuleName) - - paramsKeeper.Subspace(routertypes.ModuleName).WithKeyTable(routertypes.ParamKeyTable()) - paramsKeeper.Subspace(icacontrollertypes.SubModuleName) - paramsKeeper.Subspace(icahosttypes.SubModuleName) - paramsKeeper.Subspace(globalfee.ModuleName) - - return paramsKeeper -} - -func (app *GaiaApp) OnTxSucceeded(ctx sdk.Context, sourcePort, sourceChannel string, txHash []byte, txBytes []byte) { -} - -func (app *GaiaApp) OnTxFailed(ctx sdk.Context, sourcePort, sourceChannel string, txHash []byte, txBytes []byte) { -} - -// TestingApp functions - -// GetBaseApp implements the TestingApp interface. -func (app *GaiaApp) GetBaseApp() *baseapp.BaseApp { - return app.BaseApp -} - -// GetStakingKeeper implements the TestingApp interface. -func (app *GaiaApp) GetStakingKeeper() ibctestingtypes.StakingKeeper { - return app.StakingKeeper -} - -// GetIBCKeeper implements the TestingApp interface. -func (app *GaiaApp) GetIBCKeeper() *ibckeeper.Keeper { - return app.IBCKeeper -} - -// GetScopedIBCKeeper implements the TestingApp interface. -func (app *GaiaApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { - return app.ScopedIBCKeeper -} - -// GetTxConfig implements the TestingApp interface. -func (app *GaiaApp) GetTxConfig() client.TxConfig { - return MakeTestEncodingConfig().TxConfig -} - -func (GaiaApp) TxConfig() client.TxConfig { return nil } -func (GaiaApp) AutoCliOpts() autocli.AppOptions { return autocli.AppOptions{} } - -// EmptyAppOptions is a stub implementing AppOptions -type EmptyAppOptions struct{} - -// Get implements AppOptions -func (ao EmptyAppOptions) Get(o string) interface{} { - return nil -} - -// GetKey returns the KVStoreKey for the provided store key. -func (GaiaApp) GetKey(storeKey string) *storetypes.KVStoreKey { - sk := app.UnsafeFindStoreKey(storeKey) - kvStoreKey, ok := sk.(*storetypes.KVStoreKey) - if !ok { - return nil - } - return kvStoreKey -} - -// GetMemKey returns the MemoryStoreKey for the provided store key. -func (GaiaApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { - key, ok := app.UnsafeFindStoreKey(storeKey).(*storetypes.MemoryStoreKey) - if !ok { - return nil - } - - return key -} - -// kvStoreKeys returns all the kv store keys registered inside App. -func (GaiaApp) kvStoreKeys() map[string]*storetypes.KVStoreKey { - keys := make(map[string]*storetypes.KVStoreKey) - for _, k := range app.GetStoreKeys() { - if kv, ok := k.(*storetypes.KVStoreKey); ok { - keys[kv.Name()] = kv - } - } - - return keys -} - -// GetSubspace returns a param subspace for a given module name. -func (GaiaApp) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - -// SimulationManager implements the SimulationApp interface -func (GaiaApp) SimulationManager() *module.SimulationManager { - return app.sm -} diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/go.mod b/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/go.mod deleted file mode 100644 index 0851601f21..0000000000 --- a/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/go.mod +++ /dev/null @@ -1,28 +0,0 @@ -module github.com/cosmos/gaia/v14 - -go 1.20 - -require ( - cosmossdk.io/errors v1.0.0 - cosmossdk.io/math v1.2.0 - github.com/cosmos/cosmos-sdk v0.45.16 - github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v4 v4.1.1 - github.com/cosmos/ibc-go/v4 v4.4.2 - github.com/cosmos/interchain-security/v2 v2.0.0 - github.com/gogo/protobuf v1.3.3 - github.com/golang/protobuf v1.5.3 - github.com/google/gofuzz v1.2.0 - github.com/gorilla/mux v1.8.1 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/ory/dockertest/v3 v3.10.0 - github.com/rakyll/statik v0.1.7 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.8.0 - github.com/spf13/viper v1.17.0 - github.com/stretchr/testify v1.8.4 - github.com/tendermint/tendermint v0.34.27 - github.com/tendermint/tm-db v0.6.7 - google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb - google.golang.org/grpc v1.58.2 -) diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/juno/app.go b/ignite/pkg/cosmosanalysis/app/testdata/modules/juno/app.go deleted file mode 100644 index 71f3f87f58..0000000000 --- a/ignite/pkg/cosmosanalysis/app/testdata/modules/juno/app.go +++ /dev/null @@ -1,942 +0,0 @@ -package app - -import ( - "io" - "net/http" - "os" - "path/filepath" - "strings" - - storetypes "cosmossdk.io/store/types" - "github.com/cosmos/cosmos-sdk/server" - - "cosmossdk.io/client/v2/autocli" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec/types" - authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" - "github.com/ignite-hq/cli/ignite/pkg/openapiconsole" - "github.com/spf13/cast" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmos "github.com/tendermint/tendermint/libs/os" - dbm "github.com/tendermint/tm-db" - - "github.com/CosmosContracts/juno/v10/docs" - "github.com/CosmosContracts/juno/v10/x/mint" - mintkeeper "github.com/CosmosContracts/juno/v10/x/mint/keeper" - minttypes "github.com/CosmosContracts/juno/v10/x/mint/types" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" - "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/server/api" - "github.com/cosmos/cosmos-sdk/server/config" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/simapp" - store "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/cosmos-sdk/x/auth/ante" - authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - "github.com/cosmos/cosmos-sdk/x/authz" - authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" - "github.com/cosmos/cosmos-sdk/x/bank" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - distr "github.com/cosmos/cosmos-sdk/x/distribution" - distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/cosmos/cosmos-sdk/x/gov" - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/params" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - "github.com/cosmos/cosmos-sdk/x/slashing" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - transfer "github.com/cosmos/ibc-go/v3/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v3/modules/core" - ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" - tmjson "github.com/tendermint/tendermint/libs/json" - - "github.com/CosmWasm/wasmd/x/wasm" - wasmclient "github.com/CosmWasm/wasmd/x/wasm/client" - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - "github.com/prometheus/client_golang/prometheus" - - ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts" - icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types" - icahost "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types" - - encparams "github.com/CosmosContracts/juno/v10/app/params" -) - -const ( - AccountAddressPrefix = "juno" - Name = "juno" -) - -// We pull these out so we can set them with LDFLAGS in the Makefile -var ( - NodeDir = ".juno" - Bech32Prefix = "juno" - - // If EnabledSpecificProposals is "", and this is "true", then enable all x/wasm proposals. - // If EnabledSpecificProposals is "", and this is not "true", then disable all x/wasm proposals. - ProposalsEnabled = "true" - // If set to non-empty string it must be comma-separated list of values that are all a subset - // of "EnableAllProposals" (takes precedence over ProposalsEnabled) - // https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 - EnableSpecificProposals = "" -) - -// These constants are derived from the above variables. -// These are the ones we will want to use in the code, based on -// any overrides above -var ( - // DefaultNodeHome default home directories for Juno - DefaultNodeHome = os.ExpandEnv("$HOME/") + NodeDir - - // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address - Bech32PrefixAccAddr = Bech32Prefix - // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key - Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic - // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address - Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator - // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key - Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic - // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address - Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus - // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key - Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic -) - -// GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to -// produce a list of enabled proposals to pass into wasmd app. -func GetEnabledProposals() []wasm.ProposalType { - if EnableSpecificProposals == "" { - if ProposalsEnabled == "true" { - return wasm.EnableAllProposals - } - return wasm.DisableAllProposals - } - chunks := strings.Split(EnableSpecificProposals, ",") - proposals, err := wasm.ConvertToProposals(chunks) - if err != nil { - panic(err) - } - return proposals -} - -func GetWasmOpts(appOpts servertypes.AppOptions) []wasm.Option { - var wasmOpts []wasm.Option - if cast.ToBool(appOpts.Get("telemetry.enabled")) { - wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer)) - } - - wasmOpts = append(wasmOpts, wasmkeeper.WithGasRegister(NewJunoWasmGasRegister())) - - return wasmOpts -} - -func getGovProposalHandlers() []govclient.ProposalHandler { - var govProposalHandlers []govclient.ProposalHandler - // this line is used by starport scaffolding # stargate/app/govProposalHandlers - govProposalHandlers = wasmclient.ProposalHandlers - - govProposalHandlers = append(govProposalHandlers, - paramsclient.ProposalHandler, - distrclient.ProposalHandler, - upgradeclient.ProposalHandler, - upgradeclient.CancelProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, - // this line is used by starport scaffolding # stargate/app/govProposalHandler - ) - - return govProposalHandlers -} - -var ( - - // ModuleBasics defines the module BasicManager is in charge of setting up basic, - // non-dependant module elements, such as codec registration - // and genesis verification. - ModuleBasics = module.NewBasicManager( - auth.AppModuleBasic{}, - genutil.AppModuleBasic{}, - bank.AppModuleBasic{}, - capability.AppModuleBasic{}, - staking.AppModuleBasic{}, - mint.AppModuleBasic{}, - distr.AppModuleBasic{}, - gov.NewAppModuleBasic(getGovProposalHandlers()...), - params.AppModuleBasic{}, - crisis.AppModuleBasic{}, - slashing.AppModuleBasic{}, - ibc.AppModuleBasic{}, - feegrantmodule.AppModuleBasic{}, - upgrade.AppModuleBasic{}, - evidence.AppModuleBasic{}, - transfer.AppModuleBasic{}, - vesting.AppModuleBasic{}, - authzmodule.AppModuleBasic{}, - wasm.AppModuleBasic{}, - ica.AppModuleBasic{}, - ) - - // module account permissions - maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - icatypes.ModuleName: nil, - wasm.ModuleName: {authtypes.Burner}, - } -) - -var ( - _ simapp.App = (*App)(nil) - _ servertypes.Application = (*App)(nil) -) - -// App 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. -type App struct { - *baseapp.BaseApp - - cdc *codec.LegacyAmino - appCodec codec.Codec - interfaceRegistry types.InterfaceRegistry - - invCheckPeriod uint - - // keys to access the substores - keys map[string]*sdk.KVStoreKey - tkeys map[string]*sdk.TransientStoreKey - memKeys map[string]*sdk.MemoryStoreKey - - // keepers - AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - MintKeeper mintkeeper.Keeper - DistrKeeper distrkeeper.Keeper - GovKeeper govkeeper.Keeper - CrisisKeeper crisiskeeper.Keeper - UpgradeKeeper upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - EvidenceKeeper evidencekeeper.Keeper - TransferKeeper ibctransferkeeper.Keeper - AuthzKeeper authzkeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - - ICAHostKeeper icahostkeeper.Keeper - - // make scoped keepers public for test purposes - ScopedIBCKeeper capabilitykeeper.ScopedKeeper - ScopedICAHostKeeper capabilitykeeper.ScopedKeeper - ScopedTransferKeeper capabilitykeeper.ScopedKeeper - - // this line is used by starport scaffolding # stargate/app/keeperDeclaration - wasmKeeper wasm.Keeper - scopedWasmKeeper capabilitykeeper.ScopedKeeper - - // the module manager - mm *module.Manager - sm *module.SimulationManager -} - -// New returns a reference to an initialized Juno. -func New( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - loadLatest bool, - skipUpgradeHeights map[int64]bool, - homePath string, - invCheckPeriod uint, - encodingConfig encparams.EncodingConfig, - enabledProposals []wasm.ProposalType, - appOpts servertypes.AppOptions, - wasmOpts []wasm.Option, - baseAppOptions ...func(*baseapp.BaseApp), -) *App { - appCodec := encodingConfig.Marshaler - cdc := encodingConfig.Amino - interfaceRegistry := encodingConfig.InterfaceRegistry - - bApp := baseapp.NewBaseApp(Name, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) - bApp.SetCommitMultiStoreTracer(traceStore) - bApp.SetVersion(version.Version) - bApp.SetInterfaceRegistry(interfaceRegistry) - - keys := sdk.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, - minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, - evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, - authzkeeper.StoreKey, feegrant.StoreKey, icahosttypes.StoreKey, - wasm.StoreKey, - ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) - - app := &App{ - BaseApp: bApp, - cdc: cdc, - appCodec: appCodec, - interfaceRegistry: interfaceRegistry, - invCheckPeriod: invCheckPeriod, - keys: keys, - tkeys: tkeys, - memKeys: memKeys, - } - - app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) - - // set the BaseApp's parameter store - bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable())) - - // add capability keeper and ScopeToModule for ibc module - app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) - - // grant capabilities for the ibc and ibc-transfer modules - scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) - scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) - scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) - // this line is used by starport scaffolding # stargate/app/scopedKeeper - scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasm.ModuleName) - - // add keepers - app.AccountKeeper = authkeeper.NewAccountKeeper( - appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, - ) - app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), - ) - stakingKeeper := stakingkeeper.NewKeeper( - appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName), - ) - app.MintKeeper = mintkeeper.NewKeeper( - appCodec, keys[minttypes.StoreKey], app.GetSubspace(minttypes.ModuleName), &stakingKeeper, - app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, - ) - app.DistrKeeper = distrkeeper.NewKeeper( - appCodec, keys[distrtypes.StoreKey], app.GetSubspace(distrtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, authtypes.FeeCollectorName, app.ModuleAccountAddrs(), - ) - app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, keys[slashingtypes.StoreKey], &stakingKeeper, app.GetSubspace(slashingtypes.ModuleName), - ) - app.CrisisKeeper = crisiskeeper.NewKeeper( - app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, - ) - app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, nil) - - // upgrade handlers - cfg := module.NewConfigurator(appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - - // register the staking hooks - // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks - app.StakingKeeper = *stakingKeeper.SetHooks( - stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), - ) - - // ... other modules keepers - - // Create IBC Keeper - app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, - ) - - app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper) - app.AuthzKeeper = authzkeeper.NewKeeper(keys[authzkeeper.StoreKey], appCodec, app.BaseApp.MsgServiceRouter()) - - // register the proposal types - govRouter := govtypes.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - - // Create Transfer Keepers - app.TransferKeeper = ibctransferkeeper.NewKeeper( - appCodec, - keys[ibctransfertypes.StoreKey], - app.GetSubspace(ibctransfertypes.ModuleName), - app.IBCKeeper.ChannelKeeper, - app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, - app.AccountKeeper, - app.BankKeeper, - scopedTransferKeeper, - ) - - transferModule := transfer.NewAppModule(app.TransferKeeper) - transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) - - app.ICAHostKeeper = icahostkeeper.NewKeeper( - appCodec, - keys[icahosttypes.StoreKey], - app.GetSubspace(icahosttypes.SubModuleName), - app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, - app.AccountKeeper, - scopedICAHostKeeper, - app.MsgServiceRouter(), - ) - icaModule := ica.NewAppModule(nil, &app.ICAHostKeeper) - icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) - - // Create evidence Keeper for to register the IBC light client misbehaviour evidence route - evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, keys[evidencetypes.StoreKey], &app.StakingKeeper, app.SlashingKeeper, - ) - // If evidence needs to be handled for the app, set routes in router here and seal - app.EvidenceKeeper = *evidenceKeeper - - // this line is used by starport scaffolding # stargate/app/keeperDefinition - wasmDir := filepath.Join(homePath, "data") - - wasmConfig, err := wasm.ReadWasmConfig(appOpts) - if err != nil { - panic("error while reading wasm config: " + err.Error()) - } - - // The last arguments can contain custom message handlers, and custom query handlers, - // if we want to allow any custom callbacks - supportedFeatures := "iterator,staking,stargate" - app.wasmKeeper = wasm.NewKeeper( - appCodec, - keys[wasm.StoreKey], - app.GetSubspace(wasm.ModuleName), - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - app.DistrKeeper, - app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, - scopedWasmKeeper, - app.TransferKeeper, - app.MsgServiceRouter(), - app.GRPCQueryRouter(), - wasmDir, - wasmConfig, - supportedFeatures, - wasmOpts..., - ) - - ibcRouter := porttypes.NewRouter() - - // register wasm gov proposal types - // The gov proposal types can be individually enabled - if len(enabledProposals) != 0 { - govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.wasmKeeper, enabledProposals)) - } - - // Create static IBC router, add transfer route, then set and seal it - ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule). - AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.wasmKeeper, app.IBCKeeper.ChannelKeeper)). - AddRoute(icahosttypes.SubModuleName, icaHostIBCModule) - app.IBCKeeper.SetRouter(ibcRouter) - - app.GovKeeper = govkeeper.NewKeeper( - appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, govRouter, - ) - - /**** Module Options ****/ - - // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment - // we prefer to be more strict in what arguments the modules expect. - skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) - - // NOTE: Any module instantiated in the module manager that is later modified - // must be passed by reference here. - - app.mm = module.NewManager( - genutil.NewAppModule( - app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, - encodingConfig.TxConfig, - ), - auth.NewAppModule(appCodec, app.AccountKeeper, nil), - vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - upgrade.NewAppModule(app.UpgradeKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - ibc.NewAppModule(app.IBCKeeper), - params.NewAppModule(app.ParamsKeeper), - authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - transferModule, - icaModule, - // this line is used by starport scaffolding # stargate/app/appModule - wasm.NewAppModule(appCodec, &app.wasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - ) - - // During begin block slashing happens after distr.BeginBlocker so that - // there is nothing left over in the validator fee pool, so as to keep the - // CanWithdrawInvariant invariant. - // NOTE: staking module is required if HistoricalEntries param > 0 - app.mm.SetOrderBeginBlockers( - upgradetypes.ModuleName, - capabilitytypes.ModuleName, - minttypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - evidencetypes.ModuleName, - stakingtypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - govtypes.ModuleName, - crisistypes.ModuleName, - genutiltypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - paramstypes.ModuleName, - vestingtypes.ModuleName, - // additional modules - ibchost.ModuleName, - ibctransfertypes.ModuleName, - icatypes.ModuleName, - wasm.ModuleName, - ) - - app.mm.SetOrderEndBlockers( - crisistypes.ModuleName, - govtypes.ModuleName, - stakingtypes.ModuleName, - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - minttypes.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - vestingtypes.ModuleName, - // additional non simd modules - ibchost.ModuleName, - ibctransfertypes.ModuleName, - icatypes.ModuleName, - wasm.ModuleName, - ) - - // NOTE: The genutils module must occur after staking so that pools are - // properly initialized with tokens from genesis accounts. - // NOTE: Capability module must occur first so that it can initialize any capabilities - // so that other modules that want to create or claim capabilities afterwards in InitChain - // can do so safely. - app.mm.SetOrderInitGenesis( - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - stakingtypes.ModuleName, - slashingtypes.ModuleName, - govtypes.ModuleName, - minttypes.ModuleName, - crisistypes.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - authz.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - vestingtypes.ModuleName, - feegrant.ModuleName, - // this line is used by starport scaffolding # stargate/app/initGenesis - ibchost.ModuleName, - ibctransfertypes.ModuleName, - icatypes.ModuleName, - wasm.ModuleName, - ) - - app.mm.RegisterInvariants(&app.CrisisKeeper) - app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) - app.mm.RegisterServices(cfg) - // initialize stores - app.MountKVStores(keys) - app.MountTransientStores(tkeys) - app.MountMemoryStores(memKeys) - - // register upgrade - app.RegisterUpgradeHandlers(cfg) - - anteHandler, err := NewAnteHandler( - HandlerOptions{ - HandlerOptions: ante.HandlerOptions{ - AccountKeeper: app.AccountKeeper, - BankKeeper: app.BankKeeper, - FeegrantKeeper: app.FeeGrantKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - SigGasConsumer: ante.DefaultSigVerificationGasConsumer, - }, - IBCKeeper: app.IBCKeeper, - TxCounterStoreKey: keys[wasm.StoreKey], - WasmConfig: wasmConfig, - Cdc: appCodec, - }, - ) - if err != nil { - panic(err) - } - - // initialize BaseApp - app.SetInitChainer(app.InitChainer) - app.SetBeginBlocker(app.BeginBlocker) - app.SetAnteHandler(anteHandler) - app.SetEndBlocker(app.EndBlocker) - - if manager := app.SnapshotManager(); manager != nil { - err = manager.RegisterExtensions( - wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.wasmKeeper), - ) - if err != nil { - panic("failed to register snapshot extension: " + err.Error()) - } - } - - upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() - if err != nil { - panic(err) - } - - if upgradeInfo.Name == "multiverse" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { - storeUpgrades := store.StoreUpgrades{ - Added: []string{icacontrollertypes.StoreKey, icahosttypes.StoreKey}, - } - - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) - } - - if loadLatest { - if err := app.LoadLatestVersion(); err != nil { - tmos.Exit(err.Error()) - } - - // Initialize and seal the capability keeper so all persistent capabilities - // are loaded in-memory and prevent any further modules from creating scoped - // sub-keepers. - // This must be done during creation of baseapp rather than in InitChain so - // that in-memory capabilities get regenerated on app restart. - // Note that since this reads from the store, we can only perform it when - // `loadLatest` is set to true. - app.CapabilityKeeper.Seal() - } - - app.ScopedIBCKeeper = scopedIBCKeeper - app.ScopedTransferKeeper = scopedTransferKeeper - // this line is used by starport scaffolding # stargate/app/beforeInitReturn - app.scopedWasmKeeper = scopedWasmKeeper - app.ScopedICAHostKeeper = scopedICAHostKeeper - - // create the simulation manager and define the order of the modules for deterministic simulations - // - // NOTE: this is not required apps that don't use the simulator for fuzz testing - // transactions - app.sm = module.NewSimulationManager( - auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - params.NewAppModule(app.ParamsKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - wasm.NewAppModule(appCodec, &app.wasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - ibc.NewAppModule(app.IBCKeeper), - transferModule, - ) - - app.sm.RegisterStoreDecoders() - - return app -} - -// Name returns the name of the App -func (app *App) Name() string { return app.BaseApp.Name() } - -// BeginBlocker application updates every begin block -func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) -} - -// EndBlocker application updates every end block -func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.mm.EndBlock(ctx, req) -} - -// InitChainer application update at chain initialization -func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { - var genesisState GenesisState - if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { - panic(err) - } - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) -} - -// LoadHeight loads a particular height -func (app *App) LoadHeight(height int64) error { - return app.LoadVersion(height) -} - -// ModuleAccountAddrs returns all the app's module account addresses. -func (app *App) ModuleAccountAddrs() map[string]bool { - modAccAddrs := make(map[string]bool) - for acc := range maccPerms { - modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true - } - - return modAccAddrs -} - -// LegacyAmino returns SimApp's amino codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *App) LegacyAmino() *codec.LegacyAmino { - return app.cdc -} - -// AppCodec returns Juno's app codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *App) AppCodec() codec.Codec { - return app.appCodec -} - -// InterfaceRegistry returns Juno's InterfaceRegistry -func (app *App) InterfaceRegistry() types.InterfaceRegistry { - return app.interfaceRegistry -} - -// GetKey returns the KVStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetKey(storeKey string) *sdk.KVStoreKey { - return app.keys[storeKey] -} - -// GetTKey returns the TransientStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetTKey(storeKey string) *sdk.TransientStoreKey { - return app.tkeys[storeKey] -} - -// GetMemKey returns the MemStoreKey for the provided mem key. -// -// NOTE: This is solely used for testing purposes. -func (app *App) GetMemKey(storeKey string) *sdk.MemoryStoreKey { - return app.memKeys[storeKey] -} - -// GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - -// RegisterAPIRoutes registers all application module routes with the provided -// API server. -func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { - clientCtx := apiSvr.ClientCtx - rpc.RegisterRoutes(clientCtx, apiSvr.Router) - // Register legacy tx routes. - authrest.RegisterTxRoutes(clientCtx, apiSvr.Router) - // Register new tx routes from grpc-gateway. - authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // Register legacy and grpc-gateway routes for all modules. - ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router) - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // register app's OpenAPI routes. - apiSvr.Router.Handle("/static/openapi.yml", http.FileServer(http.FS(docs.Docs))) - apiSvr.Router.HandleFunc("/", openapiconsole.Handler(Name, "/static/openapi.yml")) -} - -// RegisterTxService implements the Application.RegisterTxService method. -func (app *App) RegisterTxService(clientCtx client.Context) { - authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) -} - -// RegisterTendermintService implements the Application.RegisterTendermintService method. -func (app *App) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry) -} - -// RegisterUpgradeHandlers returns upgrade handlers - -func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) { - app.UpgradeKeeper.SetUpgradeHandler("v10", - func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - // transfer module consensus version has been bumped to 2 - return app.mm.RunMigrations(ctx, cfg, fromVM) - }) -} - -// GetMaccPerms returns a copy of the module account permissions -func GetMaccPerms() map[string][]string { - dupMaccPerms := make(map[string][]string) - for k, v := range maccPerms { - dupMaccPerms[k] = v - } - return dupMaccPerms -} - -// initParamsKeeper init params keeper and its subspaces -func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper { - paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) - - paramsKeeper.Subspace(authtypes.ModuleName) - paramsKeeper.Subspace(banktypes.ModuleName) - paramsKeeper.Subspace(stakingtypes.ModuleName) - paramsKeeper.Subspace(minttypes.ModuleName) - paramsKeeper.Subspace(distrtypes.ModuleName) - paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) - paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(ibctransfertypes.ModuleName) - paramsKeeper.Subspace(ibchost.ModuleName) - paramsKeeper.Subspace(icahosttypes.SubModuleName) - paramsKeeper.Subspace(wasm.ModuleName) - - return paramsKeeper -} - -// SimulationManager implements the SimulationApp interface -func (app *App) SimulationManager() *module.SimulationManager { - return app.sm -} - -func (App) TxConfig() client.TxConfig { return nil } -func (App) AutoCliOpts() autocli.AppOptions { return autocli.AppOptions{} } - -// GetKey returns the KVStoreKey for the provided store key. -func (App) GetKey(storeKey string) *storetypes.KVStoreKey { - sk := app.UnsafeFindStoreKey(storeKey) - kvStoreKey, ok := sk.(*storetypes.KVStoreKey) - if !ok { - return nil - } - return kvStoreKey -} - -// GetMemKey returns the MemoryStoreKey for the provided store key. -func (App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { - key, ok := app.UnsafeFindStoreKey(storeKey).(*storetypes.MemoryStoreKey) - if !ok { - return nil - } - - return key -} - -// kvStoreKeys returns all the kv store keys registered inside App. -func (App) kvStoreKeys() map[string]*storetypes.KVStoreKey { - keys := make(map[string]*storetypes.KVStoreKey) - for _, k := range app.GetStoreKeys() { - if kv, ok := k.(*storetypes.KVStoreKey); ok { - keys[kv.Name()] = kv - } - } - - return keys -} - -// GetSubspace returns a param subspace for a given module name. -func (App) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - -// SimulationManager implements the SimulationApp interface -func (App) SimulationManager() *module.SimulationManager { - return app.sm -} - -// RegisterAPIRoutes registers all application module routes with the provided -// API server. -func (App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { - app.App.RegisterAPIRoutes(apiSvr, apiConfig) - // register swagger API in app.go so that other applications can override easily - if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil { - panic(err) - } -} diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/juno/go.mod b/ignite/pkg/cosmosanalysis/app/testdata/modules/juno/go.mod deleted file mode 100644 index 4e54576720..0000000000 --- a/ignite/pkg/cosmosanalysis/app/testdata/modules/juno/go.mod +++ /dev/null @@ -1,33 +0,0 @@ -module github.com/CosmosContracts/juno/v18 - -go 1.23 - -require ( - cosmossdk.io/api v0.3.1 - cosmossdk.io/errors v1.0.0 - cosmossdk.io/log v1.2.1 - cosmossdk.io/math v1.1.2 - cosmossdk.io/tools/rosetta v0.2.1 - github.com/CosmWasm/wasmd v0.45.0 - github.com/CosmWasm/wasmvm v1.5.0 - github.com/cometbft/cometbft v0.37.2 - github.com/cometbft/cometbft-db v0.8.0 - github.com/cosmos/cosmos-sdk v0.47.5 - github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.1 - github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0 - github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b79 - github.com/cosmos/ibc-go/v7 v7.3.1 - github.com/golang/protobuf v1.5.3 - github.com/gorilla/mux v1.8.0 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/prometheus/client_golang v1.16.0 - github.com/skip-mev/pob v1.0.4 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.16.0 - github.com/stretchr/testify v1.8.4 - google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 - google.golang.org/grpc v1.58.3 - gopkg.in/yaml.v2 v2.4.0 -) diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/runtime/app.go b/ignite/pkg/cosmosanalysis/app/testdata/modules/runtime/app.go index 8684282186..cfeaca69a6 100644 --- a/ignite/pkg/cosmosanalysis/app/testdata/modules/runtime/app.go +++ b/ignite/pkg/cosmosanalysis/app/testdata/modules/runtime/app.go @@ -3,6 +3,15 @@ package app import ( "cosmossdk.io/api/tendermint/abci" "cosmossdk.io/client/v2/autocli" + "cosmossdk.io/x/bank" + bankkeeper "cosmossdk.io/x/bank/keeper" + "cosmossdk.io/x/gov" + govclient "cosmossdk.io/x/gov/client" + govkeeper "cosmossdk.io/x/gov/keeper" + paramsclient "cosmossdk.io/x/params/client" + paramstypes "cosmossdk.io/x/params/types" + "cosmossdk.io/x/staking" + stakingkeeper "cosmossdk.io/x/staking/keeper" "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" @@ -14,15 +23,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - "github.com/cosmos/cosmos-sdk/x/bank" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/cosmos/cosmos-sdk/x/gov" - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/cosmos/cosmos-sdk/x/staking" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/gogo/protobuf/codec" foomodule "github.com/username/test/x/foo" fookeeper "github.com/username/test/x/foo/keeper" diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/single_app/app.go b/ignite/pkg/cosmosanalysis/app/testdata/modules/single_app/app.go index 860e384889..4ec580a96d 100644 --- a/ignite/pkg/cosmosanalysis/app/testdata/modules/single_app/app.go +++ b/ignite/pkg/cosmosanalysis/app/testdata/modules/single_app/app.go @@ -1,6 +1,10 @@ package app import ( + bankkeeper "cosmossdk.io/x/bank/keeper" + govkeeper "cosmossdk.io/x/gov/keeper" + paramstypes "cosmossdk.io/x/params/types" + stakingkeeper "cosmossdk.io/x/staking/keeper" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" @@ -9,10 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" "github.com/gogo/protobuf/codec" abci "github.com/tendermint/tendermint/abci/types" fookeeper "github.com/username/test/x/foo/keeper" @@ -24,6 +25,7 @@ type Foo struct { StakingKeeper stakingkeeper.Keeper GovKeeper govkeeper.Keeper FooKeeper fookeeper.Keeper + ibckeeper ibckeeper.Keeper } func (Foo) Name() string { diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/spn/app.go b/ignite/pkg/cosmosanalysis/app/testdata/modules/spn/app.go deleted file mode 100644 index 0da49006f5..0000000000 --- a/ignite/pkg/cosmosanalysis/app/testdata/modules/spn/app.go +++ /dev/null @@ -1,1104 +0,0 @@ -package app - -import ( - "io" - "net/http" - "os" - "path/filepath" - - "github.com/cosmos/cosmos-sdk/server" - - "cosmossdk.io/client/v2/autocli" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/server/api" - "github.com/cosmos/cosmos-sdk/server/config" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/cosmos-sdk/x/auth/ante" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - "github.com/cosmos/cosmos-sdk/x/authz" - authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" - "github.com/cosmos/cosmos-sdk/x/bank" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - distr "github.com/cosmos/cosmos-sdk/x/distribution" - distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/cosmos/cosmos-sdk/x/gov" - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/cosmos-sdk/x/params" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - "github.com/cosmos/cosmos-sdk/x/slashing" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/ibc-go/v6/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v6/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v6/modules/core" - ibcclient "github.com/cosmos/ibc-go/v6/modules/core/02-client" - ibcporttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v6/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper" - "github.com/spf13/cast" - abci "github.com/tendermint/tendermint/abci/types" - tmjson "github.com/tendermint/tendermint/libs/json" - "github.com/tendermint/tendermint/libs/log" - tmos "github.com/tendermint/tendermint/libs/os" - dbm "github.com/tendermint/tm-db" - - "github.com/ignite/modules/x/claim" - claimkeeper "github.com/ignite/modules/x/claim/keeper" - claimtypes "github.com/ignite/modules/x/claim/types" - "github.com/ignite/modules/x/mint" - mintkeeper "github.com/ignite/modules/x/mint/keeper" - minttypes "github.com/ignite/modules/x/mint/types" - "github.com/tendermint/fundraising/x/fundraising" - fundraisingkeeper "github.com/tendermint/fundraising/x/fundraising/keeper" - fundraisingtypes "github.com/tendermint/fundraising/x/fundraising/types" - - "github.com/tendermint/spn/cmd" - "github.com/tendermint/spn/docs" - spntypes "github.com/tendermint/spn/pkg/types" - "github.com/tendermint/spn/x/campaign" - campaignkeeper "github.com/tendermint/spn/x/campaign/keeper" - campaigntypes "github.com/tendermint/spn/x/campaign/types" - "github.com/tendermint/spn/x/launch" - launchkeeper "github.com/tendermint/spn/x/launch/keeper" - launchtypes "github.com/tendermint/spn/x/launch/types" - "github.com/tendermint/spn/x/monitoringc" - monitoringckeeper "github.com/tendermint/spn/x/monitoringc/keeper" - monitoringctypes "github.com/tendermint/spn/x/monitoringc/types" - "github.com/tendermint/spn/x/monitoringp" - monitoringpkeeper "github.com/tendermint/spn/x/monitoringp/keeper" - monitoringptypes "github.com/tendermint/spn/x/monitoringp/types" - "github.com/tendermint/spn/x/participation" - participationkeeper "github.com/tendermint/spn/x/participation/keeper" - participationtypes "github.com/tendermint/spn/x/participation/types" - "github.com/tendermint/spn/x/profile" - profilekeeper "github.com/tendermint/spn/x/profile/keeper" - profiletypes "github.com/tendermint/spn/x/profile/types" - "github.com/tendermint/spn/x/reward" - rewardkeeper "github.com/tendermint/spn/x/reward/keeper" - rewardtypes "github.com/tendermint/spn/x/reward/types" -) - -const ( - // missionIDStaking is the mission ID for staking mission to claim airdrop - missionIDStaking = 1 - - // missionIDVoting is the mission ID for voting mission to claim airdrop - missionIDVoting = 2 -) - -// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals - -func getGovProposalHandlers() []govclient.ProposalHandler { - var govProposalHandlers []govclient.ProposalHandler - // this line is used by starport scaffolding # stargate/app/govProposalHandlers - - govProposalHandlers = append(govProposalHandlers, - paramsclient.ProposalHandler, - distrclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - // this line is used by starport scaffolding # stargate/app/govProposalHandler - ) - - return govProposalHandlers -} - -var ( - // DefaultNodeHome default home directories for the application daemon - DefaultNodeHome string - - // ModuleBasics defines the module BasicManager is in charge of setting up basic, - // non-dependant module elements, such as codec registration - // and genesis verification. - ModuleBasics = module.NewBasicManager( - auth.AppModuleBasic{}, - genutil.AppModuleBasic{}, - bank.AppModuleBasic{}, - capability.AppModuleBasic{}, - staking.AppModuleBasic{}, - mint.AppModuleBasic{}, - distr.AppModuleBasic{}, - gov.NewAppModuleBasic(getGovProposalHandlers()), - params.AppModuleBasic{}, - crisis.AppModuleBasic{}, - slashing.AppModuleBasic{}, - feegrantmodule.AppModuleBasic{}, - authzmodule.AppModuleBasic{}, - ibc.AppModuleBasic{}, - upgrade.AppModuleBasic{}, - evidence.AppModuleBasic{}, - transfer.AppModuleBasic{}, - vesting.AppModuleBasic{}, - participation.AppModuleBasic{}, - claim.AppModuleBasic{}, - // this line is used by starport scaffolding # stargate/app/moduleBasic - profile.AppModuleBasic{}, - launch.AppModuleBasic{}, - campaign.AppModuleBasic{}, - monitoringc.AppModuleBasic{}, - monitoringp.AppModuleBasic{}, - reward.AppModuleBasic{}, - fundraising.AppModuleBasic{}, - ) - - // module account permissions - maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - campaigntypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - rewardtypes.ModuleName: nil, - fundraisingtypes.ModuleName: nil, - monitoringctypes.ModuleName: nil, - monitoringptypes.ModuleName: nil, - claimtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - // this line is used by starport scaffolding # stargate/app/maccPerms - } -) - -var ( - _ cmd.App = (*App)(nil) - _ servertypes.Application = (*App)(nil) - _ simapp.App = (*App)(nil) -) - -func init() { - userHomeDir, err := os.UserHomeDir() - if err != nil { - panic(err) - } - - DefaultNodeHome = filepath.Join(userHomeDir, "."+spntypes.Name) -} - -// App 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. -type App struct { - *baseapp.BaseApp - - cdc *codec.LegacyAmino - appCodec codec.Codec - interfaceRegistry types.InterfaceRegistry - - invCheckPeriod uint - - // keys to access the substores - keys map[string]*storetypes.KVStoreKey - tkeys map[string]*storetypes.TransientStoreKey - memKeys map[string]*storetypes.MemoryStoreKey - - // keepers - AuthKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - MintKeeper mintkeeper.Keeper - DistrKeeper distrkeeper.Keeper - GovKeeper govkeeper.Keeper - CrisisKeeper crisiskeeper.Keeper - UpgradeKeeper upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - EvidenceKeeper evidencekeeper.Keeper - TransferKeeper ibctransferkeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - AuthzKeeper authzkeeper.Keeper - FundraisingKeeper fundraisingkeeper.Keeper - - // make scoped keepers public for test purposes - ScopedIBCKeeper capabilitykeeper.ScopedKeeper - ScopedTransferKeeper capabilitykeeper.ScopedKeeper - - ScopedMonitoringcKeeper capabilitykeeper.ScopedKeeper - - ProfileKeeper profilekeeper.Keeper - LaunchKeeper launchkeeper.Keeper - CampaignKeeper campaignkeeper.Keeper - MonitoringcKeeper monitoringckeeper.Keeper - MonitoringpKeeper monitoringpkeeper.Keeper - RewardKeeper rewardkeeper.Keeper - ParticipationKeeper participationkeeper.Keeper - ClaimKeeper claimkeeper.Keeper - // this line is used by starport scaffolding # stargate/app/keeperDeclaration - - transferModule transfer.AppModule - - // the module manager - mm *module.Manager - - // simulation manager - sm *module.SimulationManager -} - -// New returns a reference to an initialized spn app. -func New( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - loadLatest bool, - skipUpgradeHeights map[int64]bool, - homePath string, - invCheckPeriod uint, - encodingConfig cmd.EncodingConfig, - appOpts servertypes.AppOptions, - baseAppOptions ...func(*baseapp.BaseApp), -) cmd.App { - appCodec := encodingConfig.Marshaler - cdc := encodingConfig.Amino - interfaceRegistry := encodingConfig.InterfaceRegistry - - bApp := baseapp.NewBaseApp(spntypes.Name, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) - bApp.SetCommitMultiStoreTracer(traceStore) - bApp.SetVersion(version.Version) - bApp.SetInterfaceRegistry(interfaceRegistry) - - keys := sdk.NewKVStoreKeys( - authtypes.StoreKey, - banktypes.StoreKey, - stakingtypes.StoreKey, - minttypes.StoreKey, - distrtypes.StoreKey, - slashingtypes.StoreKey, - govtypes.StoreKey, - paramstypes.StoreKey, - ibchost.StoreKey, - upgradetypes.StoreKey, - feegrant.StoreKey, - authzkeeper.StoreKey, - evidencetypes.StoreKey, - ibctransfertypes.StoreKey, - capabilitytypes.StoreKey, - profiletypes.StoreKey, - launchtypes.StoreKey, - campaigntypes.StoreKey, - monitoringctypes.StoreKey, - monitoringptypes.StoreKey, - rewardtypes.StoreKey, - fundraisingtypes.StoreKey, - participationtypes.StoreKey, - claimtypes.StoreKey, - // this line is used by starport scaffolding # stargate/app/storeKey - ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) - - app := &App{ - BaseApp: bApp, - cdc: cdc, - appCodec: appCodec, - interfaceRegistry: interfaceRegistry, - invCheckPeriod: invCheckPeriod, - keys: keys, - tkeys: tkeys, - memKeys: memKeys, - } - - app.ParamsKeeper = initParamsKeeper( - appCodec, - cdc, - keys[paramstypes.StoreKey], - tkeys[paramstypes.TStoreKey], - ) - - // set the BaseApp's parameter store - bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())) - - // add capability keeper and ScopeToModule for ibc module - app.CapabilityKeeper = capabilitykeeper.NewKeeper( - appCodec, - keys[capabilitytypes.StoreKey], - memKeys[capabilitytypes.MemStoreKey], - ) - - // grant capabilities for the ibc and ibc-transfer modules - scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) - scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) - // this line is used by starport scaffolding # stargate/app/scopedKeeper - - // add keepers - app.AuthKeeper = authkeeper.NewAccountKeeper( - appCodec, - keys[authtypes.StoreKey], - app.GetSubspace(authtypes.ModuleName), - authtypes.ProtoBaseAccount, - maccPerms, - spntypes.AccountAddressPrefix, - ) - - app.AuthzKeeper = authzkeeper.NewKeeper( - keys[authzkeeper.StoreKey], - appCodec, - app.BaseApp.MsgServiceRouter(), - app.AuthKeeper, - ) - - app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, - keys[banktypes.StoreKey], - app.AuthKeeper, - app.GetSubspace(banktypes.ModuleName), - app.ModuleAccountAddrs(), - ) - - stakingKeeper := stakingkeeper.NewKeeper( - appCodec, - keys[stakingtypes.StoreKey], - app.AuthKeeper, - app.BankKeeper, - app.GetSubspace(stakingtypes.ModuleName), - ) - - app.DistrKeeper = distrkeeper.NewKeeper( - appCodec, - keys[distrtypes.StoreKey], - app.GetSubspace(distrtypes.ModuleName), - app.AuthKeeper, - app.BankKeeper, - &stakingKeeper, - authtypes.FeeCollectorName, - ) - app.MintKeeper = mintkeeper.NewKeeper( - appCodec, - keys[minttypes.StoreKey], - app.GetSubspace(minttypes.ModuleName), - &stakingKeeper, - app.AuthKeeper, - app.BankKeeper, - app.DistrKeeper, - authtypes.FeeCollectorName, - ) - app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, - keys[slashingtypes.StoreKey], - &stakingKeeper, - app.GetSubspace(slashingtypes.ModuleName), - ) - - app.CrisisKeeper = crisiskeeper.NewKeeper( - app.GetSubspace(crisistypes.ModuleName), - invCheckPeriod, app.BankKeeper, - authtypes.FeeCollectorName, - ) - - app.FeeGrantKeeper = feegrantkeeper.NewKeeper( - appCodec, - keys[feegrant.StoreKey], - app.AuthKeeper, - ) - - app.UpgradeKeeper = upgradekeeper.NewKeeper( - skipUpgradeHeights, - keys[upgradetypes.StoreKey], - appCodec, - homePath, - app.BaseApp, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - // ... other modules keepers - - // Create IBC Keeper - app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, - keys[ibchost.StoreKey], - app.GetSubspace(ibchost.ModuleName), - stakingKeeper, - app.UpgradeKeeper, - scopedIBCKeeper, - ) - - // register the proposal types - govRouter := govv1beta1.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - - // Create Transfer Keepers - app.TransferKeeper = ibctransferkeeper.NewKeeper( - appCodec, - keys[ibctransfertypes.StoreKey], - app.GetSubspace(ibctransfertypes.ModuleName), - app.IBCKeeper.ChannelKeeper, - app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, - app.AuthKeeper, - app.BankKeeper, - scopedTransferKeeper, - ) - app.transferModule = transfer.NewAppModule(app.TransferKeeper) - transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) - - // Create evidence Keeper for to register the IBC light client misbehaviour evidence route - evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, - keys[evidencetypes.StoreKey], - &stakingKeeper, - app.SlashingKeeper, - ) - // If evidence needs to be handled for the app, set routes in router here and seal - app.EvidenceKeeper = *evidenceKeeper - - govConfig := govtypes.DefaultConfig() - app.GovKeeper = govkeeper.NewKeeper( - appCodec, - keys[govtypes.StoreKey], - app.GetSubspace(govtypes.ModuleName), - app.AuthKeeper, - app.BankKeeper, - &stakingKeeper, - govRouter, - app.MsgServiceRouter(), - govConfig, - ) - - app.FundraisingKeeper = fundraisingkeeper.NewKeeper( - appCodec, - keys[fundraisingtypes.StoreKey], - keys[fundraisingtypes.MemStoreKey], - app.GetSubspace(fundraisingtypes.ModuleName), - app.AuthKeeper, - app.BankKeeper, - app.DistrKeeper, - ) - - app.ProfileKeeper = *profilekeeper.NewKeeper( - appCodec, - keys[profiletypes.StoreKey], - keys[profiletypes.MemStoreKey], - ) - - app.LaunchKeeper = *launchkeeper.NewKeeper( - appCodec, - keys[launchtypes.StoreKey], - keys[launchtypes.MemStoreKey], - app.GetSubspace(launchtypes.ModuleName), - app.DistrKeeper, - app.ProfileKeeper, - ) - - app.RewardKeeper = *rewardkeeper.NewKeeper( - appCodec, - keys[rewardtypes.StoreKey], - keys[rewardtypes.MemStoreKey], - app.GetSubspace(rewardtypes.ModuleName), - app.AuthKeeper, - app.BankKeeper, - app.ProfileKeeper, - app.LaunchKeeper, - ) - - campaignKeeper := campaignkeeper.NewKeeper( - appCodec, - keys[campaigntypes.StoreKey], - keys[campaigntypes.MemStoreKey], - app.GetSubspace(campaigntypes.ModuleName), - &app.LaunchKeeper, - app.BankKeeper, - app.DistrKeeper, - app.ProfileKeeper, - ) - app.CampaignKeeper = *campaignKeeper - app.LaunchKeeper.SetCampaignKeeper(campaignKeeper) - - scopedMonitoringcKeeper := app.CapabilityKeeper.ScopeToModule(monitoringctypes.ModuleName) - app.ScopedMonitoringcKeeper = scopedMonitoringcKeeper - app.MonitoringcKeeper = *monitoringckeeper.NewKeeper( - appCodec, - keys[monitoringctypes.StoreKey], - keys[monitoringctypes.MemStoreKey], - app.GetSubspace(monitoringctypes.ModuleName), - app.IBCKeeper.ClientKeeper, - app.IBCKeeper.ConnectionKeeper, - app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, - scopedMonitoringcKeeper, - app.LaunchKeeper, - app.RewardKeeper, - ) - app.LaunchKeeper.SetMonitoringcKeeper(app.MonitoringcKeeper) - monitoringcModule := monitoringc.NewAppModule(appCodec, app.MonitoringcKeeper, app.AuthKeeper, app.BankKeeper) - - scopedMonitoringKeeper := app.CapabilityKeeper.ScopeToModule(monitoringptypes.ModuleName) - app.MonitoringpKeeper = *monitoringpkeeper.NewKeeper( - appCodec, - keys[monitoringptypes.StoreKey], - keys[monitoringptypes.MemStoreKey], - app.GetSubspace(monitoringptypes.ModuleName), - stakingKeeper, - app.IBCKeeper.ClientKeeper, - app.IBCKeeper.ConnectionKeeper, - app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, - scopedMonitoringKeeper, - ) - monitoringpModule := monitoringp.NewAppModule(appCodec, app.MonitoringpKeeper) - - app.ParticipationKeeper = *participationkeeper.NewKeeper( - appCodec, - keys[participationtypes.StoreKey], - keys[participationtypes.MemStoreKey], - app.GetSubspace(participationtypes.ModuleName), - app.FundraisingKeeper, - stakingKeeper, - ) - - app.ClaimKeeper = *claimkeeper.NewKeeper( - appCodec, - keys[claimtypes.StoreKey], - keys[claimtypes.MemStoreKey], - app.GetSubspace(claimtypes.ModuleName), - app.AuthKeeper, - app.DistrKeeper, - app.BankKeeper, - ) - - // set fundraising hooks - app.FundraisingKeeper = *app.FundraisingKeeper.SetHooks( - app.CampaignKeeper.CampaignAuctionEventHooks(), - ) - - // this line is used by starport scaffolding # stargate/app/keeperDefinition - - // register the staking hooks - // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks - app.StakingKeeper = *stakingKeeper.SetHooks( - stakingtypes.NewMultiStakingHooks( - app.DistrKeeper.Hooks(), - app.SlashingKeeper.Hooks(), - app.ClaimKeeper.NewMissionDelegationHooks(missionIDStaking), - ), - ) - - // register the gov hooks - app.GovKeeper = *app.GovKeeper.SetHooks( - govtypes.NewMultiGovHooks( - app.ClaimKeeper.NewMissionVoteHooks(missionIDVoting), - ), - ) - - // Create static IBC router, add transfer route, then set and seal it - ibcRouter := ibcporttypes.NewRouter() - ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule) - ibcRouter.AddRoute(monitoringctypes.ModuleName, monitoringcModule) - ibcRouter.AddRoute(monitoringptypes.ModuleName, monitoringpModule) - // this line is used by starport scaffolding # ibc/app/router - app.IBCKeeper.SetRouter(ibcRouter) - - /**** Module Options ****/ - - // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment - // we prefer to be more strict in what arguments the modules expect. - skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) - - // NOTE: Any module instantiated in the module manager that is later modified - // must be passed by reference here. - - app.mm = module.NewManager( - genutil.NewAppModule( - app.AuthKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, - encodingConfig.TxConfig, - ), - auth.NewAppModule(appCodec, app.AuthKeeper, nil), - vesting.NewAppModule(app.AuthKeeper, app.BankKeeper), - bank.NewAppModule(appCodec, app.BankKeeper, app.AuthKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - feegrantmodule.NewAppModule(appCodec, app.AuthKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AuthKeeper, app.BankKeeper, app.interfaceRegistry), - crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), - gov.NewAppModule(appCodec, app.GovKeeper, app.AuthKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AuthKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AuthKeeper, app.BankKeeper, app.StakingKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AuthKeeper, app.BankKeeper, app.StakingKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AuthKeeper, app.BankKeeper), - upgrade.NewAppModule(app.UpgradeKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - ibc.NewAppModule(app.IBCKeeper), - params.NewAppModule(app.ParamsKeeper), - app.transferModule, - profile.NewAppModule(appCodec, app.ProfileKeeper, app.AuthKeeper, app.BankKeeper), - launch.NewAppModule(appCodec, app.LaunchKeeper, app.AuthKeeper, app.BankKeeper), - campaign.NewAppModule(appCodec, app.CampaignKeeper, app.AuthKeeper, app.BankKeeper, app.ProfileKeeper), - monitoringcModule, - monitoringpModule, - reward.NewAppModule(appCodec, app.RewardKeeper, app.AuthKeeper, app.BankKeeper), - fundraising.NewAppModule(appCodec, app.FundraisingKeeper, app.AuthKeeper, app.BankKeeper, app.DistrKeeper), - participation.NewAppModule(appCodec, app.ParticipationKeeper, app.AuthKeeper, app.BankKeeper, app.FundraisingKeeper), - claim.NewAppModule(appCodec, app.ClaimKeeper, app.AuthKeeper, app.BankKeeper), - // this line is used by starport scaffolding # stargate/app/appModule - ) - - // During begin block slashing happens after distr.BeginBlocker so that - // there is nothing left over in the validator fee pool, so as to keep the - // CanWithdrawInvariant invariant. - // NOTE: staking module is required if HistoricalEntries param > 0 - app.mm.SetOrderBeginBlockers( - upgradetypes.ModuleName, - capabilitytypes.ModuleName, - minttypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - evidencetypes.ModuleName, - claimtypes.ModuleName, - stakingtypes.ModuleName, - vestingtypes.ModuleName, - ibchost.ModuleName, - ibctransfertypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - govtypes.ModuleName, - crisistypes.ModuleName, - genutiltypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - paramstypes.ModuleName, - profiletypes.ModuleName, - fundraisingtypes.ModuleName, - rewardtypes.ModuleName, - campaigntypes.ModuleName, - monitoringctypes.ModuleName, - monitoringptypes.ModuleName, - participationtypes.ModuleName, - launchtypes.ModuleName, - ) - - app.mm.SetOrderEndBlockers( - fundraisingtypes.ModuleName, - crisistypes.ModuleName, - govtypes.ModuleName, - claimtypes.ModuleName, - stakingtypes.ModuleName, - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - vestingtypes.ModuleName, - minttypes.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - ibchost.ModuleName, - ibctransfertypes.ModuleName, - profiletypes.ModuleName, - rewardtypes.ModuleName, - campaigntypes.ModuleName, - monitoringctypes.ModuleName, - monitoringptypes.ModuleName, - participationtypes.ModuleName, - launchtypes.ModuleName, - ) - - // NOTE: The genutils module must occur after staking so that pools are - // properly initialized with tokens from genesis accounts. - // NOTE: Capability module must occur first so that it can initialize any capabilities - // so that other modules that want to create or claim capabilities afterwards in InitChain - // can do so safely. - app.mm.SetOrderInitGenesis( - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - claimtypes.ModuleName, - stakingtypes.ModuleName, - vestingtypes.ModuleName, - slashingtypes.ModuleName, - govtypes.ModuleName, - minttypes.ModuleName, - crisistypes.ModuleName, - ibchost.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - ibctransfertypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - profiletypes.ModuleName, - launchtypes.ModuleName, - campaigntypes.ModuleName, - monitoringctypes.ModuleName, - monitoringptypes.ModuleName, - rewardtypes.ModuleName, - fundraisingtypes.ModuleName, - participationtypes.ModuleName, - // this line is used by starport scaffolding # stargate/app/initGenesis - ) - - app.mm.RegisterInvariants(&app.CrisisKeeper) - app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) - app.mm.RegisterServices(module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())) - - // create the simulation manager and define the order of the modules for deterministic simulations - app.sm = module.NewSimulationManager( - auth.NewAppModule(appCodec, app.AuthKeeper, authsims.RandomGenesisAccounts), - bank.NewAppModule(appCodec, app.BankKeeper, app.AuthKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - feegrantmodule.NewAppModule(appCodec, app.AuthKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AuthKeeper, app.BankKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, app.GovKeeper, app.AuthKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AuthKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AuthKeeper, app.BankKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AuthKeeper, app.BankKeeper, app.StakingKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AuthKeeper, app.BankKeeper, app.StakingKeeper), - params.NewAppModule(app.ParamsKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - ibc.NewAppModule(app.IBCKeeper), - app.transferModule, - profile.NewAppModule(appCodec, app.ProfileKeeper, app.AuthKeeper, app.BankKeeper), - launch.NewAppModule(appCodec, app.LaunchKeeper, app.AuthKeeper, app.BankKeeper), - campaign.NewAppModule(appCodec, app.CampaignKeeper, app.AuthKeeper, app.BankKeeper, app.ProfileKeeper), - reward.NewAppModule(appCodec, app.RewardKeeper, app.AuthKeeper, app.BankKeeper), - participation.NewAppModule(appCodec, app.ParticipationKeeper, app.AuthKeeper, app.BankKeeper, app.FundraisingKeeper), - fundraising.NewAppModule(appCodec, app.FundraisingKeeper, app.AuthKeeper, app.BankKeeper, app.DistrKeeper), - monitoringpModule, - claim.NewAppModule(appCodec, app.ClaimKeeper, app.AuthKeeper, app.BankKeeper), - ) - app.sm.RegisterStoreDecoders() - - // initialize stores - app.MountKVStores(keys) - app.MountTransientStores(tkeys) - app.MountMemoryStores(memKeys) - - // initialize BaseApp - app.SetInitChainer(app.InitChainer) - app.SetBeginBlocker(app.BeginBlocker) - - anteHandler, err := ante.NewAnteHandler( - ante.HandlerOptions{ - AccountKeeper: app.AuthKeeper, - BankKeeper: app.BankKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - FeegrantKeeper: app.FeeGrantKeeper, - SigGasConsumer: ante.DefaultSigVerificationGasConsumer, - }, - ) - if err != nil { - panic(err) - } - - app.SetAnteHandler(anteHandler) - app.SetEndBlocker(app.EndBlocker) - - if loadLatest { - if err := app.LoadLatestVersion(); err != nil { - tmos.Exit(err.Error()) - } - } - - app.ScopedIBCKeeper = scopedIBCKeeper - app.ScopedTransferKeeper = scopedTransferKeeper - // this line is used by starport scaffolding # stargate/app/beforeInitReturn - - return app -} - -// Name returns the name of the App -func (app *App) Name() string { return app.BaseApp.Name() } - -// GetBaseApp returns the base app of the application -func (app App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp } - -// BeginBlocker application updates every begin block -func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) -} - -// EndBlocker application updates every end block -func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.mm.EndBlock(ctx, req) -} - -// InitChainer application update at chain initialization -func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { - var genesisState GenesisState - if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { - panic(err) - } - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) -} - -// LoadHeight loads a particular height -func (app *App) LoadHeight(height int64) error { - return app.LoadVersion(height) -} - -// ModuleAccountAddrs returns all the app's module account addresses. -func (app *App) ModuleAccountAddrs() map[string]bool { - modAccAddrs := make(map[string]bool) - for acc := range maccPerms { - modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true - } - - return modAccAddrs -} - -// LegacyAmino returns SimApp's amino codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *App) LegacyAmino() *codec.LegacyAmino { - return app.cdc -} - -// AppCodec returns spn's app codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *App) AppCodec() codec.Codec { - return app.appCodec -} - -// InterfaceRegistry returns spn's InterfaceRegistry -func (app *App) InterfaceRegistry() types.InterfaceRegistry { - return app.interfaceRegistry -} - -// GetKey returns the KVStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetKey(storeKey string) *storetypes.KVStoreKey { - return app.keys[storeKey] -} - -// GetTKey returns the TransientStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetTKey(storeKey string) *storetypes.TransientStoreKey { - return app.tkeys[storeKey] -} - -// GetMemKey returns the MemStoreKey for the provided mem key. -// -// NOTE: This is solely used for testing purposes. -func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { - return app.memKeys[storeKey] -} - -// GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - -// RegisterAPIRoutes registers all application module routes with the provided -// API server. -func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { - clientCtx := apiSvr.ClientCtx - // Register new tx routes from grpc-gateway. - authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // Register grpc-gateway routes for all modules. - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // register app's OpenAPI routes. - apiSvr.Router.Handle("/static/openapi.yml", http.FileServer(http.FS(docs.Docs))) - // apiSvr.Router.HandleFunc("/", openapiconsole.Handler(spntypes.Name, "/static/openapi.yml")) -} - -// RegisterTxService implements the Application.RegisterTxService method. -func (app *App) RegisterTxService(clientCtx client.Context) { - authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) -} - -// RegisterTendermintService implements the Application.RegisterTendermintService method. -func (app *App) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( - clientCtx, - app.BaseApp.GRPCQueryRouter(), - app.interfaceRegistry, - app.Query, - ) -} - -// GetMaccPerms returns a copy of the module account permissions -func GetMaccPerms() map[string][]string { - dupMaccPerms := make(map[string][]string) - for k, v := range maccPerms { - dupMaccPerms[k] = v - } - return dupMaccPerms -} - -// initParamsKeeper init params keeper and its subspaces -func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper { - paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) - - paramsKeeper.Subspace(authtypes.ModuleName) - paramsKeeper.Subspace(banktypes.ModuleName) - paramsKeeper.Subspace(stakingtypes.ModuleName) - paramsKeeper.Subspace(minttypes.ModuleName) - paramsKeeper.Subspace(distrtypes.ModuleName) - paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) - paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(ibctransfertypes.ModuleName) - paramsKeeper.Subspace(ibchost.ModuleName) - paramsKeeper.Subspace(profiletypes.ModuleName) - paramsKeeper.Subspace(launchtypes.ModuleName) - paramsKeeper.Subspace(campaigntypes.ModuleName) - paramsKeeper.Subspace(monitoringctypes.ModuleName) - paramsKeeper.Subspace(monitoringptypes.ModuleName) - paramsKeeper.Subspace(rewardtypes.ModuleName) - paramsKeeper.Subspace(fundraisingtypes.ModuleName) - paramsKeeper.Subspace(participationtypes.ModuleName) - paramsKeeper.Subspace(claimtypes.ModuleName) - // this line is used by starport scaffolding # stargate/app/paramSubspace - - return paramsKeeper -} - -// SimulationManager implements the SimulationApp interface -func (app *App) SimulationManager() *module.SimulationManager { - return app.sm -} - -func (app *App) InterfaceRegistry() codectypes.InterfaceRegistry { return nil } -func (app *App) TxConfig() client.TxConfig { return nil } -func (app *App) AutoCliOpts() autocli.AppOptions { return autocli.AppOptions{} } - -// GetKey returns the KVStoreKey for the provided store key. -func (app *App) GetKey(storeKey string) *storetypes.KVStoreKey { - sk := app.UnsafeFindStoreKey(storeKey) - kvStoreKey, ok := sk.(*storetypes.KVStoreKey) - if !ok { - return nil - } - return kvStoreKey -} - -// GetMemKey returns the MemoryStoreKey for the provided store key. -func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { - key, ok := app.UnsafeFindStoreKey(storeKey).(*storetypes.MemoryStoreKey) - if !ok { - return nil - } - - return key -} - -// kvStoreKeys returns all the kv store keys registered inside App. -func (app *App) kvStoreKeys() map[string]*storetypes.KVStoreKey { - keys := make(map[string]*storetypes.KVStoreKey) - for _, k := range app.GetStoreKeys() { - if kv, ok := k.(*storetypes.KVStoreKey); ok { - keys[kv.Name()] = kv - } - } - - return keys -} - -// GetSubspace returns a param subspace for a given module name. -func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - -// SimulationManager implements the SimulationApp interface -func (app *App) SimulationManager() *module.SimulationManager { - return app.sm -} - -// RegisterAPIRoutes registers all application module routes with the provided -// API server. -func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { - app.App.RegisterAPIRoutes(apiSvr, apiConfig) - // register swagger API in app.go so that other applications can override easily - if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil { - panic(err) - } -} - -// GetMaccPerms returns a copy of the module account permissions -// -// NOTE: This is solely to be used for testing purposes. -func GetMaccPerms() map[string][]string { - dup := make(map[string][]string) - for _, perms := range moduleAccPerms { - dup[perms.Account] = perms.Permissions - } - - return dup -} - -// BlockedAddresses returns all the app's blocked account addresses. -func BlockedAddresses() map[string]bool { - result := make(map[string]bool) - - if len(blockAccAddrs) > 0 { - for _, addr := range blockAccAddrs { - result[addr] = true - } - } else { - for addr := range GetMaccPerms() { - result[addr] = true - } - } - - return result -} diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/spn/go.mod b/ignite/pkg/cosmosanalysis/app/testdata/modules/spn/go.mod deleted file mode 100644 index ba50cdde55..0000000000 --- a/ignite/pkg/cosmosanalysis/app/testdata/modules/spn/go.mod +++ /dev/null @@ -1,343 +0,0 @@ -module github.com/tendermint/spn - -go 1.19 - -require ( - cosmossdk.io/api v0.3.1 - cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/math v1.0.1 - github.com/aws/smithy-go v1.8.0 - github.com/bufbuild/buf v1.32.1 - github.com/cometbft/cometbft v0.37.2 - github.com/cometbft/cometbft-db v0.8.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.2 - github.com/cosmos/cosmos-sdk v0.47.3 - github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-go/v7 v7.2.0 - github.com/gogo/protobuf v1.3.2 - github.com/golang/protobuf v1.5.4 - github.com/golangci/golangci-lint v1.50.1 - github.com/gorilla/mux v1.8.0 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 - github.com/ignite/modules v0.0.2 - github.com/pkg/errors v0.9.1 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.8.0 - github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.9.0 - github.com/tendermint/fundraising v0.4.1 - golang.org/x/tools v0.21.0 - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 - google.golang.org/grpc v1.64.0 - google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 - google.golang.org/protobuf v1.34.1 - gopkg.in/yaml.v2 v2.4.0 - mvdan.cc/gofumpt v0.5.0 -) - -replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - -require ( - 4d63.com/gochecknoglobals v0.1.0 // indirect - cloud.google.com/go v0.112.1 // indirect - cloud.google.com/go/compute v1.25.1 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.6 // indirect - cloud.google.com/go/storage v1.38.0 // indirect - cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/log v1.1.0 // indirect - cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721ff // indirect - cosmossdk.io/tools/rosetta v0.2.1 // indirect - filippo.io/edwards25519 v1.0.0 // indirect - github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.1 // indirect - github.com/Abirdcfly/dupword v0.0.7 // indirect - github.com/Antonboom/errname v0.1.7 // indirect - github.com/Antonboom/nilnil v0.1.1 // indirect - github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect - github.com/BurntSushi/toml v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect - github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect - github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect - github.com/Masterminds/semver v1.5.0 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/OpenPeeDeeP/depguard v1.1.1 // indirect - github.com/alexkohler/prealloc v1.0.0 // indirect - github.com/alingse/asasalint v0.0.11 // indirect - github.com/armon/go-metrics v0.4.1 // indirect - github.com/ashanbrown/forbidigo v1.3.0 // indirect - github.com/ashanbrown/makezero v1.1.1 // indirect - github.com/aws/aws-sdk-go v1.44.244 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect - github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/bkielbasa/cyclop v1.2.0 // indirect - github.com/blizzy78/varnamelen v0.8.0 // indirect - github.com/bombsimon/wsl/v3 v3.3.0 // indirect - github.com/breml/bidichk v0.2.3 // indirect - github.com/breml/errchkjson v0.3.0 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/bufbuild/connect-go v1.8.0 // indirect - github.com/bufbuild/connect-opentelemetry-go v0.3.0 // indirect - github.com/bufbuild/protocompile v0.13.1-0.20240510201809-752249dfc37f // indirect - github.com/butuzov/ireturn v0.1.1 // indirect - github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/charithe/durationcheck v0.0.9 // indirect - github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect - github.com/chzyer/readline v1.5.1 // indirect - github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect - github.com/confio/ics23/go v0.9.0 // indirect - github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect - github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.20.0 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect - github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect - github.com/creachadair/taskgroup v0.4.2 // indirect - github.com/curioswitch/go-reassign v0.2.0 // indirect - github.com/daixiang0/gci v0.8.1 // indirect - github.com/danieljoos/wincred v1.2.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect - github.com/denis-tingaikin/go-header v0.4.3 // indirect - github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect - github.com/dgraph-io/ristretto v0.1.1 // indirect - github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/docker/cli v26.1.2+incompatible // indirect - github.com/docker/distribution v2.8.3+incompatible // indirect - github.com/docker/docker v26.1.2+incompatible // indirect - github.com/docker/docker-credential-helpers v0.8.1 // indirect - github.com/docker/go-connections v0.5.0 // indirect - github.com/docker/go-units v0.5.0 // indirect - github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/esimonov/ifshort v1.0.4 // indirect - github.com/ettle/strcase v0.1.1 // indirect - github.com/fatih/color v1.15.0 // indirect - github.com/fatih/structtag v1.2.0 // indirect - github.com/felixge/fgprof v0.9.4 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/firefart/nonamedreturns v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/fzipp/gocyclo v0.6.0 // indirect - github.com/ghodss/yaml v1.0.0 // indirect - github.com/go-chi/chi/v5 v5.0.12 // indirect - github.com/go-critic/go-critic v0.6.5 // indirect - github.com/go-kit/kit v0.12.0 // indirect - github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-toolsmith/astcast v1.0.0 // indirect - github.com/go-toolsmith/astcopy v1.0.2 // indirect - github.com/go-toolsmith/astequal v1.0.3 // indirect - github.com/go-toolsmith/astfmt v1.0.0 // indirect - github.com/go-toolsmith/astp v1.0.0 // indirect - github.com/go-toolsmith/strparse v1.0.0 // indirect - github.com/go-toolsmith/typep v1.0.2 // indirect - github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b // indirect - github.com/gobwas/glob v0.2.3 // indirect - github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gofrs/flock v0.8.1 // indirect - github.com/gofrs/uuid/v5 v5.2.0 // indirect - github.com/gogo/googleapis v1.4.1 // indirect - github.com/golang/glog v1.2.0 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/mock v1.6.0 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect - github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect - github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect - github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 // indirect - github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect - github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect - github.com/golangci/misspell v0.3.5 // indirect - github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect - github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.6.0 // indirect - github.com/google/go-containerregistry v0.19.1 // indirect - github.com/google/orderedcode v0.0.1 // indirect - github.com/google/pprof v0.0.0-20240509144519-723abb6459b7 // indirect - github.com/google/s2a-go v0.1.7 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.2 // indirect - github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 // indirect - github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/gostaticanalysis/analysisutil v0.7.1 // indirect - github.com/gostaticanalysis/comment v1.4.2 // indirect - github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect - github.com/gostaticanalysis/nilerr v0.1.1 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect - github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.1 // indirect - github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-safetemp v1.0.0 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hdevalence/ed25519consensus v0.1.0 // indirect - github.com/hexops/gotextdiff v1.0.3 // indirect - github.com/huandu/skiplist v1.2.0 // indirect - github.com/improbable-eng/grpc-web v0.15.0 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 // indirect - github.com/jgautheron/goconst v1.5.1 // indirect - github.com/jingyugao/rowserrcheck v1.1.1 // indirect - github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/jmhodges/levigo v1.0.0 // indirect - github.com/julz/importas v0.1.0 // indirect - github.com/kisielk/errcheck v1.6.2 // indirect - github.com/kisielk/gotool v1.0.0 // indirect - github.com/kkHAIKE/contextcheck v1.1.3 // indirect - github.com/klauspost/compress v1.17.8 // indirect - github.com/klauspost/pgzip v1.2.6 // indirect - github.com/kulti/thelper v0.6.3 // indirect - github.com/kunwardeep/paralleltest v1.0.6 // indirect - github.com/kyoh86/exportloopref v0.1.8 // indirect - github.com/ldez/gomoddirectives v0.2.3 // indirect - github.com/ldez/tagliatelle v0.3.1 // indirect - github.com/leonklingele/grouper v1.1.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.7.16 // indirect - github.com/lufeee/execinquery v1.2.1 // indirect - github.com/magiconair/properties v1.8.7 // indirect - github.com/manifoldco/promptui v0.9.0 // indirect - github.com/maratori/testableexamples v1.0.0 // indirect - github.com/maratori/testpackage v1.1.0 // indirect - github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mbilski/exhaustivestruct v1.2.0 // indirect - github.com/mgechev/revive v1.2.4 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect - github.com/minio/highwayhash v1.0.2 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/moby/term v0.5.0 // indirect - github.com/moricho/tparallel v0.2.1 // indirect - github.com/morikuni/aec v1.0.0 // indirect - github.com/mtibben/percent v0.2.1 // indirect - github.com/nakabonne/nestif v0.3.1 // indirect - github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect - github.com/nishanths/exhaustive v0.8.3 // indirect - github.com/nishanths/predeclared v0.2.2 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect - github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - github.com/pkg/profile v1.7.0 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/polyfloyd/go-errorlint v1.0.5 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect - github.com/quasilyte/go-ruleguard v0.3.18 // indirect - github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f // indirect - github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 // indirect - github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect - github.com/rakyll/statik v0.1.7 // indirect - github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rs/cors v1.11.0 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/ryancurrah/gomodguard v1.2.4 // indirect - github.com/ryanrolds/sqlclosecheck v0.3.0 // indirect - github.com/sanposhiho/wastedassign/v2 v2.0.6 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/sashamelentyev/interfacebloat v1.1.0 // indirect - github.com/sashamelentyev/usestdlibvars v1.20.0 // indirect - github.com/securego/gosec/v2 v2.13.1 // indirect - github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect - github.com/sirupsen/logrus v1.9.3 // indirect - github.com/sivchari/containedctx v1.0.2 // indirect - github.com/sivchari/nosnakecase v1.7.0 // indirect - github.com/sivchari/tenv v1.7.0 // indirect - github.com/sonatard/noctx v0.0.1 // indirect - github.com/sourcegraph/go-diff v0.6.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect - github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect - github.com/stretchr/objx v0.5.2 // indirect - github.com/subosito/gotenv v1.4.2 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tdakkota/asciicheck v0.1.1 // indirect - github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tetafro/godot v1.4.11 // indirect - github.com/tetratelabs/wazero v1.2.1 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 // indirect - github.com/timonwong/loggercheck v0.9.3 // indirect - github.com/tomarrell/wrapcheck/v2 v2.7.0 // indirect - github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ulikunitz/xz v0.5.11 // indirect - github.com/ultraware/funlen v0.0.3 // indirect - github.com/ultraware/whitespace v0.0.5 // indirect - github.com/uudashr/gocognit v1.0.6 // indirect - github.com/vbatts/tar-split v0.11.5 // indirect - github.com/yagipy/maintidx v1.0.0 // indirect - github.com/yeya24/promlinter v0.2.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - gitlab.com/bosi/decorder v0.2.3 // indirect - go.etcd.io/bbolt v1.3.7 // indirect - go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/otel v1.24.0 // indirect - go.opentelemetry.io/otel/metric v1.24.0 // indirect - go.opentelemetry.io/otel/sdk v1.24.0 // indirect - go.opentelemetry.io/otel/trace v1.24.0 // indirect - go.uber.org/atomic v1.11.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.23.0 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect - google.golang.org/api v0.169.0 // indirect - google.golang.org/appengine v1.6.8 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect - honnef.co/go/tools v0.3.3 // indirect - mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect - mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect - mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 // indirect - nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.5.5 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect -) diff --git a/ignite/pkg/cosmosclient/cosmosclient.go b/ignite/pkg/cosmosclient/cosmosclient.go index e08c27bac3..d72403f78a 100644 --- a/ignite/pkg/cosmosclient/cosmosclient.go +++ b/ignite/pkg/cosmosclient/cosmosclient.go @@ -18,6 +18,7 @@ import ( "github.com/cosmos/gogoproto/proto" prototypes "github.com/cosmos/gogoproto/types" + "cosmossdk.io/core/transaction" banktypes "cosmossdk.io/x/bank/types" staking "cosmossdk.io/x/staking/types" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" @@ -84,7 +85,7 @@ type FaucetClient interface { // //go:generate mockery --srcpkg . --name Gasometer --filename gasometer.go --with-expecter type Gasometer interface { - CalculateGas(clientCtx gogogrpc.ClientConn, txf tx.Factory, msgs ...sdktypes.Msg) (*txtypes.SimulateResponse, uint64, error) + CalculateGas(clientCtx gogogrpc.ClientConn, txf tx.Factory, msgs ...transaction.Msg) (*txtypes.SimulateResponse, uint64, error) } // Signer allows to mock the tx.Sign func. @@ -544,7 +545,7 @@ func (c Client) lockBech32Prefix() (unlockFn func()) { return mconf.Unlock } -func (c Client) BroadcastTx(ctx context.Context, account cosmosaccount.Account, msgs ...sdktypes.Msg) (Response, error) { +func (c Client) BroadcastTx(ctx context.Context, account cosmosaccount.Account, msgs ...transaction.Msg) (Response, error) { txService, err := c.CreateTx(ctx, account, msgs...) if err != nil { return Response{}, err @@ -555,7 +556,7 @@ func (c Client) BroadcastTx(ctx context.Context, account cosmosaccount.Account, // CreateTxWithOptions creates a transaction with the given options. // Options override global client options. -func (c Client) CreateTxWithOptions(ctx context.Context, account cosmosaccount.Account, options TxOptions, msgs ...sdktypes.Msg) (TxService, error) { +func (c Client) CreateTxWithOptions(ctx context.Context, account cosmosaccount.Account, options TxOptions, msgs ...transaction.Msg) (TxService, error) { defer c.lockBech32Prefix()() if c.useFaucet && !c.generateOnly { @@ -636,7 +637,7 @@ func (c Client) CreateTxWithOptions(ctx context.Context, account cosmosaccount.A }, nil } -func (c Client) CreateTx(ctx context.Context, account cosmosaccount.Account, msgs ...sdktypes.Msg) (TxService, error) { +func (c Client) CreateTx(ctx context.Context, account cosmosaccount.Account, msgs ...transaction.Msg) (TxService, error) { return c.CreateTxWithOptions(ctx, account, TxOptions{}, msgs...) } diff --git a/ignite/pkg/cosmosclient/cosmosclient_test.go b/ignite/pkg/cosmosclient/cosmosclient_test.go index 3db293b6e1..333d4f27f1 100644 --- a/ignite/pkg/cosmosclient/cosmosclient_test.go +++ b/ignite/pkg/cosmosclient/cosmosclient_test.go @@ -10,6 +10,7 @@ import ( "testing" "time" + "cosmossdk.io/core/transaction" "cosmossdk.io/math" banktypes "cosmossdk.io/x/bank/types" "github.com/cometbft/cometbft/p2p" @@ -414,7 +415,7 @@ func TestClientCreateTx(t *testing.T) { tests := []struct { name string opts []cosmosclient.Option - msg sdktypes.Msg + msg transaction.Msg expectedJSONTx string expectedError string setup func(s suite) diff --git a/ignite/pkg/cosmosclient/gasometer.go b/ignite/pkg/cosmosclient/gasometer.go index bdf259b36c..7e80e1d5f0 100644 --- a/ignite/pkg/cosmosclient/gasometer.go +++ b/ignite/pkg/cosmosclient/gasometer.go @@ -1,16 +1,16 @@ package cosmosclient import ( + "cosmossdk.io/core/transaction" gogogrpc "github.com/cosmos/gogoproto/grpc" "github.com/cosmos/cosmos-sdk/client/tx" - sdktypes "github.com/cosmos/cosmos-sdk/types" txtypes "github.com/cosmos/cosmos-sdk/types/tx" ) // gasometer implements the Gasometer interface. type gasometer struct{} -func (gasometer) CalculateGas(clientCtx gogogrpc.ClientConn, txf tx.Factory, msgs ...sdktypes.Msg) (*txtypes.SimulateResponse, uint64, error) { +func (gasometer) CalculateGas(clientCtx gogogrpc.ClientConn, txf tx.Factory, msgs ...transaction.Msg) (*txtypes.SimulateResponse, uint64, error) { return tx.CalculateGas(clientCtx, txf, msgs...) } diff --git a/ignite/pkg/cosmosclient/mocks/account_retriever.go b/ignite/pkg/cosmosclient/mocks/account_retriever.go index a254433416..3a8ac632a6 100644 --- a/ignite/pkg/cosmosclient/mocks/account_retriever.go +++ b/ignite/pkg/cosmosclient/mocks/account_retriever.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks @@ -26,6 +26,10 @@ func (_m *AccountRetriever) EXPECT() *AccountRetriever_Expecter { func (_m *AccountRetriever) EnsureExists(clientCtx client.Context, addr types.AccAddress) error { ret := _m.Called(clientCtx, addr) + if len(ret) == 0 { + panic("no return value specified for EnsureExists") + } + var r0 error if rf, ok := ret.Get(0).(func(client.Context, types.AccAddress) error); ok { r0 = rf(clientCtx, addr) @@ -69,6 +73,10 @@ func (_c *AccountRetriever_EnsureExists_Call) RunAndReturn(run func(client.Conte func (_m *AccountRetriever) GetAccount(clientCtx client.Context, addr types.AccAddress) (client.Account, error) { ret := _m.Called(clientCtx, addr) + if len(ret) == 0 { + panic("no return value specified for GetAccount") + } + var r0 client.Account var r1 error if rf, ok := ret.Get(0).(func(client.Context, types.AccAddress) (client.Account, error)); ok { @@ -124,6 +132,10 @@ func (_c *AccountRetriever_GetAccount_Call) RunAndReturn(run func(client.Context func (_m *AccountRetriever) GetAccountNumberSequence(clientCtx client.Context, addr types.AccAddress) (uint64, uint64, error) { ret := _m.Called(clientCtx, addr) + if len(ret) == 0 { + panic("no return value specified for GetAccountNumberSequence") + } + var r0 uint64 var r1 uint64 var r2 error @@ -184,6 +196,10 @@ func (_c *AccountRetriever_GetAccountNumberSequence_Call) RunAndReturn(run func( func (_m *AccountRetriever) GetAccountWithHeight(clientCtx client.Context, addr types.AccAddress) (client.Account, int64, error) { ret := _m.Called(clientCtx, addr) + if len(ret) == 0 { + panic("no return value specified for GetAccountWithHeight") + } + var r0 client.Account var r1 int64 var r2 error diff --git a/ignite/pkg/cosmosclient/mocks/bank_query_client.go b/ignite/pkg/cosmosclient/mocks/bank_query_client.go index e276e05147..b7110f3928 100644 --- a/ignite/pkg/cosmosclient/mocks/bank_query_client.go +++ b/ignite/pkg/cosmosclient/mocks/bank_query_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks @@ -36,6 +36,10 @@ func (_m *BankQueryClient) AllBalances(ctx context.Context, in *types.QueryAllBa _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for AllBalances") + } + var r0 *types.QueryAllBalancesResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QueryAllBalancesRequest, ...grpc.CallOption) (*types.QueryAllBalancesResponse, error)); ok { @@ -106,6 +110,10 @@ func (_m *BankQueryClient) Balance(ctx context.Context, in *types.QueryBalanceRe _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Balance") + } + var r0 *types.QueryBalanceResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QueryBalanceRequest, ...grpc.CallOption) (*types.QueryBalanceResponse, error)); ok { @@ -176,6 +184,10 @@ func (_m *BankQueryClient) DenomMetadata(ctx context.Context, in *types.QueryDen _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for DenomMetadata") + } + var r0 *types.QueryDenomMetadataResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QueryDenomMetadataRequest, ...grpc.CallOption) (*types.QueryDenomMetadataResponse, error)); ok { @@ -246,6 +258,10 @@ func (_m *BankQueryClient) DenomMetadataByQueryString(ctx context.Context, in *t _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for DenomMetadataByQueryString") + } + var r0 *types.QueryDenomMetadataByQueryStringResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QueryDenomMetadataByQueryStringRequest, ...grpc.CallOption) (*types.QueryDenomMetadataByQueryStringResponse, error)); ok { @@ -316,6 +332,10 @@ func (_m *BankQueryClient) DenomOwners(ctx context.Context, in *types.QueryDenom _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for DenomOwners") + } + var r0 *types.QueryDenomOwnersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QueryDenomOwnersRequest, ...grpc.CallOption) (*types.QueryDenomOwnersResponse, error)); ok { @@ -386,6 +406,10 @@ func (_m *BankQueryClient) DenomOwnersByQuery(ctx context.Context, in *types.Que _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for DenomOwnersByQuery") + } + var r0 *types.QueryDenomOwnersByQueryResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QueryDenomOwnersByQueryRequest, ...grpc.CallOption) (*types.QueryDenomOwnersByQueryResponse, error)); ok { @@ -456,6 +480,10 @@ func (_m *BankQueryClient) DenomsMetadata(ctx context.Context, in *types.QueryDe _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for DenomsMetadata") + } + var r0 *types.QueryDenomsMetadataResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QueryDenomsMetadataRequest, ...grpc.CallOption) (*types.QueryDenomsMetadataResponse, error)); ok { @@ -526,6 +554,10 @@ func (_m *BankQueryClient) Params(ctx context.Context, in *types.QueryParamsRequ _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Params") + } + var r0 *types.QueryParamsResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QueryParamsRequest, ...grpc.CallOption) (*types.QueryParamsResponse, error)); ok { @@ -596,6 +628,10 @@ func (_m *BankQueryClient) SendEnabled(ctx context.Context, in *types.QuerySendE _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for SendEnabled") + } + var r0 *types.QuerySendEnabledResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySendEnabledRequest, ...grpc.CallOption) (*types.QuerySendEnabledResponse, error)); ok { @@ -666,6 +702,10 @@ func (_m *BankQueryClient) SpendableBalanceByDenom(ctx context.Context, in *type _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for SpendableBalanceByDenom") + } + var r0 *types.QuerySpendableBalanceByDenomResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySpendableBalanceByDenomRequest, ...grpc.CallOption) (*types.QuerySpendableBalanceByDenomResponse, error)); ok { @@ -736,6 +776,10 @@ func (_m *BankQueryClient) SpendableBalances(ctx context.Context, in *types.Quer _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for SpendableBalances") + } + var r0 *types.QuerySpendableBalancesResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySpendableBalancesRequest, ...grpc.CallOption) (*types.QuerySpendableBalancesResponse, error)); ok { @@ -806,6 +850,10 @@ func (_m *BankQueryClient) SupplyOf(ctx context.Context, in *types.QuerySupplyOf _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for SupplyOf") + } + var r0 *types.QuerySupplyOfResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySupplyOfRequest, ...grpc.CallOption) (*types.QuerySupplyOfResponse, error)); ok { @@ -876,6 +924,10 @@ func (_m *BankQueryClient) TotalSupply(ctx context.Context, in *types.QueryTotal _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for TotalSupply") + } + var r0 *types.QueryTotalSupplyResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.QueryTotalSupplyRequest, ...grpc.CallOption) (*types.QueryTotalSupplyResponse, error)); ok { diff --git a/ignite/pkg/cosmosclient/mocks/faucet_client.go b/ignite/pkg/cosmosclient/mocks/faucet_client.go index b9581815b9..a91170eb06 100644 --- a/ignite/pkg/cosmosclient/mocks/faucet_client.go +++ b/ignite/pkg/cosmosclient/mocks/faucet_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks @@ -27,6 +27,10 @@ func (_m *FaucetClient) EXPECT() *FaucetClient_Expecter { func (_m *FaucetClient) Transfer(_a0 context.Context, _a1 cosmosfaucet.TransferRequest) (cosmosfaucet.TransferResponse, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for Transfer") + } + var r0 cosmosfaucet.TransferResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, cosmosfaucet.TransferRequest) (cosmosfaucet.TransferResponse, error)); ok { diff --git a/ignite/pkg/cosmosclient/mocks/rpc_client.go b/ignite/pkg/cosmosclient/mocks/rpc_client.go index 8de5a98e44..8126a691b2 100644 --- a/ignite/pkg/cosmosclient/mocks/rpc_client.go +++ b/ignite/pkg/cosmosclient/mocks/rpc_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks @@ -30,17 +30,21 @@ func (_m *RPCClient) EXPECT() *RPCClient_Expecter { return &RPCClient_Expecter{mock: &_m.Mock} } -// ABCIInfo provides a mock function with given fields: _a0 -func (_m *RPCClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, error) { - ret := _m.Called(_a0) +// ABCIInfo provides a mock function with given fields: ctx +func (_m *RPCClient) ABCIInfo(ctx context.Context) (*coretypes.ResultABCIInfo, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ABCIInfo") + } var r0 *coretypes.ResultABCIInfo var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { - return rf(_a0) + return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { - r0 = rf(_a0) + r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultABCIInfo) @@ -48,7 +52,7 @@ func (_m *RPCClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, e } if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + r1 = rf(ctx) } else { r1 = ret.Error(1) } @@ -62,12 +66,12 @@ type RPCClient_ABCIInfo_Call struct { } // ABCIInfo is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RPCClient_Expecter) ABCIInfo(_a0 interface{}) *RPCClient_ABCIInfo_Call { - return &RPCClient_ABCIInfo_Call{Call: _e.mock.On("ABCIInfo", _a0)} +// - ctx context.Context +func (_e *RPCClient_Expecter) ABCIInfo(ctx interface{}) *RPCClient_ABCIInfo_Call { + return &RPCClient_ABCIInfo_Call{Call: _e.mock.On("ABCIInfo", ctx)} } -func (_c *RPCClient_ABCIInfo_Call) Run(run func(_a0 context.Context)) *RPCClient_ABCIInfo_Call { +func (_c *RPCClient_ABCIInfo_Call) Run(run func(ctx context.Context)) *RPCClient_ABCIInfo_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) @@ -88,6 +92,10 @@ func (_c *RPCClient_ABCIInfo_Call) RunAndReturn(run func(context.Context) (*core func (_m *RPCClient) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*coretypes.ResultABCIQuery, error) { ret := _m.Called(ctx, path, data) + if len(ret) == 0 { + panic("no return value specified for ABCIQuery") + } + var r0 *coretypes.ResultABCIQuery var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { @@ -144,6 +152,10 @@ func (_c *RPCClient_ABCIQuery_Call) RunAndReturn(run func(context.Context, strin func (_m *RPCClient) ABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error) { ret := _m.Called(ctx, path, data, opts) + if len(ret) == 0 { + panic("no return value specified for ABCIQueryWithOptions") + } + var r0 *coretypes.ResultABCIQuery var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { @@ -201,6 +213,10 @@ func (_c *RPCClient_ABCIQueryWithOptions_Call) RunAndReturn(run func(context.Con func (_m *RPCClient) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) { ret := _m.Called(ctx, height) + if len(ret) == 0 { + panic("no return value specified for Block") + } + var r0 *coretypes.ResultBlock var r1 error if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { @@ -256,6 +272,10 @@ func (_c *RPCClient_Block_Call) RunAndReturn(run func(context.Context, *int64) ( func (_m *RPCClient) BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error) { ret := _m.Called(ctx, hash) + if len(ret) == 0 { + panic("no return value specified for BlockByHash") + } + var r0 *coretypes.ResultBlock var r1 error if rf, ok := ret.Get(0).(func(context.Context, []byte) (*coretypes.ResultBlock, error)); ok { @@ -311,6 +331,10 @@ func (_c *RPCClient_BlockByHash_Call) RunAndReturn(run func(context.Context, []b func (_m *RPCClient) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error) { ret := _m.Called(ctx, height) + if len(ret) == 0 { + panic("no return value specified for BlockResults") + } + var r0 *coretypes.ResultBlockResults var r1 error if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { @@ -366,6 +390,10 @@ func (_c *RPCClient_BlockResults_Call) RunAndReturn(run func(context.Context, *i func (_m *RPCClient) BlockSearch(ctx context.Context, query string, page *int, perPage *int, orderBy string) (*coretypes.ResultBlockSearch, error) { ret := _m.Called(ctx, query, page, perPage, orderBy) + if len(ret) == 0 { + panic("no return value specified for BlockSearch") + } + var r0 *coretypes.ResultBlockSearch var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { @@ -424,6 +452,10 @@ func (_c *RPCClient_BlockSearch_Call) RunAndReturn(run func(context.Context, str func (_m *RPCClient) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) { ret := _m.Called(ctx, minHeight, maxHeight) + if len(ret) == 0 { + panic("no return value specified for BlockchainInfo") + } + var r0 *coretypes.ResultBlockchainInfo var r1 error if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { @@ -476,17 +508,21 @@ func (_c *RPCClient_BlockchainInfo_Call) RunAndReturn(run func(context.Context, return _c } -// BroadcastEvidence provides a mock function with given fields: _a0, _a1 -func (_m *RPCClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*coretypes.ResultBroadcastEvidence, error) { - ret := _m.Called(_a0, _a1) +// BroadcastEvidence provides a mock function with given fields: ctx, ev +func (_m *RPCClient) BroadcastEvidence(ctx context.Context, ev types.Evidence) (*coretypes.ResultBroadcastEvidence, error) { + ret := _m.Called(ctx, ev) + + if len(ret) == 0 { + panic("no return value specified for BroadcastEvidence") + } var r0 *coretypes.ResultBroadcastEvidence var r1 error if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { - return rf(_a0, _a1) + return rf(ctx, ev) } if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { - r0 = rf(_a0, _a1) + r0 = rf(ctx, ev) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastEvidence) @@ -494,7 +530,7 @@ func (_m *RPCClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) } if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { - r1 = rf(_a0, _a1) + r1 = rf(ctx, ev) } else { r1 = ret.Error(1) } @@ -508,13 +544,13 @@ type RPCClient_BroadcastEvidence_Call struct { } // BroadcastEvidence is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Evidence -func (_e *RPCClient_Expecter) BroadcastEvidence(_a0 interface{}, _a1 interface{}) *RPCClient_BroadcastEvidence_Call { - return &RPCClient_BroadcastEvidence_Call{Call: _e.mock.On("BroadcastEvidence", _a0, _a1)} +// - ctx context.Context +// - ev types.Evidence +func (_e *RPCClient_Expecter) BroadcastEvidence(ctx interface{}, ev interface{}) *RPCClient_BroadcastEvidence_Call { + return &RPCClient_BroadcastEvidence_Call{Call: _e.mock.On("BroadcastEvidence", ctx, ev)} } -func (_c *RPCClient_BroadcastEvidence_Call) Run(run func(_a0 context.Context, _a1 types.Evidence)) *RPCClient_BroadcastEvidence_Call { +func (_c *RPCClient_BroadcastEvidence_Call) Run(run func(ctx context.Context, ev types.Evidence)) *RPCClient_BroadcastEvidence_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Evidence)) }) @@ -531,17 +567,21 @@ func (_c *RPCClient_BroadcastEvidence_Call) RunAndReturn(run func(context.Contex return _c } -// BroadcastTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *RPCClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTx, error) { - ret := _m.Called(_a0, _a1) +// BroadcastTxAsync provides a mock function with given fields: ctx, tx +func (_m *RPCClient) BroadcastTxAsync(ctx context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error) { + ret := _m.Called(ctx, tx) + + if len(ret) == 0 { + panic("no return value specified for BroadcastTxAsync") + } var r0 *coretypes.ResultBroadcastTx var r1 error if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) + return rf(ctx, tx) } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { - r0 = rf(_a0, _a1) + r0 = rf(ctx, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastTx) @@ -549,7 +589,7 @@ func (_m *RPCClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coret } if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + r1 = rf(ctx, tx) } else { r1 = ret.Error(1) } @@ -563,13 +603,13 @@ type RPCClient_BroadcastTxAsync_Call struct { } // BroadcastTxAsync is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *RPCClient_Expecter) BroadcastTxAsync(_a0 interface{}, _a1 interface{}) *RPCClient_BroadcastTxAsync_Call { - return &RPCClient_BroadcastTxAsync_Call{Call: _e.mock.On("BroadcastTxAsync", _a0, _a1)} +// - ctx context.Context +// - tx types.Tx +func (_e *RPCClient_Expecter) BroadcastTxAsync(ctx interface{}, tx interface{}) *RPCClient_BroadcastTxAsync_Call { + return &RPCClient_BroadcastTxAsync_Call{Call: _e.mock.On("BroadcastTxAsync", ctx, tx)} } -func (_c *RPCClient_BroadcastTxAsync_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *RPCClient_BroadcastTxAsync_Call { +func (_c *RPCClient_BroadcastTxAsync_Call) Run(run func(ctx context.Context, tx types.Tx)) *RPCClient_BroadcastTxAsync_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) @@ -586,17 +626,21 @@ func (_c *RPCClient_BroadcastTxAsync_Call) RunAndReturn(run func(context.Context return _c } -// BroadcastTxCommit provides a mock function with given fields: _a0, _a1 -func (_m *RPCClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTxCommit, error) { - ret := _m.Called(_a0, _a1) +// BroadcastTxCommit provides a mock function with given fields: ctx, tx +func (_m *RPCClient) BroadcastTxCommit(ctx context.Context, tx types.Tx) (*coretypes.ResultBroadcastTxCommit, error) { + ret := _m.Called(ctx, tx) + + if len(ret) == 0 { + panic("no return value specified for BroadcastTxCommit") + } var r0 *coretypes.ResultBroadcastTxCommit var r1 error if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { - return rf(_a0, _a1) + return rf(ctx, tx) } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { - r0 = rf(_a0, _a1) + r0 = rf(ctx, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastTxCommit) @@ -604,7 +648,7 @@ func (_m *RPCClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*core } if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + r1 = rf(ctx, tx) } else { r1 = ret.Error(1) } @@ -618,13 +662,13 @@ type RPCClient_BroadcastTxCommit_Call struct { } // BroadcastTxCommit is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *RPCClient_Expecter) BroadcastTxCommit(_a0 interface{}, _a1 interface{}) *RPCClient_BroadcastTxCommit_Call { - return &RPCClient_BroadcastTxCommit_Call{Call: _e.mock.On("BroadcastTxCommit", _a0, _a1)} +// - ctx context.Context +// - tx types.Tx +func (_e *RPCClient_Expecter) BroadcastTxCommit(ctx interface{}, tx interface{}) *RPCClient_BroadcastTxCommit_Call { + return &RPCClient_BroadcastTxCommit_Call{Call: _e.mock.On("BroadcastTxCommit", ctx, tx)} } -func (_c *RPCClient_BroadcastTxCommit_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *RPCClient_BroadcastTxCommit_Call { +func (_c *RPCClient_BroadcastTxCommit_Call) Run(run func(ctx context.Context, tx types.Tx)) *RPCClient_BroadcastTxCommit_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) @@ -641,17 +685,21 @@ func (_c *RPCClient_BroadcastTxCommit_Call) RunAndReturn(run func(context.Contex return _c } -// BroadcastTxSync provides a mock function with given fields: _a0, _a1 -func (_m *RPCClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTx, error) { - ret := _m.Called(_a0, _a1) +// BroadcastTxSync provides a mock function with given fields: ctx, tx +func (_m *RPCClient) BroadcastTxSync(ctx context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error) { + ret := _m.Called(ctx, tx) + + if len(ret) == 0 { + panic("no return value specified for BroadcastTxSync") + } var r0 *coretypes.ResultBroadcastTx var r1 error if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) + return rf(ctx, tx) } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { - r0 = rf(_a0, _a1) + r0 = rf(ctx, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastTx) @@ -659,7 +707,7 @@ func (_m *RPCClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*corety } if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + r1 = rf(ctx, tx) } else { r1 = ret.Error(1) } @@ -673,13 +721,13 @@ type RPCClient_BroadcastTxSync_Call struct { } // BroadcastTxSync is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *RPCClient_Expecter) BroadcastTxSync(_a0 interface{}, _a1 interface{}) *RPCClient_BroadcastTxSync_Call { - return &RPCClient_BroadcastTxSync_Call{Call: _e.mock.On("BroadcastTxSync", _a0, _a1)} +// - ctx context.Context +// - tx types.Tx +func (_e *RPCClient_Expecter) BroadcastTxSync(ctx interface{}, tx interface{}) *RPCClient_BroadcastTxSync_Call { + return &RPCClient_BroadcastTxSync_Call{Call: _e.mock.On("BroadcastTxSync", ctx, tx)} } -func (_c *RPCClient_BroadcastTxSync_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *RPCClient_BroadcastTxSync_Call { +func (_c *RPCClient_BroadcastTxSync_Call) Run(run func(ctx context.Context, tx types.Tx)) *RPCClient_BroadcastTxSync_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) @@ -696,17 +744,21 @@ func (_c *RPCClient_BroadcastTxSync_Call) RunAndReturn(run func(context.Context, return _c } -// CheckTx provides a mock function with given fields: _a0, _a1 -func (_m *RPCClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultCheckTx, error) { - ret := _m.Called(_a0, _a1) +// CheckTx provides a mock function with given fields: ctx, tx +func (_m *RPCClient) CheckTx(ctx context.Context, tx types.Tx) (*coretypes.ResultCheckTx, error) { + ret := _m.Called(ctx, tx) + + if len(ret) == 0 { + panic("no return value specified for CheckTx") + } var r0 *coretypes.ResultCheckTx var r1 error if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { - return rf(_a0, _a1) + return rf(ctx, tx) } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { - r0 = rf(_a0, _a1) + r0 = rf(ctx, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultCheckTx) @@ -714,7 +766,7 @@ func (_m *RPCClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.Resu } if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + r1 = rf(ctx, tx) } else { r1 = ret.Error(1) } @@ -728,13 +780,13 @@ type RPCClient_CheckTx_Call struct { } // CheckTx is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *RPCClient_Expecter) CheckTx(_a0 interface{}, _a1 interface{}) *RPCClient_CheckTx_Call { - return &RPCClient_CheckTx_Call{Call: _e.mock.On("CheckTx", _a0, _a1)} +// - ctx context.Context +// - tx types.Tx +func (_e *RPCClient_Expecter) CheckTx(ctx interface{}, tx interface{}) *RPCClient_CheckTx_Call { + return &RPCClient_CheckTx_Call{Call: _e.mock.On("CheckTx", ctx, tx)} } -func (_c *RPCClient_CheckTx_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *RPCClient_CheckTx_Call { +func (_c *RPCClient_CheckTx_Call) Run(run func(ctx context.Context, tx types.Tx)) *RPCClient_CheckTx_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) @@ -755,6 +807,10 @@ func (_c *RPCClient_CheckTx_Call) RunAndReturn(run func(context.Context, types.T func (_m *RPCClient) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) { ret := _m.Called(ctx, height) + if len(ret) == 0 { + panic("no return value specified for Commit") + } + var r0 *coretypes.ResultCommit var r1 error if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { @@ -810,6 +866,10 @@ func (_c *RPCClient_Commit_Call) RunAndReturn(run func(context.Context, *int64) func (_m *RPCClient) ConsensusParams(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error) { ret := _m.Called(ctx, height) + if len(ret) == 0 { + panic("no return value specified for ConsensusParams") + } + var r0 *coretypes.ResultConsensusParams var r1 error if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { @@ -861,17 +921,21 @@ func (_c *RPCClient_ConsensusParams_Call) RunAndReturn(run func(context.Context, return _c } -// ConsensusState provides a mock function with given fields: _a0 -func (_m *RPCClient) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensusState, error) { - ret := _m.Called(_a0) +// ConsensusState provides a mock function with given fields: ctx +func (_m *RPCClient) ConsensusState(ctx context.Context) (*coretypes.ResultConsensusState, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ConsensusState") + } var r0 *coretypes.ResultConsensusState var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { - return rf(_a0) + return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { - r0 = rf(_a0) + r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultConsensusState) @@ -879,7 +943,7 @@ func (_m *RPCClient) ConsensusState(_a0 context.Context) (*coretypes.ResultConse } if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + r1 = rf(ctx) } else { r1 = ret.Error(1) } @@ -893,12 +957,12 @@ type RPCClient_ConsensusState_Call struct { } // ConsensusState is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RPCClient_Expecter) ConsensusState(_a0 interface{}) *RPCClient_ConsensusState_Call { - return &RPCClient_ConsensusState_Call{Call: _e.mock.On("ConsensusState", _a0)} +// - ctx context.Context +func (_e *RPCClient_Expecter) ConsensusState(ctx interface{}) *RPCClient_ConsensusState_Call { + return &RPCClient_ConsensusState_Call{Call: _e.mock.On("ConsensusState", ctx)} } -func (_c *RPCClient_ConsensusState_Call) Run(run func(_a0 context.Context)) *RPCClient_ConsensusState_Call { +func (_c *RPCClient_ConsensusState_Call) Run(run func(ctx context.Context)) *RPCClient_ConsensusState_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) @@ -915,17 +979,21 @@ func (_c *RPCClient_ConsensusState_Call) RunAndReturn(run func(context.Context) return _c } -// DumpConsensusState provides a mock function with given fields: _a0 -func (_m *RPCClient) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDumpConsensusState, error) { - ret := _m.Called(_a0) +// DumpConsensusState provides a mock function with given fields: ctx +func (_m *RPCClient) DumpConsensusState(ctx context.Context) (*coretypes.ResultDumpConsensusState, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for DumpConsensusState") + } var r0 *coretypes.ResultDumpConsensusState var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { - return rf(_a0) + return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { - r0 = rf(_a0) + r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultDumpConsensusState) @@ -933,7 +1001,7 @@ func (_m *RPCClient) DumpConsensusState(_a0 context.Context) (*coretypes.ResultD } if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + r1 = rf(ctx) } else { r1 = ret.Error(1) } @@ -947,12 +1015,12 @@ type RPCClient_DumpConsensusState_Call struct { } // DumpConsensusState is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RPCClient_Expecter) DumpConsensusState(_a0 interface{}) *RPCClient_DumpConsensusState_Call { - return &RPCClient_DumpConsensusState_Call{Call: _e.mock.On("DumpConsensusState", _a0)} +// - ctx context.Context +func (_e *RPCClient_Expecter) DumpConsensusState(ctx interface{}) *RPCClient_DumpConsensusState_Call { + return &RPCClient_DumpConsensusState_Call{Call: _e.mock.On("DumpConsensusState", ctx)} } -func (_c *RPCClient_DumpConsensusState_Call) Run(run func(_a0 context.Context)) *RPCClient_DumpConsensusState_Call { +func (_c *RPCClient_DumpConsensusState_Call) Run(run func(ctx context.Context)) *RPCClient_DumpConsensusState_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) @@ -969,17 +1037,21 @@ func (_c *RPCClient_DumpConsensusState_Call) RunAndReturn(run func(context.Conte return _c } -// Genesis provides a mock function with given fields: _a0 -func (_m *RPCClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) { - ret := _m.Called(_a0) +// Genesis provides a mock function with given fields: ctx +func (_m *RPCClient) Genesis(ctx context.Context) (*coretypes.ResultGenesis, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Genesis") + } var r0 *coretypes.ResultGenesis var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { - return rf(_a0) + return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { - r0 = rf(_a0) + r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultGenesis) @@ -987,7 +1059,7 @@ func (_m *RPCClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, err } if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + r1 = rf(ctx) } else { r1 = ret.Error(1) } @@ -1001,12 +1073,12 @@ type RPCClient_Genesis_Call struct { } // Genesis is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RPCClient_Expecter) Genesis(_a0 interface{}) *RPCClient_Genesis_Call { - return &RPCClient_Genesis_Call{Call: _e.mock.On("Genesis", _a0)} +// - ctx context.Context +func (_e *RPCClient_Expecter) Genesis(ctx interface{}) *RPCClient_Genesis_Call { + return &RPCClient_Genesis_Call{Call: _e.mock.On("Genesis", ctx)} } -func (_c *RPCClient_Genesis_Call) Run(run func(_a0 context.Context)) *RPCClient_Genesis_Call { +func (_c *RPCClient_Genesis_Call) Run(run func(ctx context.Context)) *RPCClient_Genesis_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) @@ -1023,17 +1095,21 @@ func (_c *RPCClient_Genesis_Call) RunAndReturn(run func(context.Context) (*coret return _c } -// GenesisChunked provides a mock function with given fields: _a0, _a1 -func (_m *RPCClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.ResultGenesisChunk, error) { - ret := _m.Called(_a0, _a1) +// GenesisChunked provides a mock function with given fields: ctx, id +func (_m *RPCClient) GenesisChunked(ctx context.Context, id uint) (*coretypes.ResultGenesisChunk, error) { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for GenesisChunked") + } var r0 *coretypes.ResultGenesisChunk var r1 error if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { - return rf(_a0, _a1) + return rf(ctx, id) } if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { - r0 = rf(_a0, _a1) + r0 = rf(ctx, id) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultGenesisChunk) @@ -1041,7 +1117,7 @@ func (_m *RPCClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.R } if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { - r1 = rf(_a0, _a1) + r1 = rf(ctx, id) } else { r1 = ret.Error(1) } @@ -1055,13 +1131,13 @@ type RPCClient_GenesisChunked_Call struct { } // GenesisChunked is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 uint -func (_e *RPCClient_Expecter) GenesisChunked(_a0 interface{}, _a1 interface{}) *RPCClient_GenesisChunked_Call { - return &RPCClient_GenesisChunked_Call{Call: _e.mock.On("GenesisChunked", _a0, _a1)} +// - ctx context.Context +// - id uint +func (_e *RPCClient_Expecter) GenesisChunked(ctx interface{}, id interface{}) *RPCClient_GenesisChunked_Call { + return &RPCClient_GenesisChunked_Call{Call: _e.mock.On("GenesisChunked", ctx, id)} } -func (_c *RPCClient_GenesisChunked_Call) Run(run func(_a0 context.Context, _a1 uint)) *RPCClient_GenesisChunked_Call { +func (_c *RPCClient_GenesisChunked_Call) Run(run func(ctx context.Context, id uint)) *RPCClient_GenesisChunked_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(uint)) }) @@ -1082,6 +1158,10 @@ func (_c *RPCClient_GenesisChunked_Call) RunAndReturn(run func(context.Context, func (_m *RPCClient) Header(ctx context.Context, height *int64) (*coretypes.ResultHeader, error) { ret := _m.Called(ctx, height) + if len(ret) == 0 { + panic("no return value specified for Header") + } + var r0 *coretypes.ResultHeader var r1 error if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { @@ -1137,6 +1217,10 @@ func (_c *RPCClient_Header_Call) RunAndReturn(run func(context.Context, *int64) func (_m *RPCClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultHeader, error) { ret := _m.Called(ctx, hash) + if len(ret) == 0 { + panic("no return value specified for HeaderByHash") + } + var r0 *coretypes.ResultHeader var r1 error if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { @@ -1188,17 +1272,21 @@ func (_c *RPCClient_HeaderByHash_Call) RunAndReturn(run func(context.Context, by return _c } -// Health provides a mock function with given fields: _a0 -func (_m *RPCClient) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { - ret := _m.Called(_a0) +// Health provides a mock function with given fields: ctx +func (_m *RPCClient) Health(ctx context.Context) (*coretypes.ResultHealth, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Health") + } var r0 *coretypes.ResultHealth var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { - return rf(_a0) + return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { - r0 = rf(_a0) + r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultHealth) @@ -1206,7 +1294,7 @@ func (_m *RPCClient) Health(_a0 context.Context) (*coretypes.ResultHealth, error } if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + r1 = rf(ctx) } else { r1 = ret.Error(1) } @@ -1220,12 +1308,12 @@ type RPCClient_Health_Call struct { } // Health is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RPCClient_Expecter) Health(_a0 interface{}) *RPCClient_Health_Call { - return &RPCClient_Health_Call{Call: _e.mock.On("Health", _a0)} +// - ctx context.Context +func (_e *RPCClient_Expecter) Health(ctx interface{}) *RPCClient_Health_Call { + return &RPCClient_Health_Call{Call: _e.mock.On("Health", ctx)} } -func (_c *RPCClient_Health_Call) Run(run func(_a0 context.Context)) *RPCClient_Health_Call { +func (_c *RPCClient_Health_Call) Run(run func(ctx context.Context)) *RPCClient_Health_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) @@ -1246,6 +1334,10 @@ func (_c *RPCClient_Health_Call) RunAndReturn(run func(context.Context) (*corety func (_m *RPCClient) IsRunning() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for IsRunning") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -1283,17 +1375,21 @@ func (_c *RPCClient_IsRunning_Call) RunAndReturn(run func() bool) *RPCClient_IsR return _c } -// NetInfo provides a mock function with given fields: _a0 -func (_m *RPCClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) { - ret := _m.Called(_a0) +// NetInfo provides a mock function with given fields: ctx +func (_m *RPCClient) NetInfo(ctx context.Context) (*coretypes.ResultNetInfo, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for NetInfo") + } var r0 *coretypes.ResultNetInfo var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { - return rf(_a0) + return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { - r0 = rf(_a0) + r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultNetInfo) @@ -1301,7 +1397,7 @@ func (_m *RPCClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, err } if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + r1 = rf(ctx) } else { r1 = ret.Error(1) } @@ -1315,12 +1411,12 @@ type RPCClient_NetInfo_Call struct { } // NetInfo is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RPCClient_Expecter) NetInfo(_a0 interface{}) *RPCClient_NetInfo_Call { - return &RPCClient_NetInfo_Call{Call: _e.mock.On("NetInfo", _a0)} +// - ctx context.Context +func (_e *RPCClient_Expecter) NetInfo(ctx interface{}) *RPCClient_NetInfo_Call { + return &RPCClient_NetInfo_Call{Call: _e.mock.On("NetInfo", ctx)} } -func (_c *RPCClient_NetInfo_Call) Run(run func(_a0 context.Context)) *RPCClient_NetInfo_Call { +func (_c *RPCClient_NetInfo_Call) Run(run func(ctx context.Context)) *RPCClient_NetInfo_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) @@ -1337,17 +1433,21 @@ func (_c *RPCClient_NetInfo_Call) RunAndReturn(run func(context.Context) (*coret return _c } -// NumUnconfirmedTxs provides a mock function with given fields: _a0 -func (_m *RPCClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUnconfirmedTxs, error) { - ret := _m.Called(_a0) +// NumUnconfirmedTxs provides a mock function with given fields: ctx +func (_m *RPCClient) NumUnconfirmedTxs(ctx context.Context) (*coretypes.ResultUnconfirmedTxs, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for NumUnconfirmedTxs") + } var r0 *coretypes.ResultUnconfirmedTxs var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(_a0) + return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { - r0 = rf(_a0) + r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultUnconfirmedTxs) @@ -1355,7 +1455,7 @@ func (_m *RPCClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUn } if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + r1 = rf(ctx) } else { r1 = ret.Error(1) } @@ -1369,12 +1469,12 @@ type RPCClient_NumUnconfirmedTxs_Call struct { } // NumUnconfirmedTxs is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RPCClient_Expecter) NumUnconfirmedTxs(_a0 interface{}) *RPCClient_NumUnconfirmedTxs_Call { - return &RPCClient_NumUnconfirmedTxs_Call{Call: _e.mock.On("NumUnconfirmedTxs", _a0)} +// - ctx context.Context +func (_e *RPCClient_Expecter) NumUnconfirmedTxs(ctx interface{}) *RPCClient_NumUnconfirmedTxs_Call { + return &RPCClient_NumUnconfirmedTxs_Call{Call: _e.mock.On("NumUnconfirmedTxs", ctx)} } -func (_c *RPCClient_NumUnconfirmedTxs_Call) Run(run func(_a0 context.Context)) *RPCClient_NumUnconfirmedTxs_Call { +func (_c *RPCClient_NumUnconfirmedTxs_Call) Run(run func(ctx context.Context)) *RPCClient_NumUnconfirmedTxs_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) @@ -1395,6 +1495,10 @@ func (_c *RPCClient_NumUnconfirmedTxs_Call) RunAndReturn(run func(context.Contex func (_m *RPCClient) OnReset() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OnReset") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -1436,6 +1540,10 @@ func (_c *RPCClient_OnReset_Call) RunAndReturn(run func() error) *RPCClient_OnRe func (_m *RPCClient) OnStart() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for OnStart") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -1509,6 +1617,10 @@ func (_c *RPCClient_OnStop_Call) RunAndReturn(run func()) *RPCClient_OnStop_Call func (_m *RPCClient) Quit() <-chan struct{} { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Quit") + } + var r0 <-chan struct{} if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { r0 = rf() @@ -1552,6 +1664,10 @@ func (_c *RPCClient_Quit_Call) RunAndReturn(run func() <-chan struct{}) *RPCClie func (_m *RPCClient) Reset() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Reset") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -1589,9 +1705,9 @@ func (_c *RPCClient_Reset_Call) RunAndReturn(run func() error) *RPCClient_Reset_ return _c } -// SetLogger provides a mock function with given fields: _a0 -func (_m *RPCClient) SetLogger(_a0 log.Logger) { - _m.Called(_a0) +// SetLogger provides a mock function with given fields: l +func (_m *RPCClient) SetLogger(l log.Logger) { + _m.Called(l) } // RPCClient_SetLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLogger' @@ -1600,12 +1716,12 @@ type RPCClient_SetLogger_Call struct { } // SetLogger is a helper method to define mock.On call -// - _a0 log.Logger -func (_e *RPCClient_Expecter) SetLogger(_a0 interface{}) *RPCClient_SetLogger_Call { - return &RPCClient_SetLogger_Call{Call: _e.mock.On("SetLogger", _a0)} +// - l log.Logger +func (_e *RPCClient_Expecter) SetLogger(l interface{}) *RPCClient_SetLogger_Call { + return &RPCClient_SetLogger_Call{Call: _e.mock.On("SetLogger", l)} } -func (_c *RPCClient_SetLogger_Call) Run(run func(_a0 log.Logger)) *RPCClient_SetLogger_Call { +func (_c *RPCClient_SetLogger_Call) Run(run func(l log.Logger)) *RPCClient_SetLogger_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(log.Logger)) }) @@ -1626,6 +1742,10 @@ func (_c *RPCClient_SetLogger_Call) RunAndReturn(run func(log.Logger)) *RPCClien func (_m *RPCClient) Start() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Start") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -1663,17 +1783,21 @@ func (_c *RPCClient_Start_Call) RunAndReturn(run func() error) *RPCClient_Start_ return _c } -// Status provides a mock function with given fields: _a0 -func (_m *RPCClient) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { - ret := _m.Called(_a0) +// Status provides a mock function with given fields: ctx +func (_m *RPCClient) Status(ctx context.Context) (*coretypes.ResultStatus, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Status") + } var r0 *coretypes.ResultStatus var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { - return rf(_a0) + return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { - r0 = rf(_a0) + r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultStatus) @@ -1681,7 +1805,7 @@ func (_m *RPCClient) Status(_a0 context.Context) (*coretypes.ResultStatus, error } if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + r1 = rf(ctx) } else { r1 = ret.Error(1) } @@ -1695,12 +1819,12 @@ type RPCClient_Status_Call struct { } // Status is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RPCClient_Expecter) Status(_a0 interface{}) *RPCClient_Status_Call { - return &RPCClient_Status_Call{Call: _e.mock.On("Status", _a0)} +// - ctx context.Context +func (_e *RPCClient_Expecter) Status(ctx interface{}) *RPCClient_Status_Call { + return &RPCClient_Status_Call{Call: _e.mock.On("Status", ctx)} } -func (_c *RPCClient_Status_Call) Run(run func(_a0 context.Context)) *RPCClient_Status_Call { +func (_c *RPCClient_Status_Call) Run(run func(ctx context.Context)) *RPCClient_Status_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) @@ -1721,6 +1845,10 @@ func (_c *RPCClient_Status_Call) RunAndReturn(run func(context.Context) (*corety func (_m *RPCClient) Stop() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Stop") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -1762,6 +1890,10 @@ func (_c *RPCClient_Stop_Call) RunAndReturn(run func() error) *RPCClient_Stop_Ca func (_m *RPCClient) String() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for String") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1810,6 +1942,10 @@ func (_m *RPCClient) Subscribe(ctx context.Context, subscriber string, query str _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Subscribe") + } + var r0 <-chan coretypes.ResultEvent var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { @@ -1874,6 +2010,10 @@ func (_c *RPCClient_Subscribe_Call) RunAndReturn(run func(context.Context, strin func (_m *RPCClient) Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error) { ret := _m.Called(ctx, hash, prove) + if len(ret) == 0 { + panic("no return value specified for Tx") + } + var r0 *coretypes.ResultTx var r1 error if rf, ok := ret.Get(0).(func(context.Context, []byte, bool) (*coretypes.ResultTx, error)); ok { @@ -1930,6 +2070,10 @@ func (_c *RPCClient_Tx_Call) RunAndReturn(run func(context.Context, []byte, bool func (_m *RPCClient) TxSearch(ctx context.Context, query string, prove bool, page *int, perPage *int, orderBy string) (*coretypes.ResultTxSearch, error) { ret := _m.Called(ctx, query, prove, page, perPage, orderBy) + if len(ret) == 0 { + panic("no return value specified for TxSearch") + } + var r0 *coretypes.ResultTxSearch var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { @@ -1989,6 +2133,10 @@ func (_c *RPCClient_TxSearch_Call) RunAndReturn(run func(context.Context, string func (_m *RPCClient) UnconfirmedTxs(ctx context.Context, limit *int) (*coretypes.ResultUnconfirmedTxs, error) { ret := _m.Called(ctx, limit) + if len(ret) == 0 { + panic("no return value specified for UnconfirmedTxs") + } + var r0 *coretypes.ResultUnconfirmedTxs var r1 error if rf, ok := ret.Get(0).(func(context.Context, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { @@ -2044,6 +2192,10 @@ func (_c *RPCClient_UnconfirmedTxs_Call) RunAndReturn(run func(context.Context, func (_m *RPCClient) Unsubscribe(ctx context.Context, subscriber string, query string) error { ret := _m.Called(ctx, subscriber, query) + if len(ret) == 0 { + panic("no return value specified for Unsubscribe") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { r0 = rf(ctx, subscriber, query) @@ -2088,6 +2240,10 @@ func (_c *RPCClient_Unsubscribe_Call) RunAndReturn(run func(context.Context, str func (_m *RPCClient) UnsubscribeAll(ctx context.Context, subscriber string) error { ret := _m.Called(ctx, subscriber) + if len(ret) == 0 { + panic("no return value specified for UnsubscribeAll") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { r0 = rf(ctx, subscriber) @@ -2131,6 +2287,10 @@ func (_c *RPCClient_UnsubscribeAll_Call) RunAndReturn(run func(context.Context, func (_m *RPCClient) Validators(ctx context.Context, height *int64, page *int, perPage *int) (*coretypes.ResultValidators, error) { ret := _m.Called(ctx, height, page, perPage) + if len(ret) == 0 { + panic("no return value specified for Validators") + } + var r0 *coretypes.ResultValidators var r1 error if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int) (*coretypes.ResultValidators, error)); ok { diff --git a/ignite/pkg/cosmosclient/mocks/signer.go b/ignite/pkg/cosmosclient/mocks/signer.go index cf2dddd3dd..f09dd523ea 100644 --- a/ignite/pkg/cosmosclient/mocks/signer.go +++ b/ignite/pkg/cosmosclient/mocks/signer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/ignite/pkg/cosmosclient/txservice_test.go b/ignite/pkg/cosmosclient/txservice_test.go index ab2e8d529b..d0d2322b0c 100644 --- a/ignite/pkg/cosmosclient/txservice_test.go +++ b/ignite/pkg/cosmosclient/txservice_test.go @@ -1,10 +1,10 @@ package cosmosclient_test import ( - "context" "encoding/hex" "testing" + "cosmossdk.io/core/transaction" "cosmossdk.io/math" banktypes "cosmossdk.io/x/bank/types" abci "github.com/cometbft/cometbft/abci/types" @@ -21,7 +21,6 @@ import ( func TestTxServiceBroadcast(t *testing.T) { var ( - goCtx = context.Background() accountName = "bob" passphrase = "passphrase" txHash = []byte{1, 2, 3} @@ -45,7 +44,7 @@ func TestTxServiceBroadcast(t *testing.T) { } tests := []struct { name string - msg sdktypes.Msg + msg transaction.Msg opts []cosmosclient.Option expectedResponse *sdktypes.TxResponse expectedError string @@ -59,7 +58,7 @@ func TestTxServiceBroadcast(t *testing.T) { setup: func(s suite) { s.expectPrepareFactory(sdkaddr) s.signer.EXPECT(). - Sign(goCtx, mock.Anything, "bob", mock.Anything, true). + Sign(mock.Anything, mock.Anything, "bob", mock.Anything, true). Return(nil) s.rpcClient.EXPECT(). BroadcastTxSync(mock.Anything, mock.Anything). @@ -74,7 +73,7 @@ func TestTxServiceBroadcast(t *testing.T) { setup: func(s suite) { s.expectPrepareFactory(sdkaddr) s.signer.EXPECT(). - Sign(goCtx, mock.Anything, "bob", mock.Anything, true). + Sign(mock.Anything, mock.Anything, "bob", mock.Anything, true). Return(nil) s.rpcClient.EXPECT(). BroadcastTxSync(mock.Anything, mock.Anything). @@ -95,7 +94,7 @@ func TestTxServiceBroadcast(t *testing.T) { setup: func(s suite) { s.expectPrepareFactory(sdkaddr) s.signer.EXPECT(). - Sign(goCtx, mock.Anything, "bob", mock.Anything, true). + Sign(mock.Anything, mock.Anything, "bob", mock.Anything, true). Return(nil) s.rpcClient.EXPECT(). BroadcastTxSync(mock.Anything, mock.Anything). @@ -104,7 +103,7 @@ func TestTxServiceBroadcast(t *testing.T) { }, nil) // Tx is broadcasted, now check for confirmation - s.rpcClient.EXPECT().Tx(goCtx, txHash, false). + s.rpcClient.EXPECT().Tx(mock.Anything, txHash, false). Return(&ctypes.ResultTx{ Hash: txHash, TxResult: abci.ExecTxResult{ @@ -121,7 +120,7 @@ func TestTxServiceBroadcast(t *testing.T) { setup: func(s suite) { s.expectPrepareFactory(sdkaddr) s.signer.EXPECT(). - Sign(goCtx, mock.Anything, "bob", mock.Anything, true). + Sign(mock.Anything, mock.Anything, "bob", mock.Anything, true). Return(nil) s.rpcClient.EXPECT(). BroadcastTxSync(mock.Anything, mock.Anything). @@ -130,7 +129,7 @@ func TestTxServiceBroadcast(t *testing.T) { }, nil) // Tx is broadcasted, now check for confirmation - s.rpcClient.EXPECT().Tx(goCtx, txHash, false). + s.rpcClient.EXPECT().Tx(mock.Anything, txHash, false). Return(&ctypes.ResultTx{ Hash: txHash, TxResult: abci.ExecTxResult{ @@ -150,7 +149,7 @@ func TestTxServiceBroadcast(t *testing.T) { setup: func(s suite) { s.expectPrepareFactory(sdkaddr) s.signer.EXPECT(). - Sign(goCtx, mock.Anything, "bob", mock.Anything, true). + Sign(mock.Anything, mock.Anything, "bob", mock.Anything, true). Return(nil) s.rpcClient.EXPECT(). BroadcastTxSync(mock.Anything, mock.Anything). @@ -160,19 +159,19 @@ func TestTxServiceBroadcast(t *testing.T) { // Tx is broadcasted, now check for confirmation // First time the tx is not found (not confirmed yet) - s.rpcClient.EXPECT().Tx(goCtx, txHash, false). + s.rpcClient.EXPECT().Tx(mock.Anything, txHash, false). Return(nil, errors.New("not found")).Once() // Wait for 1 block - s.rpcClient.EXPECT().Status(goCtx). + s.rpcClient.EXPECT().Status(mock.Anything). Return(&ctypes.ResultStatus{ SyncInfo: ctypes.SyncInfo{LatestBlockHeight: 1}, }, nil).Once() - s.rpcClient.EXPECT().Status(goCtx). + s.rpcClient.EXPECT().Status(mock.Anything). Return(&ctypes.ResultStatus{ SyncInfo: ctypes.SyncInfo{LatestBlockHeight: 2}, }, nil).Once() // Then try gain to fetch the tx, this time it is confirmed - s.rpcClient.EXPECT().Tx(goCtx, txHash, false). + s.rpcClient.EXPECT().Tx(mock.Anything, txHash, false). Return(&ctypes.ResultTx{ Hash: txHash, }, nil) @@ -187,11 +186,10 @@ func TestTxServiceBroadcast(t *testing.T) { ctx := c.Context(). WithFromName(accountName). WithFromAddress(sdkaddr) - txService, err := c.CreateTx(goCtx, account, tt.msg) + txService, err := c.CreateTx(ctx.CmdContext, account, tt.msg) require.NoError(t, err) - res, err := txService.Broadcast(goCtx) - + res, err := txService.Broadcast(ctx.CmdContext) if tt.expectedError != "" { require.EqualError(t, err, tt.expectedError) return diff --git a/ignite/pkg/cosmostxcollector/mocks/saver.go b/ignite/pkg/cosmostxcollector/mocks/saver.go index 1b77722767..e39b0004fd 100644 --- a/ignite/pkg/cosmostxcollector/mocks/saver.go +++ b/ignite/pkg/cosmostxcollector/mocks/saver.go @@ -1,13 +1,12 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks import ( context "context" - mock "github.com/stretchr/testify/mock" - cosmosclient "github.com/ignite/cli/v29/ignite/pkg/cosmosclient" + mock "github.com/stretchr/testify/mock" ) // Saver is an autogenerated mock type for the Saver type @@ -27,6 +26,10 @@ func (_m *Saver) EXPECT() *Saver_Expecter { func (_m *Saver) Save(_a0 context.Context, _a1 []cosmosclient.TX) error { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for Save") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, []cosmosclient.TX) error); ok { r0 = rf(_a0, _a1) diff --git a/ignite/pkg/cosmostxcollector/mocks/txs_collector.go b/ignite/pkg/cosmostxcollector/mocks/txs_collector.go index 79b186cfa2..d2f66c0cc0 100644 --- a/ignite/pkg/cosmostxcollector/mocks/txs_collector.go +++ b/ignite/pkg/cosmostxcollector/mocks/txs_collector.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks @@ -27,6 +27,10 @@ func (_m *TXsCollector) EXPECT() *TXsCollector_Expecter { func (_m *TXsCollector) CollectTXs(ctx context.Context, fromHeight int64, tc chan<- []cosmosclient.TX) error { ret := _m.Called(ctx, fromHeight, tc) + if len(ret) == 0 { + panic("no return value specified for CollectTXs") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, int64, chan<- []cosmosclient.TX) error); ok { r0 = rf(ctx, fromHeight, tc) diff --git a/ignite/services/plugin/mocks/chainer.go b/ignite/services/plugin/mocks/chainer.go index ed1e81a907..0327652519 100644 --- a/ignite/services/plugin/mocks/chainer.go +++ b/ignite/services/plugin/mocks/chainer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.36.1. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks @@ -21,6 +21,10 @@ func (_m *ChainerInterface) EXPECT() *ChainerInterface_Expecter { func (_m *ChainerInterface) AppPath() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for AppPath") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -62,6 +66,10 @@ func (_c *ChainerInterface_AppPath_Call) RunAndReturn(run func() string) *Chaine func (_m *ChainerInterface) ConfigPath() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ConfigPath") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -103,6 +111,10 @@ func (_c *ChainerInterface_ConfigPath_Call) RunAndReturn(run func() string) *Cha func (_m *ChainerInterface) Home() (string, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Home") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func() (string, error)); ok { @@ -154,6 +166,10 @@ func (_c *ChainerInterface_Home_Call) RunAndReturn(run func() (string, error)) * func (_m *ChainerInterface) ID() (string, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ID") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func() (string, error)); ok { @@ -205,6 +221,10 @@ func (_c *ChainerInterface_ID_Call) RunAndReturn(run func() (string, error)) *Ch func (_m *ChainerInterface) RPCPublicAddress() (string, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for RPCPublicAddress") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func() (string, error)); ok { diff --git a/integration/plugin/testdata/example-plugin/go.mod b/integration/plugin/testdata/example-plugin/go.mod index 1edb1d034f..ee7bcbeb92 100644 --- a/integration/plugin/testdata/example-plugin/go.mod +++ b/integration/plugin/testdata/example-plugin/go.mod @@ -1,6 +1,6 @@ module example-plugin -go 1.23 +go 1.23.1 replace ( github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.1 @@ -21,7 +21,7 @@ require ( github.com/blang/semver/v4 v4.0.0 // indirect github.com/charmbracelet/lipgloss v0.6.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -30,7 +30,7 @@ require ( github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/color v1.17.0 // indirect github.com/fatih/structs v1.1.0 // indirect - github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/getsentry/sentry-go v0.28.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/go-git/go-git/v5 v5.12.0 // indirect @@ -63,7 +63,7 @@ require ( github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect github.com/microcosm-cc/bluemonday v1.0.23 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -83,18 +83,18 @@ require ( github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect - golang.org/x/crypto v0.26.0 // indirect - golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.28.0 // indirect + go.etcd.io/bbolt v1.4.0-alpha.1 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.29.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect - golang.org/x/tools v0.24.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/tools v0.25.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect - google.golang.org/grpc v1.66.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.66.1 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect