feat: add x/auth app wiring integration tests (#12329)
## Description ref: #12302 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
This commit is contained in:
parent
69c9e3ef1c
commit
77c764c86a
@ -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))
|
||||
}
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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 {
|
||||
@ -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
x/auth/spec/08_app_wiring.md
Normal file
5
x/auth/spec/08_app_wiring.md
Normal file
@ -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
|
||||
@ -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
x/auth/testutil/app.yaml
Normal file
51
x/auth/testutil/app.yaml
Normal file
@ -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
x/auth/testutil/app_config.go
Normal file
22
x/auth/testutil/app_config.go
Normal file
@ -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)
|
||||
@ -1,4 +1,4 @@
|
||||
package testutil
|
||||
package tx
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@ -10,7 +10,7 @@ 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) {
|
||||
@ -18,5 +18,5 @@ func TestGenerator(t *testing.T) {
|
||||
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)))
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user