Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- func CheckProposal(pid string, voter *common.Address) string
- func CheckTx(ctx types.Context, store state.SimpleDB, tx sdk.Tx) (res sdk.CheckResult, err error)
- func DeliverTx(ctx types.Context, store state.SimpleDB, tx sdk.Tx, hash []byte) (res sdk.DeliverResult, err error)
- func ErrApprovedProposal() error
- func ErrInsufficientBalance() error
- func ErrInvalidParameter() error
- func ErrInvalidValidator() error
- func ErrMissingSignature() error
- func ErrRejectedProposal() error
- func ErrRepeatedVote() error
- func InitState(module, key, value string, store state.SimpleDB) error
- func Name() string
- func NewTxChangeParamPropose(proposer *common.Address, name string, value string, reason string, ...) sdk.Tx
- func NewTxTransferFundPropose(proposer *common.Address, fromAddr *common.Address, toAddr *common.Address, ...) sdk.Tx
- func NewTxVote(pid string, voter common.Address, answer string) sdk.Tx
- func SaveProposal(pp *Proposal)
- func SaveVote(vote *Vote)
- func UpdateProposalResult(pid, result, msg string, blockHeight uint64, resultAt string)
- type Proposal
- func GetPendingProposals() (proposals []*Proposal)
- func GetProposalById(pid string) *Proposal
- func GetProposals() (proposals []*Proposal)
- func NewChangeParamProposal(id string, proposer *common.Address, blockHeight uint64, ...) *Proposal
- func NewTransferFundProposal(id string, proposer *common.Address, blockHeight uint64, from *common.Address, ...) *Proposal
- type ProposalReactor
- type TxChangeParamPropose
- type TxTransferFundPropose
- type TxVote
- type Vote
Constants ¶
View Source
const ( ByteTxTransferFundPropose = 0xA1 ByteTxChangeParamPropose = 0xA2 ByteTxDeployLibEniPropose = 0xA3 ByteTxVote = 0xA4 TypeTxTransferFundPropose = governanceModuleName + "/propose/transfer_fund" TypeTxChangeParamPropose = governanceModuleName + "/propose/change_param" TypeTxVote = governanceModuleName + "/vote" )
register the tx type with its validation logic make sure to use the name of the handler as the prefix in the tx type, so it gets routed properly
View Source
const CHANGE_PARAM_PROPOSAL = "change_param"
View Source
const DEPLOY_LIBENI_PROPOSAL = "deploy_libeni"
View Source
const TRANSFER_FUND_PROPOSAL = "transfer_fund"
Variables ¶
This section is empty.
Functions ¶
func DeliverTx ¶
func DeliverTx(ctx types.Context, store state.SimpleDB, tx sdk.Tx, hash []byte) (res sdk.DeliverResult, err error)
DeliverTx executes the tx if valid
func ErrApprovedProposal ¶
func ErrApprovedProposal() error
func ErrInsufficientBalance ¶
func ErrInsufficientBalance() error
func ErrInvalidParameter ¶
func ErrInvalidParameter() error
func ErrInvalidValidator ¶
func ErrInvalidValidator() error
func ErrMissingSignature ¶
func ErrMissingSignature() error
func ErrRejectedProposal ¶
func ErrRejectedProposal() error
func ErrRepeatedVote ¶
func ErrRepeatedVote() error
func NewTxChangeParamPropose ¶
func SaveProposal ¶
func SaveProposal(pp *Proposal)
func UpdateProposalResult ¶
Types ¶
type Proposal ¶
type Proposal struct { Id string Type string Proposer *common.Address BlockHeight uint64 ExpireBlockHeight uint64 CreatedAt string Result string ResultMsg string ResultBlockHeight uint64 ResultAt string Detail map[string]interface{} }
func GetPendingProposals ¶
func GetPendingProposals() (proposals []*Proposal)
func GetProposalById ¶
func GetProposals ¶
func GetProposals() (proposals []*Proposal)
func NewChangeParamProposal ¶
func NewTransferFundProposal ¶
type ProposalReactor ¶
func (ProposalReactor) React ¶
func (pr ProposalReactor) React(result, msg string)
type TxChangeParamPropose ¶
type TxChangeParamPropose struct { Proposer *common.Address `json:"proposer"` Name string `json:"name"` Value string `json:"value"` Reason string `json:"reason"` Expire uint64 `json:"expire"` }
func (TxChangeParamPropose) ValidateBasic ¶
func (tx TxChangeParamPropose) ValidateBasic() error
func (TxChangeParamPropose) Wrap ¶
func (tx TxChangeParamPropose) Wrap() sdk.Tx
type TxTransferFundPropose ¶
type TxTransferFundPropose struct { Proposer *common.Address `json:"proposer"` From *common.Address `json:"from"` To *common.Address `json:"to"` Amount string `json:"amount"` Reason string `json:"reason"` Expire uint64 `json:"expire"` }
func (TxTransferFundPropose) ValidateBasic ¶
func (tx TxTransferFundPropose) ValidateBasic() error
func (TxTransferFundPropose) Wrap ¶
func (tx TxTransferFundPropose) Wrap() sdk.Tx
type TxVote ¶
type TxVote struct { ProposalId string `json:"proposal_id"` Voter common.Address `json:"voter"` Answer string `json:"answer"` }
func (TxVote) ValidateBasic ¶
Click to show internal directories.
Click to hide internal directories.