Skip to content

Commit

Permalink
Merge branch 'main' into julien/decouple-staking-simapp
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Jun 23, 2022
2 parents 413bb7e + 77c764c commit 0f7c5dc
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 7 deletions.
5 changes: 4 additions & 1 deletion x/auth/client/testutil/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import (
"testing"

"github.com/cosmos/cosmos-sdk/testutil/network"
"github.com/cosmos/cosmos-sdk/x/auth/testutil"

"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
)

func TestIntegrationTestSuite(t *testing.T) {
cfg := network.DefaultConfig()
cfg, err := network.DefaultConfigWithAppConfig(testutil.AppConfig)
require.NoError(t, err)
cfg.NumValidators = 2
suite.Run(t, NewIntegrationTestSuite(cfg))
}
3 changes: 3 additions & 0 deletions x/auth/client/testutil/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,10 @@ func (s *IntegrationTestSuite) TestSignWithMultiSignersAminoJSON() {
require.Equal(sdk.NewCoins(val0Coin, val1Coin), queryRes.Balances)
}

// TODO to re-enable in #12274
func (s *IntegrationTestSuite) TestAuxSigner() {
s.T().Skip()

require := s.Require()
val := s.network.Validators[0]
val0Coin := sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10))
Expand Down
4 changes: 2 additions & 2 deletions x/auth/migrations/legacytx/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
"github.com/cosmos/cosmos-sdk/x/auth/testutil"
txtestutil "github.com/cosmos/cosmos-sdk/x/auth/testutil/tx"
)

func testCodec() *codec.LegacyAmino {
Expand All @@ -24,5 +24,5 @@ func testCodec() *codec.LegacyAmino {
func TestStdTxConfig(t *testing.T) {
cdc := testCodec()
txGen := legacytx.StdTxConfig{Cdc: cdc}
suite.Run(t, testutil.NewTxConfigTestSuite(txGen))
suite.Run(t, txtestutil.NewTxConfigTestSuite(txGen))
}
5 changes: 5 additions & 0 deletions x/auth/spec/08_app_wiring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# App Wiring

The minimal app-wiring configuration for `x/auth` is as follows:

+++ https://github.com/cosmos/cosmos-sdk/blob/188e1ec30dffaad020cd4a72747e3da49d714a78/x/auth/testutil/app.yaml
1 change: 1 addition & 0 deletions x/auth/spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ This module is used in the Cosmos Hub.
* [REST](07_client.md#rest)
* **[Vesting](07_client.md#vesting)**
* [CLI](07_client.md#vesting#cli)
8. **[App Wiring](08_app_wiring.md)**
51 changes: 51 additions & 0 deletions x/auth/testutil/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
modules:
- name: runtime
config:
"@type": cosmos.app.runtime.v1alpha1.Module

app_name: AuthApp

begin_blockers: [staking, auth, bank, genutil, feegrant, params, vesting]
end_blockers: [staking, auth, bank, genutil, feegrant, params, vesting]
init_genesis: [auth, bank, staking, genutil, feegrant, params, vesting]

- name: auth
config:
"@type": cosmos.auth.module.v1.Module
bech32_prefix: cosmos
module_account_permissions:
- account: fee_collector
- account: mint
permissions: [minter]
- account: bonded_tokens_pool
permissions: [burner, staking]
- account: not_bonded_tokens_pool
permissions: [burner, staking]

- name: bank
config:
"@type": cosmos.bank.module.v1.Module

- name: params
config:
"@type": cosmos.params.module.v1.Module

- name: tx
config:
"@type": cosmos.tx.module.v1.Module

- name: staking
config:
"@type": cosmos.staking.module.v1.Module

- name: genutil
config:
"@type": cosmos.genutil.module.v1.Module

- name: feegrant
config:
"@type": cosmos.feegrant.module.v1.Module

- name: vesting
config:
"@type": cosmos.vesting.module.v1.Module
22 changes: 22 additions & 0 deletions x/auth/testutil/app_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package testutil

import (
_ "embed"

_ "github.com/cosmos/cosmos-sdk/x/auth"
_ "github.com/cosmos/cosmos-sdk/x/auth/tx/module"
_ "github.com/cosmos/cosmos-sdk/x/auth/vesting"
_ "github.com/cosmos/cosmos-sdk/x/bank"
_ "github.com/cosmos/cosmos-sdk/x/feegrant/module"
_ "github.com/cosmos/cosmos-sdk/x/genutil"
_ "github.com/cosmos/cosmos-sdk/x/gov"
_ "github.com/cosmos/cosmos-sdk/x/params"
_ "github.com/cosmos/cosmos-sdk/x/staking"

"cosmossdk.io/core/appconfig"
)

//go:embed app.yaml
var appConfig []byte

var AppConfig = appconfig.LoadYAML(appConfig)
2 changes: 1 addition & 1 deletion x/auth/testutil/suite.go → x/auth/testutil/tx/suite.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package testutil
package tx

import (
"bytes"
Expand Down
4 changes: 2 additions & 2 deletions x/auth/tx/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"github.com/cosmos/cosmos-sdk/std"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/testutil"
txtestutil "github.com/cosmos/cosmos-sdk/x/auth/testutil/tx"
)

func TestGenerator(t *testing.T) {
interfaceRegistry := codectypes.NewInterfaceRegistry()
std.RegisterInterfaces(interfaceRegistry)
interfaceRegistry.RegisterImplementations((*sdk.Msg)(nil), &testdata.TestMsg{})
protoCodec := codec.NewProtoCodec(interfaceRegistry)
suite.Run(t, testutil.NewTxConfigTestSuite(NewTxConfig(protoCodec, DefaultSignModes)))
suite.Run(t, txtestutil.NewTxConfigTestSuite(NewTxConfig(protoCodec, DefaultSignModes)))
}
4 changes: 3 additions & 1 deletion x/auth/types/account_retriever_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import (
"github.com/stretchr/testify/require"

"github.com/cosmos/cosmos-sdk/testutil/network"
"github.com/cosmos/cosmos-sdk/x/auth/testutil"
"github.com/cosmos/cosmos-sdk/x/auth/types"
)

func TestAccountRetriever(t *testing.T) {
cfg := network.DefaultConfig()
cfg, err := network.DefaultConfigWithAppConfig(testutil.AppConfig)
require.NoError(t, err)
cfg.NumValidators = 1

network, err := network.New(t, t.TempDir(), cfg)
Expand Down

0 comments on commit 0f7c5dc

Please sign in to comment.