Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- 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 DestroyLibEni(p *Proposal)
- func DownloadLibEni(p *Proposal, retryTimes int, result chan<- bool)
- func ErrApprovedProposal() error
- func ErrExceedsExpiration() error
- func ErrInsufficientBalance() error
- func ErrInsufficientParameters() error
- func ErrInvalidExpireBlockHeight() error
- func ErrInvalidExpireTimestamp() error
- func ErrInvalidFileurlJson() error
- func ErrInvalidMd5Json() error
- func ErrInvalidNewLib() error
- func ErrInvalidParameter() error
- func ErrInvalidValidator() error
- func ErrMissingSignature() error
- func ErrNoFileurl() error
- func ErrNoMd5() 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 NewTxDeployLibEniPropose(proposer *common.Address, name, version, fileurl, md5, 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 RegisterLibEni(p *Proposal)
- func ResetDeliverSqlTx()
- func SaveProposal(pp *Proposal)
- func SaveVote(vote *Vote)
- func SetDeliverSqlTx(tx *sql.Tx)
- func UpdateDeployLibEniStatus(pid, status string)
- func UpdateProposalResult(pid, result, msg string, blockHeight int64, resultAt string)
- func UpdateVote(vote *Vote)
- type Proposal
- func GetPendingProposals() (proposals []*Proposal)
- func GetProposalById(pid string) *Proposal
- func GetProposals() (proposals []*Proposal)
- func NewChangeParamProposal(id string, proposer *common.Address, blockHeight int64, ...) *Proposal
- func NewDeployLibEniProposal(id string, proposer *common.Address, blockHeight int64, ...) *Proposal
- func NewTransferFundProposal(id string, proposer *common.Address, blockHeight int64, from *common.Address, ...) *Proposal
- type ProposalReactor
- type SqlTxWrapper
- type TxChangeParamPropose
- type TxDeployLibEniPropose
- 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" TypeTxDeployLibEniPropose = governanceModuleName + "/propose/deploy_libeni" 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 ¶
View Source
var OTAInstance = eni.NewOTAInstance()
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 DestroyLibEni ¶
func DestroyLibEni(p *Proposal)
func DownloadLibEni ¶
func ErrApprovedProposal ¶
func ErrApprovedProposal() error
func ErrExceedsExpiration ¶
func ErrExceedsExpiration() error
func ErrInsufficientBalance ¶
func ErrInsufficientBalance() error
func ErrInsufficientParameters ¶
func ErrInsufficientParameters() error
func ErrInvalidExpireBlockHeight ¶
func ErrInvalidExpireBlockHeight() error
func ErrInvalidExpireTimestamp ¶
func ErrInvalidExpireTimestamp() error
func ErrInvalidFileurlJson ¶
func ErrInvalidFileurlJson() error
func ErrInvalidMd5Json ¶
func ErrInvalidMd5Json() error
func ErrInvalidNewLib ¶
func ErrInvalidNewLib() error
func ErrInvalidParameter ¶
func ErrInvalidParameter() error
func ErrInvalidValidator ¶
func ErrInvalidValidator() error
func ErrMissingSignature ¶
func ErrMissingSignature() error
func ErrNoFileurl ¶
func ErrNoFileurl() error
func ErrRejectedProposal ¶
func ErrRejectedProposal() error
func ErrRepeatedVote ¶
func ErrRepeatedVote() error
func NewTxChangeParamPropose ¶
func RegisterLibEni ¶
func RegisterLibEni(p *Proposal)
func ResetDeliverSqlTx ¶
func ResetDeliverSqlTx()
func SaveProposal ¶
func SaveProposal(pp *Proposal)
func SetDeliverSqlTx ¶
func UpdateDeployLibEniStatus ¶
func UpdateDeployLibEniStatus(pid, status string)
func UpdateProposalResult ¶
func UpdateVote ¶
func UpdateVote(vote *Vote)
Types ¶
type Proposal ¶
type Proposal struct { Id string Type string Proposer *common.Address BlockHeight int64 ExpireTimestamp int64 ExpireBlockHeight int64 CreatedAt string Result string ResultMsg string ResultBlockHeight int64 ResultAt string Detail map[string]interface{} }
func GetPendingProposals ¶
func GetPendingProposals() (proposals []*Proposal)
func GetProposalById ¶
func GetProposals ¶
func GetProposals() (proposals []*Proposal)
func NewChangeParamProposal ¶
func NewDeployLibEniProposal ¶
func NewTransferFundProposal ¶
type ProposalReactor ¶
func (ProposalReactor) React ¶
func (pr ProposalReactor) React(result, msg string)
type SqlTxWrapper ¶
type SqlTxWrapper struct {
// contains filtered or unexported fields
}
func (*SqlTxWrapper) Commit ¶
func (wrapper *SqlTxWrapper) Commit()
func (*SqlTxWrapper) Rollback ¶
func (wrapper *SqlTxWrapper) Rollback()
type TxChangeParamPropose ¶
type TxChangeParamPropose struct { Proposer *common.Address `json:"proposer"` Name string `json:"name"` Value string `json:"value"` Reason string `json:"reason"` ExpireTimestamp *int64 `json:"expire_timestamp"` ExpireBlockHeight *int64 `json:"expire_block_height"` }
func (TxChangeParamPropose) ValidateBasic ¶
func (tx TxChangeParamPropose) ValidateBasic() error
func (TxChangeParamPropose) Wrap ¶
func (tx TxChangeParamPropose) Wrap() sdk.Tx
type TxDeployLibEniPropose ¶
type TxDeployLibEniPropose struct { Proposer *common.Address `json:"proposer"` Name string `json:"name"` Version string `json:"version"` Fileurl string `json:"fileurl"` Md5 string `json:"md5"` Reason string `json:"reason"` ExpireTimestamp *int64 `json:"expire_timestamp"` ExpireBlockHeight *int64 `json:"expire_block_height"` }
func (TxDeployLibEniPropose) ValidateBasic ¶
func (tx TxDeployLibEniPropose) ValidateBasic() error
func (TxDeployLibEniPropose) Wrap ¶
func (tx TxDeployLibEniPropose) 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"` ExpireTimestamp *int64 `json:"expire_timestamp"` ExpireBlockHeight *int64 `json:"expire_block_height"` }
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.