planetmint-go/x/dao/client/cli/tx_reissue_rddl_proposal.go
Lorenz Herzberger 94830df5fc
184 implement staged claim (#190)
* adjust issuePoPRewards to mint stagedCRDDL
* add GetChallengeRange
* add resolveStagedClaims on ReissueRDDLResult msg
* move claim resolve to distribution result
* add StagedDenom and ClaimDenom to config
* added the prepare4linting.sh script
* renamed PoPEpochs to PopEpochs
* renamed DistributionAddressPoP to DistributionAddressPop
* added config value ReIssuanceEpochs
* detached the re-issuance from the distribution process and schedule them independently
* changed logging messages
* added an explicit util/kv_serialize.go file to have all KV serialization done
* switched to Bigendian serialization of int64 to have the ordered list on the kvstore
* added ComputeReIssuanceValue to enable re-issuances once a day or defined by ReIssuanceEpoch
* integrated a ReIssuanceValue computation test case
* adjusted the challenges test cases to be epoch-dependent
* added ReIssuances per ReIssuanceEpoch
* extended the Reissue message
* checking ReIssuanceProposal in the ante handler
* added precision setter for the UINT to RDDL token converter (and test cases)
* add e2e test case for pop rewards


Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Co-authored-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-12-05 10:51:06 +01:00

61 lines
1.3 KiB
Go

package cli
import (
"strconv"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/planetmint/planetmint-go/x/dao/types"
"github.com/spf13/cast"
"github.com/spf13/cobra"
)
var _ = strconv.Itoa(0)
func CmdReissueRDDLProposal() *cobra.Command {
cmd := &cobra.Command{
Use: "reissue-rddl-proposal [proposer] [tx] [blockheight] [firstincludedpop] [lastincludedpop]",
Short: "Broadcast message reissueRDDLProposal",
Args: cobra.ExactArgs(5),
RunE: func(cmd *cobra.Command, args []string) (err error) {
argProposer := args[0]
argTx := args[1]
argBlockHeight, err := cast.ToInt64E(args[2])
if err != nil {
return err
}
firstIncludedPop, err := cast.ToInt64E(args[3])
if err != nil {
return err
}
lastIncludedPop, err := cast.ToInt64E(args[4])
if err != nil {
return err
}
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}
msg := types.NewMsgReissueRDDLProposal(
clientCtx.GetFromAddress().String(),
argProposer,
argTx,
argBlockHeight,
firstIncludedPop,
lastIncludedPop,
)
if err := msg.ValidateBasic(); err != nil {
return err
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
}
flags.AddTxFlagsToCmd(cmd)
return cmd
}