planetmint-go/util/issue_commands.go
Jürgen Eckel f69c978911
added SendRDDLReissuanceResult sending by the proposer after the consensus over the ReissuanceProposal
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-10-05 17:49:59 +02:00

41 lines
1.2 KiB
Go

package util
import (
"fmt"
"os/exec"
"strconv"
sdk "github.com/cosmos/cosmos-sdk/types"
)
func InitRDDLReissuanceProcess(ctx sdk.Context, proposerAddress string, blk_height int64) error {
tx_unsigned, err := GetUnsignedReissuanceTransaction()
//blk_height := 0 //get_last_PoPBlockHeight() // TODO: to be read form the upcoming PoP-store
// Construct the command
cmd := exec.Command("planetmint-god", "tx", "dao", "reissue-rddl-proposal", hexProposerAddress, tx_unsigned, strconv.FormatInt(blk_height, 10))
// Start the command in a non-blocking way
err = cmd.Start()
if err != nil {
fmt.Printf("Error starting command: %s\n", err)
} else {
fmt.Println("Command started in background")
}
return err
}
func SendRDDLReissuanceResult(ctx sdk.Context, proposerAddress string, txID string, blk_height uint64) error {
// Construct the command
cmd := exec.Command("planetmint-god", "tx", "dao", "reissue-rddl-result", hexProposerAddress, txID, strconv.FormatInt(blk_height, 10))
// Start the command in a non-blocking way
err := cmd.Start()
if err != nil {
fmt.Printf("Error starting command: %s\n", err)
} else {
fmt.Println("Command started in background")
}
return err
}