Skip to content

Commit

Permalink
Keeper & genesis bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Segfaultd committed Apr 28, 2022
1 parent 47a1ce9 commit 942b900
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 4 additions & 1 deletion x/beam/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) (res []abci.ValidatorUpdate) {
k.CreateBeamModuleAccount(ctx, genState.ModuleAccountBalance)

for _, beam := range genState.Beams {
k.SetBeam(ctx, beam.GetId(), beam)
}
return nil
}

Expand All @@ -19,7 +22,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {
beams := k.ListBeams(ctx)

return &types.GenesisState{
Beams: beams,
Beams: beams,
ModuleAccountBalance: k.GetBeamAccountBalance(ctx),
}
}
6 changes: 2 additions & 4 deletions x/beam/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
"strings"
"time"

"github.com/tendermint/tendermint/libs/log"
"strings"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -253,7 +251,7 @@ func (k Keeper) OpenBeam(ctx sdk.Context, msg types.MsgOpenBeam) error {
CancelReason: "",
Schema: msg.GetSchema(),
Data: msg.GetData(),
CreatedAt: time.Now(),
CreatedAt: ctx.BlockTime(),
}

if msg.GetAmount() != nil && msg.GetAmount().IsPositive() {
Expand Down

0 comments on commit 942b900

Please sign in to comment.