mirror of
https://github.com/planetmint/planetmint-go.git
synced 2026-03-21 07:38:30 +00:00
* distributed & result msgs * added DistributionResult * added RDDL token conversion methods * set proper validatoraddress within the testcases for e2e/dao * set proper root dir for test cases * fixed some wordings --------- Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
59 lines
2.2 KiB
Go
59 lines
2.2 KiB
Go
package util
|
|
|
|
import (
|
|
"os/exec"
|
|
"strconv"
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/planetmint/planetmint-go/config"
|
|
"github.com/planetmint/planetmint-go/x/dao/types"
|
|
)
|
|
|
|
func InitRDDLReissuanceProcess(ctx sdk.Context, proposerAddress string, txUnsigned string, blockHeight int64) error {
|
|
//get_last_PoPBlockHeight() // TODO: to be read form the upcoming PoP-store
|
|
logger := ctx.Logger()
|
|
// Construct the command
|
|
sendingValidatorAddress := config.GetConfig().ValidatorAddress
|
|
logger.Debug("REISSUE: create Proposal")
|
|
cmd := exec.Command("planetmint-god", "tx", "dao", "reissue-rddl-proposal",
|
|
"--from", sendingValidatorAddress, "-y",
|
|
proposerAddress, txUnsigned, strconv.FormatInt(blockHeight, 10))
|
|
|
|
logger.Debug("REISSUE: create Proposal")
|
|
return cmd.Start()
|
|
}
|
|
|
|
func SendRDDLReissuanceResult(ctx sdk.Context, proposerAddress string, txID string, blockHeight int64) error {
|
|
logger := ctx.Logger()
|
|
// Construct the command
|
|
sendingValidatorAddress := config.GetConfig().ValidatorAddress
|
|
logger.Debug("REISSUE: create Result")
|
|
cmd := exec.Command("planetmint-god", "tx", "dao", "reissue-rddl-result",
|
|
"--from", sendingValidatorAddress, "-y",
|
|
proposerAddress, txID, strconv.FormatInt(blockHeight, 10))
|
|
logger.Debug("REISSUE: create Result")
|
|
return cmd.Start()
|
|
}
|
|
|
|
func SendRDDLDistributionRequest(ctx sdk.Context, distribution types.DistributionOrder) error {
|
|
logger := ctx.Logger()
|
|
// Construct the command
|
|
sendingValidatorAddress := config.GetConfig().ValidatorAddress
|
|
cmd := exec.Command("planetmint-god", "tx", "dao", "distribution-request",
|
|
"--from", sendingValidatorAddress, "-y", "'"+distribution.String()+"'")
|
|
logger.Debug("REISSUE: create Result")
|
|
return cmd.Start()
|
|
}
|
|
|
|
func SendRDDLDistributionResult(ctx sdk.Context, lastPoP string, daoTxid string, invTxid string, popTxid string) error {
|
|
logger := ctx.Logger()
|
|
// Construct the command
|
|
sendingValidatorAddress := config.GetConfig().ValidatorAddress
|
|
logger.Debug("REISSUE: create Result")
|
|
cmd := exec.Command("planetmint-god", "tx", "dao", "distribution-result",
|
|
"--from", sendingValidatorAddress, "-y",
|
|
lastPoP, daoTxid, invTxid, popTxid)
|
|
logger.Debug("REISSUE: create Result")
|
|
return cmd.Start()
|
|
}
|