x/auth genesis protobuf migration (#6880)

* Add auth genesis.proto and related changes

* Add UnpackInterfaces method to auth GenesisState

* Remove unrelevant test case

* Update proto/cosmos/auth/genesis.proto

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* Add test for auth types ConvertAccountsAny

* Apply naming suggestions

* Update x/auth/types/genesis_test.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Marie
2020-07-29 16:00:15 +00:00
committed by GitHub
co-authored by Federico Kunze mergify[bot]
parent 9592f34cde
commit bc7e943158
10 changed files with 573 additions and 40 deletions
+6 -1
View File
@@ -136,7 +136,12 @@ func initGenFiles(cfg Config, genAccounts []authtypes.GenesisAccount, genBalance
var authGenState authtypes.GenesisState
cfg.Codec.MustUnmarshalJSON(cfg.GenesisState[authtypes.ModuleName], &authGenState)
authGenState.Accounts = genAccounts
accounts, err := authtypes.PackAccounts(genAccounts)
if err != nil {
return err
}
authGenState.Accounts = accounts
cfg.GenesisState[authtypes.ModuleName] = cfg.Codec.MustMarshalJSON(authGenState)
// set the balances in the genesis state