Skip to content

Commit

Permalink
Update x/auth to use Any (cosmos#6165)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
sahith-narahari and aaronc authored May 20, 2020
1 parent 03ad996 commit 552a50b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cmd/simd/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions genesis_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 552a50b

Please sign in to comment.