Update x/auth to use Any (#6165)

* Migrate keeper codec to use marshaler

* Migrate AccountI to types

* Did go imports

* Fix tests for x/auth

* Cleanup std/codec

* Sort imports

* Fix legacy codec

* Add godoc for RegisterInterfaces

* Add RegisterInterfaces to std

* Fix typo

* Fixed merge changes

* Eliminate vesting import in auth

* Fix lint issues

* Fix tests

* Addressed comments

* Rename interfaces in RegisterInterfaces

* Removed codec.proto from std

* Minor code cleanup

Co-authored-by: Aaron Craelius <aaron@regen.network>
This commit is contained in:
SaReN
2020-05-20 19:21:00 +00:00
committed by GitHub
co-authored by Aaron Craelius
parent 9a38883e9c
commit bf8809ef98
57 changed files with 404 additions and 1184 deletions
+1 -1
View File
@@ -367,7 +367,7 @@ func NewSimApp(
func MakeCodecs() (*std.Codec, *codec.Codec) {
cdc := std.MakeCodec(ModuleBasics)
interfaceRegistry := types.NewInterfaceRegistry()
sdk.RegisterInterfaces(interfaceRegistry)
std.RegisterInterfaces(interfaceRegistry)
ModuleBasics.RegisterInterfaceModules(interfaceRegistry)
appCodec := std.NewAppCodec(cdc, interfaceRegistry)
return appCodec, cdc
+2 -2
View File
@@ -19,7 +19,7 @@ import (
"github.com/cosmos/cosmos-sdk/server"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
authexported "github.com/cosmos/cosmos-sdk/x/auth/exported"
"github.com/cosmos/cosmos-sdk/x/auth/types"
authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/genutil"
@@ -85,7 +85,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
}
// create concrete account type based on input parameters
var genAccount authexported.GenesisAccount
var genAccount types.GenesisAccount
balances := bank.Balance{Address: addr, Coins: coins.Sort()}
baseAccount := auth.NewBaseAccount(addr, nil, 0, 0)
+1 -2
View File
@@ -5,11 +5,10 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
authexported "github.com/cosmos/cosmos-sdk/x/auth/exported"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)
var _ authexported.GenesisAccount = (*SimGenesisAccount)(nil)
var _ authtypes.GenesisAccount = (*SimGenesisAccount)(nil)
// SimGenesisAccount defines a type that implements the GenesisAccount interface
// to be used for simulation accounts in the genesis state.
+1 -2
View File
@@ -20,7 +20,6 @@ import (
"github.com/cosmos/cosmos-sdk/simapp/helpers"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
authexported "github.com/cosmos/cosmos-sdk/x/auth/exported"
"github.com/cosmos/cosmos-sdk/x/bank"
)
@@ -70,7 +69,7 @@ func Setup(isCheckTx bool) *SimApp {
// SetupWithGenesisAccounts initializes a new SimApp with the provided genesis
// accounts and possible balances.
func SetupWithGenesisAccounts(genAccs []authexported.GenesisAccount, balances ...bank.Balance) *SimApp {
func SetupWithGenesisAccounts(genAccs []auth.GenesisAccount, balances ...bank.Balance) *SimApp {
db := dbm.NewMemDB()
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0)