Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func CancelDownload(p *Proposal, bpanic bool)
- 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)
- func DownloadProgramCmd(p *Proposal) error
- func ErrApprovedProposal() error
- func ErrExceedsExpiration() error
- func ErrExpirationTooClose() 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 ErrOngoingLibFound() error
- func ErrOngoingRetiringFound() error
- func ErrRejectedProposal() error
- func ErrRepeatedVote() error
- func HasUndeployedProposal(name string) bool
- func InitState(module, key, value string, store state.SimpleDB) error
- func KillProgramCmd(p *Proposal) error
- func Name() string
- func NewTxChangeParamPropose(name string, value string, reason string, ...) sdk.Tx
- func NewTxDeployLibEniPropose(name, version, fileurl, md5, reason string, ...) sdk.Tx
- func NewTxRetireProgramPropose(preservedValidators, reason string, expireBlockHeight *int64) sdk.Tx
- func NewTxTransferFundPropose(fromAddr *common.Address, toAddr *common.Address, amount string, reason string, ...) sdk.Tx
- func NewTxUpgradeProgramPropose(name, version, fileurl, md5, reason string, expireBlockHeight *int64) sdk.Tx
- func NewTxVote(pid string, 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)
- func UpdateRetireProgramStatus(pid, status string)
- func UpdateVote(vote *Vote)
- func UpgradeProgramCmd(p *Proposal) error
- type Proposal
- func GetPendingProposals() (proposals []*Proposal)
- func GetProposalById(pid string) *Proposal
- func GetRetiringProposal(version string) *Proposal
- func GetUpgradingProposal(version string) *Proposal
- func NewChangeParamProposal(id string, proposer *common.Address, blockHeight int64, ...) *Proposal
- func NewDeployLibEniProposal(id string, proposer *common.Address, blockHeight int64, ...) *Proposal
- func NewRetireProgramProposal(id string, proposer *common.Address, blockHeight int64, ...) *Proposal
- func NewTransferFundProposal(id string, proposer *common.Address, blockHeight int64, from *common.Address, ...) *Proposal
- func NewUpgradeProgramProposal(id string, proposer *common.Address, blockHeight int64, ...) *Proposal
- func QueryProposals() (proposals []*Proposal)
- type ProposalReactor
- type SqlTxWrapper
- type TxChangeParamPropose
- type TxDeployLibEniPropose
- type TxRetireProgramPropose
- type TxTransferFundPropose
- type TxUpgradeProgramPropose
- type TxVote
- type Vote
Constants ¶
View Source
const ( ByteTxTransferFundPropose = 0xA1 ByteTxChangeParamPropose = 0xA2 ByteTxDeployLibEniPropose = 0xA3 ByteTxRetireProgramPropose = 0xA4 ByteTxUpgradeProgramPropose = 0xA5 ByteTxVote = 0xA6 TypeTxTransferFundPropose = governanceModuleName + "/propose/transfer_fund" TypeTxChangeParamPropose = governanceModuleName + "/propose/change_param" TypeTxDeployLibEniPropose = governanceModuleName + "/propose/deploy_libeni" TypeTxRetireProgramPropose = governanceModuleName + "/propose/retire_program" TypeTxUpgradeProgramPropose = governanceModuleName + "/propose/upgrade_program" 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 RETIRE_PROGRAM_PROPOSAL = "retire_program"
View Source
const TRANSFER_FUND_PROPOSAL = "transfer_fund"
View Source
const UPGRADE_PROGRAM_PROPOSAL = "upgrade_program"
Variables ¶
View Source
var OTAInstance = eni.NewOTAInstance()
Functions ¶
func CancelDownload ¶
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 DownloadLibEni(p *Proposal)
func DownloadProgramCmd ¶
DownloadProgramCmd download new program version
func ErrApprovedProposal ¶
func ErrApprovedProposal() error
func ErrExceedsExpiration ¶
func ErrExceedsExpiration() error
func ErrExpirationTooClose ¶
func ErrExpirationTooClose() 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 ErrOngoingLibFound ¶
func ErrOngoingLibFound() error
func ErrOngoingRetiringFound ¶
func ErrOngoingRetiringFound() error
func ErrRejectedProposal ¶
func ErrRejectedProposal() error
func ErrRepeatedVote ¶
func ErrRepeatedVote() error
func HasUndeployedProposal ¶
func KillProgramCmd ¶
KilProgramCmd kill the process from internal
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 UpdateRetireProgramStatus ¶
func UpdateRetireProgramStatus(pid, status string)
func UpdateVote ¶
func UpdateVote(vote *Vote)
func UpgradeProgramCmd ¶
UpgradeProgramCmd upgrade new program version
Types ¶
type Proposal ¶
type Proposal struct { Id string Type string Proposer *common.Address BlockHeight int64 ExpireTimestamp int64 ExpireBlockHeight int64 Result string ResultMsg string ResultBlockHeight int64 Detail map[string]interface{} }
func GetPendingProposals ¶
func GetPendingProposals() (proposals []*Proposal)
func GetProposalById ¶
func GetRetiringProposal ¶
func GetUpgradingProposal ¶
func NewChangeParamProposal ¶
func NewDeployLibEniProposal ¶
func NewTransferFundProposal ¶
func QueryProposals ¶
func QueryProposals() (proposals []*Proposal)
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 { 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 { Name string `json:"name"` Version string `json:"version"` FileUrl string `json:"file_url"` Md5 string `json:"md5"` Reason string `json:"reason"` ExpireTimestamp *int64 `json:"deploy_timestamp"` ExpireBlockHeight *int64 `json:"deploy_block_height"` }
func (TxDeployLibEniPropose) ValidateBasic ¶
func (tx TxDeployLibEniPropose) ValidateBasic() error
func (TxDeployLibEniPropose) Wrap ¶
func (tx TxDeployLibEniPropose) Wrap() sdk.Tx
type TxRetireProgramPropose ¶
type TxRetireProgramPropose struct { PreservedValidators string `json:"preserved_validators"` Reason string `json:"reason"` ExpireBlockHeight *int64 `json:"retired_block_height"` }
func (TxRetireProgramPropose) ValidateBasic ¶
func (tx TxRetireProgramPropose) ValidateBasic() error
func (TxRetireProgramPropose) Wrap ¶
func (tx TxRetireProgramPropose) Wrap() sdk.Tx
type TxTransferFundPropose ¶
type TxTransferFundPropose struct { From *common.Address `json:"transfer_from"` To *common.Address `json:"transfer_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 TxUpgradeProgramPropose ¶
type TxUpgradeProgramPropose struct { Name string `json:"name"` Version string `json:"version"` FileUrl string `json:"file_url"` Md5 string `json:"md5"` Reason string `json:"reason"` ExpireBlockHeight *int64 `json:"upgrade_block_height"` }
func (TxUpgradeProgramPropose) ValidateBasic ¶
func (tx TxUpgradeProgramPropose) ValidateBasic() error
func (TxUpgradeProgramPropose) Wrap ¶
func (tx TxUpgradeProgramPropose) Wrap() sdk.Tx
type TxVote ¶
func (TxVote) ValidateBasic ¶
Click to show internal directories.
Click to hide internal directories.