export refactor, lcd tests borken
This commit is contained in:
parent
318e924145
commit
f7587f7847
|
@ -125,14 +125,19 @@ func (app *BasecoinApp) initChainer(ctx sdk.Context, req abci.RequestInitChain)
|
||||||
// Custom logic for state export
|
// Custom logic for state export
|
||||||
func (app *BasecoinApp) ExportAppStateJSON() (appState json.RawMessage, err error) {
|
func (app *BasecoinApp) ExportAppStateJSON() (appState json.RawMessage, err error) {
|
||||||
ctx := app.NewContext(true, abci.Header{})
|
ctx := app.NewContext(true, abci.Header{})
|
||||||
|
|
||||||
|
// iterate to get the accounts
|
||||||
accounts := []*types.GenesisAccount{}
|
accounts := []*types.GenesisAccount{}
|
||||||
app.accountMapper.IterateAccounts(ctx, func(a sdk.Account) bool {
|
appendAccount := func(acc sdk.Account) (stop bool) {
|
||||||
accounts = append(accounts, &types.GenesisAccount{
|
account := &types.GenesisAccount{
|
||||||
Address: a.GetAddress(),
|
Address: acc.GetAddress(),
|
||||||
Coins: a.GetCoins(),
|
Coins: acc.GetCoins(),
|
||||||
})
|
}
|
||||||
|
accounts = append(accounts, account)
|
||||||
return false
|
return false
|
||||||
})
|
}
|
||||||
|
app.accountMapper.IterateAccounts(ctx, appendAccount)
|
||||||
|
|
||||||
genState := types.GenesisState{
|
genState := types.GenesisState{
|
||||||
Accounts: accounts,
|
Accounts: accounts,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue