mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-06-24 23:12:30 +00:00

* added InitPoP message * added getChallenge query to inspect challenges * adjusted towards a unique block height identification unit: int64, not uint64 * added challenge param finished to identify challenges that weren't completed but will be part of re-issuance. Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
23 lines
556 B
Go
23 lines
556 B
Go
package keeper
|
|
|
|
import (
|
|
"context"
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/planetmint/planetmint-go/x/dao/types"
|
|
)
|
|
|
|
func (k msgServer) InitPop(goCtx context.Context, msg *types.MsgInitPop) (*types.MsgInitPopResponse, error) {
|
|
ctx := sdk.UnwrapSDKContext(goCtx)
|
|
|
|
var challenge types.Challenge
|
|
challenge.Initiator = msg.GetInitiator()
|
|
challenge.Challengee = msg.GetChallengee()
|
|
challenge.Challenger = msg.GetChallenger()
|
|
challenge.Height = msg.GetHeight()
|
|
|
|
k.StoreChallenge(ctx, challenge)
|
|
|
|
return &types.MsgInitPopResponse{}, nil
|
|
}
|