Documentation ¶
Overview ¶
Create call message type.
Implement error codes and messages.
Vote types (addresses slice).
Index ¶
- Constants
- Variables
- func ErrAlreadyConfirmed(id uint64) sdk.Error
- func ErrAlreadyRejected(id uint64) sdk.Error
- func ErrCallAlreadyApproved(id uint64, address string) sdk.Error
- func ErrCallNotApproved(id uint64, address string) sdk.Error
- func ErrEmptyRoute(id uint64) sdk.Error
- func ErrEmptyType(id uint64) sdk.Error
- func ErrNoVotes(id uint64) sdk.Error
- func ErrNotFoundUniqueID(uniqueID string) sdk.Error
- func ErrNotUniqueID(uniqueID string) sdk.Error
- func ErrNotValidator(validator string) sdk.Error
- func ErrOnlyMultisig(codeSpase sdk.CodespaceType, moduleName string) sdk.Error
- func ErrRouteDoesntExist(route string) sdk.Error
- func ErrWrongCallId(id uint64) sdk.Error
- func GetCallByIdKey(id uint64) []byte
- func GetKeyVotesById(id uint64) []byte
- func GetPrefixQueue(height int64) []byte
- func GetQueueKey(id uint64, height int64) []byte
- func GetUniqueID(uniqueID string) []byte
- type Call
- type CallReq
- type CallResp
- type CallsResp
- type GenesisState
- type LastIdRes
- type Params
- type UniqueReq
- type Votes
Constants ¶
const ( ModuleName = "multisig" RouterKey = ModuleName DefaultCodespace = ModuleName DefaultParamspace = ModuleName )
Default constants.
const ( CodeErrRouteDoesntExist = 101 CodeErrWrongCallId = 102 CodeErrEmptyRoute = 103 CodeErrEmptyType = 104 CodeErrOnlyMs = 105 CodeErrAlreadyApproved = 201 CodeErrAlreadyConfirmed = 202 CodeErrAlreadyRerejected = 203 CodeErrNotApproved = 204 CodeErrNoVotes = 301 CodeNotValidator = 401 CodeNotUniqueID = 402 CodeNotFoundUniqueID = 403 )
Error codes.
const ( DefIntervalToExecute = 86400 // interval in blocks to execute proposal. MinIntervalToExecute = 10 )
Default parameters.
Variables ¶
var ( KeyDelimiter = []byte(":") LastCallId = []byte("lastCallId") LastExCallId = []byte("lastExCallId") PrefixQueue = []byte("callsQueue") )
Storage keys.
var (
KeyIntervalToExecute = []byte("IntervalToExecute")
)
Keys to store parameters.
Functions ¶
func ErrCallAlreadyApproved ¶
CallID already approved by address
func ErrCallNotApproved ¶
CallID not approved by address
func ErrEmptyType ¶
Msg.Type is empty (could be empty if we use MsMsg interface)
func ErrNotFoundUniqueID ¶
Call by uniqueID not found
func ErrNotValidator ¶
TX received from not validator (POA module)
func ErrOnlyMultisig ¶
func ErrOnlyMultisig(codeSpase sdk.CodespaceType, moduleName string) sdk.Error
Only multisig calls supported for module.
func ErrRouteDoesntExist ¶
Msg.Route not found in router
func ErrWrongCallId ¶
CallID not found in store / CallID > (NextCallID - 1)
func GetKeyVotesById ¶
Get a key to store votes for call by id.
Types ¶
type Call ¶
type Call struct { Creator sdk.AccAddress `json:"creator" swaggertype:"string" format:"bech32" example:"wallet13jyjuz3kkdvqw8u4qfkwd94emdl3vx394kn07h"` MsgID uint64 `json:"msg_id" example:"0"` // Call ID UniqueID string `json:"unique_id" example:"issue1"` // Call uniqueID Approved bool `json:"approved"` // Call is approved to execute Executed bool `json:"executed"` // Call was executed Failed bool `json:"failed"` // Call failed to execute Rejected bool `json:"rejected"` // Call was rejected Error string `json:"error"` // Call failed reason Msg core.MsMsg `json:"msg_data"` // Message to execute MsgRoute string `json:"msg_route" example:"oracle"` // Message route MsgType string `json:"msg_type" example:"add_asset"` // Message type Height int64 `json:"height" example:"1"` // BlockHeight when call was submitted }
Call that will be executed itself, contains msg instances, that executing via router and handler.
type CallReq ¶
type CallReq struct {
CallId uint64 `json:"call_id"`
}
Request to get call by call id.
type CallResp ¶
type CallResp struct { Call Call `json:"call"` // Call info Votes Votes `json:"votes" swaggertype:"array,string"` // Accounts address array }
Type to get a call as response with votes.
type CallsResp ¶
type CallsResp []CallResp
Slice of call responses (in case of multiplay calls to response).
type GenesisState ¶
type GenesisState struct {
Parameters Params `json:"parameters"`
}
Genesis state parameters contains genesis data.
type Params ¶
type Params struct {
IntervalToExecute int64 `json:"interval_to_execute"`
}
Describing parameters for multisig module.
func DefaultParams ¶
func DefaultParams() Params
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs