Skip to content

Commit

Permalink
have params on every line in wasm genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
jewei1997 committed Jul 12, 2024
1 parent 530874e commit a221177
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/wasm/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func ExportGenesisStream(ctx sdk.Context, keeper *Keeper) <-chan *types.GenesisS

keeper.IterateCodeInfos(ctx, func(codeID uint64, info types.CodeInfo) bool {
var genState types.GenesisState
genState.Params = keeper.GetParams(ctx)
bytecode, err := keeper.GetByteCode(ctx, codeID)
if err != nil {
panic(err)
Expand All @@ -163,6 +164,7 @@ func ExportGenesisStream(ctx sdk.Context, keeper *Keeper) <-chan *types.GenesisS
state = append(state, types.Model{Key: key, Value: value})
if len(state) > GENSIS_STATE_STREAM_BUF_THRESHOLD {
var genState types.GenesisState
genState.Params = keeper.GetParams(ctx)
genState.Contracts = append(genState.Contracts, types.Contract{
ContractAddress: addr.String(),
ContractInfo: contract,
Expand All @@ -175,6 +177,7 @@ func ExportGenesisStream(ctx sdk.Context, keeper *Keeper) <-chan *types.GenesisS
})
// flush any remaining state
var genState types.GenesisState
genState.Params = keeper.GetParams(ctx)
genState.Contracts = append(genState.Contracts, types.Contract{
ContractAddress: addr.String(),
ContractInfo: contract,
Expand All @@ -187,6 +190,7 @@ func ExportGenesisStream(ctx sdk.Context, keeper *Keeper) <-chan *types.GenesisS

for _, k := range [][]byte{types.KeyLastCodeID, types.KeyLastInstanceID} {
var genState types.GenesisState
genState.Params = keeper.GetParams(ctx)
genState.Sequences = append(genState.Sequences, types.Sequence{
IDKey: k,
Value: keeper.PeekAutoIncrementID(ctx, k),
Expand Down

0 comments on commit a221177

Please sign in to comment.