32 lines
740 B
Go
32 lines
740 B
Go
package keeper
|
|
|
|
import (
|
|
"context"
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"mukan/x/poj/types"
|
|
)
|
|
|
|
func (k Keeper) IsBootstrapping(ctx context.Context) bool {
|
|
sdkCtx := sdk.UnwrapSDKContext(ctx)
|
|
supply := k.bankKeeper.GetSupply(sdkCtx, "umc").Amount.Int64()
|
|
return supply < 100000000000
|
|
}
|
|
|
|
func (k Keeper) GetBankKeeper() types.BankKeeper {
|
|
return k.bankKeeper
|
|
}
|
|
|
|
func (k Keeper) GetParams(ctx context.Context) types.Params {
|
|
params, _ := k.Params.Get(ctx)
|
|
return params
|
|
}
|
|
|
|
func (k Keeper) HasBlockWinner(ctx context.Context, height int64) bool {
|
|
has, _ := k.BlockWinners.Has(ctx, height)
|
|
return has
|
|
}
|
|
|
|
func (k Keeper) SetBlockWinner(ctx context.Context, height int64, miner string) {
|
|
k.BlockWinners.Set(ctx, height, miner)
|
|
}
|