diff --git a/cmd/osmosisd/cmd/root.go b/cmd/osmosisd/cmd/root.go index 5facf835939..e5f2baa0274 100644 --- a/cmd/osmosisd/cmd/root.go +++ b/cmd/osmosisd/cmd/root.go @@ -1328,10 +1328,5 @@ func autoCliOpts(initClientCtx client.Context, tempApp *osmosis.OsmosisApp) auto AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), - ClientCtx: initClientCtx, - TxConfigOpts: tx.ConfigOptions{ - EnabledSignModes: tx.DefaultSignModes, - TextualCoinMetadataQueryFn: authtxconfig.NewGRPCCoinMetadataQueryFn(initClientCtx), - }, - } + ClientCtx: initClientCtx} } diff --git a/go.mod b/go.mod index 318b81dae14..ecafa84df4a 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.4 require ( cloud.google.com/go/pubsub v1.43.0 cosmossdk.io/api v0.7.6 - cosmossdk.io/client/v2 v2.0.0-beta.1 + cosmossdk.io/client/v2 v2.0.0-beta.3 cosmossdk.io/core v0.12.1-0.20240725072823-6a2d039e1212 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.4.1 @@ -29,8 +29,8 @@ require ( github.com/cosmos/ibc-apps/modules/async-icq/v8 v8.0.0 github.com/cosmos/ibc-go/modules/capability v1.0.1 github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72 - github.com/cosmos/ibc-go/v8 v8.4.0 - github.com/cosmos/rosetta v0.50.10 + github.com/cosmos/ibc-go/v8 v8.5.1 + github.com/cosmos/rosetta v0.50.9 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.1 @@ -60,7 +60,7 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 go.opentelemetry.io/otel/sdk v1.30.0 go.uber.org/multierr v1.11.0 - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 + golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 google.golang.org/grpc v1.66.1 google.golang.org/protobuf v1.34.2 diff --git a/go.sum b/go.sum index 89cce95856e..35e856dbdf4 100644 --- a/go.sum +++ b/go.sum @@ -194,8 +194,8 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= -cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= +cosmossdk.io/client/v2 v2.0.0-beta.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkjFDU= +cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -387,14 +387,14 @@ github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9s github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72 h1:QjCi4bJoy9AXLL1e4jqi+4rHYN0gGZAQxf937cdWhw4= github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72/go.mod h1:yiulzyQAZ+Ci802z/kVQqTA3lGiSJOmDpTq7kZxOUNE= -github.com/cosmos/ibc-go/v8 v8.4.0 h1:K2PfX0AZ+1XKZytHGEMuSjQXG/MZshPb83RSTQt2+cE= -github.com/cosmos/ibc-go/v8 v8.4.0/go.mod h1:zh6x1osR0hNvEcFrC/lhGD08sMfQmr9wHVvZ/mRWMCs= +github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs= +github.com/cosmos/ibc-go/v8 v8.5.1/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= -github.com/cosmos/rosetta v0.50.10 h1:JML9H+TYnpiUn1TucVmV5XVH9YF/Nd/GJqesaIpXq0c= -github.com/cosmos/rosetta v0.50.10/go.mod h1:x7LfYPXzDkS3/8idE+ASifOokJacOiJGdrlj6/r8Bz0= +github.com/cosmos/rosetta v0.50.9 h1:mV09lIDlEnbe8D1yuldY5GBjqk0ggkAbjbRQOrpoOIs= +github.com/cosmos/rosetta v0.50.9/go.mod h1:EYloh7qKmHpqiOB133k2WS6jqZsf3RIPLrVpFz48ZZU= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -1192,8 +1192,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/tests/e2e/configurer/chain/commands.go b/tests/e2e/configurer/chain/commands.go index 0a81b707e55..c9f42486611 100644 --- a/tests/e2e/configurer/chain/commands.go +++ b/tests/e2e/configurer/chain/commands.go @@ -193,38 +193,60 @@ func (n *NodeConfig) WasmExecute(contract, execMsg, from string) { func (n *NodeConfig) QueryParams(subspace, key string, prev26 bool) string { cmd := []string{"osmosisd", "query", "params", "subspace", subspace, key, "--output=json"} - out, _, err := n.containerManager.ExecCmd(n.t, n.Name, cmd, "", false, false) + out, errBuf, err := n.containerManager.ExecCmd(n.t, n.Name, cmd, "", false, false) require.NoError(n.t, err) - fmt.Println(out.String()) + var dataToUnmarshal []byte + if len(out.Bytes()) > 0 { + dataToUnmarshal = out.Bytes() + } else if len(errBuf.Bytes()) > 0 { + dataToUnmarshal = errBuf.Bytes() + } else { + require.FailNow(n.t, "Both output and error buffers are empty") + } var value string result := &ParamsResponse{} - err = json.Unmarshal(out.Bytes(), &result) + err = json.Unmarshal(dataToUnmarshal, &result) value = result.Param.Value require.NoError(n.t, err) return value } -func (n *NodeConfig) QueryGovModuleAccount(prev26 bool) string { +func (n *NodeConfig) QueryGovModuleAccount() string { cmd := []string{"osmosisd", "query", "auth", "module-accounts", "--output=json"} - - out, _, err := n.containerManager.ExecCmd(n.t, n.Name, cmd, "", false, false) + out, errBuf, err := n.containerManager.ExecCmd(n.t, n.Name, cmd, "", false, false) require.NoError(n.t, err) var result map[string][]interface{} - err = json.Unmarshal(out.Bytes(), &result) + + // Check if 'out' is not empty, otherwise use 'errBuf' for unmarshalling + var dataToUnmarshal []byte + if len(out.Bytes()) > 0 { + dataToUnmarshal = out.Bytes() + } else if len(errBuf.Bytes()) > 0 { + dataToUnmarshal = errBuf.Bytes() + } else { + require.FailNow(n.t, "Both output and error buffers are empty") + } + + err = json.Unmarshal(dataToUnmarshal, &result) require.NoError(n.t, err) + for _, acc := range result["accounts"] { account, ok := acc.(map[string]interface{}) require.True(n.t, ok) + value, ok := account["value"].(map[string]interface{}) require.True(n.t, ok) + if value["name"] == "gov" { moduleAccount, ok := value["address"].(string) require.True(n.t, ok) + return moduleAccount } } + require.True(n.t, false, "gov module account not found") return "" } diff --git a/tests/e2e/configurer/upgrade.go b/tests/e2e/configurer/upgrade.go index 1da2c1b54b8..7429bc3e708 100644 --- a/tests/e2e/configurer/upgrade.go +++ b/tests/e2e/configurer/upgrade.go @@ -275,7 +275,7 @@ func (uc *UpgradeConfigurer) CreatePreUpgradeState() error { go func() { defer wg.Done() uc.t.Logf("Uploading rate limiting contract to chainA") - _, err := chainANode.SetupRateLimiting("", chainANode.QueryGovModuleAccount(true), chainA, true, true) + _, err := chainANode.SetupRateLimiting("", chainANode.QueryGovModuleAccount(), chainA, true, true) errCh <- err }() @@ -296,7 +296,7 @@ func (uc *UpgradeConfigurer) CreatePreUpgradeState() error { go func() { defer wg.Done() uc.t.Logf("Uploading rate limiting contract to chainB") - _, err := chainBNode.SetupRateLimiting("", chainBNode.QueryGovModuleAccount(true), chainB, true, true) + _, err := chainBNode.SetupRateLimiting("", chainBNode.QueryGovModuleAccount(), chainB, true, true) errCh <- err }() diff --git a/tests/e2e/containers/containers.go b/tests/e2e/containers/containers.go index 26fde10c1c5..866a4f0135d 100644 --- a/tests/e2e/containers/containers.go +++ b/tests/e2e/containers/containers.go @@ -184,7 +184,8 @@ func (m *Manager) ExecHermesCmd(t *testing.T, command []string, success string) return m.ExecCmd(t, hermesContainerName, command, success, false, false) } -// ExecCmd executes command by running it on the node container (specified by containerName) +// executes command by running it on the node container (specified by containerName) +// // success is the output of the command that needs to be observed for the command to be deemed successful. // It is found by checking if stdout or stderr contains the success string anywhere within it. // returns container std out, container std err, and error if any. diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index d01077c01f9..e7b6213fe0e 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -864,7 +864,7 @@ func (s *IntegrationTestSuite) ExpeditedProposals() { chainAB, chainABNode := s.getChainCfgs() sender := chainABNode.GetWallet(initialization.ValidatorWalletName) - govModuleAccount := chainABNode.QueryGovModuleAccount(false) + govModuleAccount := chainABNode.QueryGovModuleAccount() propMetadata := []byte{42} validProp := fmt.Sprintf(` { @@ -1026,7 +1026,7 @@ func (s *IntegrationTestSuite) SetExpeditedVotingPeriodChainA() { chainA, chainANode := s.getChainACfgs() sender := chainANode.GetWallet(initialization.ValidatorWalletName) - govModuleAccount := chainANode.QueryGovModuleAccount(false) + govModuleAccount := chainANode.QueryGovModuleAccount() propMetadata := []byte{42} validProp := fmt.Sprintf(` { @@ -1088,7 +1088,7 @@ func (s *IntegrationTestSuite) SetExpeditedVotingPeriodChainB() { chainB, chainBNode := s.getChainBCfgs() sender := chainBNode.GetWallet(initialization.ValidatorWalletName) - govModuleAccount := chainBNode.QueryGovModuleAccount(false) + govModuleAccount := chainBNode.QueryGovModuleAccount() propMetadata := []byte{42} validProp := fmt.Sprintf(` {