mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-09-13 11:50:11 +00:00

* Initializing rootDir of dao and machine keeper with the home path of the validator key material * added Block height logging of context decorator * removed SetRoot usage * fixed data races of the attest machine go-routine * reproduction of the issue * fixed testing URL issue * refactored the machine-nft functions/mock * fixed keeper.param read-bug that increased the gas prices in an inconsistent way * increased the validator number to 3 for all e2e tests * added go routine to attest machine workflow --------- Signed-off-by: Julian Strobl <jmastr@mailbox.org> Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com> Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com> Co-authored-by: Julian Strobl <jmastr@mailbox.org> Co-authored-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
29 lines
803 B
Go
29 lines
803 B
Go
package keeper
|
|
|
|
import (
|
|
"context"
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/planetmint/planetmint-go/util"
|
|
"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)
|
|
|
|
validatorIdentity, validResult := util.GetValidatorCometBFTIdentity(ctx, k.RootDir)
|
|
if validResult && msg.Initiator == validatorIdentity {
|
|
go util.SendMqttPopInitMessagesToServer(ctx, challenge)
|
|
}
|
|
|
|
return &types.MsgInitPopResponse{}, nil
|
|
}
|