mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-06-01 19:56:39 +00:00
32 lines
951 B
Go
32 lines
951 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) ReissueRDDLProposal(goCtx context.Context, msg *types.MsgReissueRDDLProposal) (*types.MsgReissueRDDLProposalResponse, error) {
|
|
ctx := sdk.UnwrapSDKContext(goCtx)
|
|
|
|
validator_identity, valid_result := util.GetValidatorCometBFTIdentity(ctx)
|
|
if valid_result && msg.Proposer == validator_identity {
|
|
// 1. sign tx
|
|
// 2. broadcast tx
|
|
|
|
txID := "asdlkufzaoisdfpoajf"
|
|
// 3. notarize result by notarizing the liquid tx-id
|
|
util.SendRDDLReissuanceResult(ctx, msg.GetProposer(), txID, msg.GetBlockheight())
|
|
}
|
|
|
|
var reissuance types.Reissuance
|
|
reissuance.BlockHeight = msg.GetBlockheight()
|
|
reissuance.Proposer = msg.GetProposer()
|
|
reissuance.Rawtx = msg.GetTx()
|
|
k.StoreReissuance(ctx, reissuance)
|
|
|
|
return &types.MsgReissueRDDLProposalResponse{}, nil
|
|
}
|