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 ErrCantParseCallId(sid 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 LastIdRes
- type UniqueReq
- type Votes
Constants ¶
const ( ModuleName = "multisig" RouterKey = ModuleName DefaultCodespace = ModuleName IntervalToExecute int64 = 86400 // interval in blocks to execute proposal. )
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.
Variables ¶
var ( KeyDelimiter = []byte(":") LastCallId = []byte("lastCallId") LastExCallId = []byte("lastExCallId") PrefixQueue = []byte("callsQueue") )
Storage keys.
Functions ¶
func ErrAlreadyConfirmed ¶
When call already executed.
func ErrCallAlreadyApproved ¶
When call already approved by address.
func ErrCallNotApproved ¶
When call not approved by address.
func ErrEmptyRoute ¶
When msg route is empty (could be empty if we use MsMsg interface).
func ErrEmptyType ¶
When msg route is empty (could be empty if we use MsMsg interface).
func ErrNotFoundUniqueID ¶
When call not found by unique id.
func ErrNotUniqueID ¶
When unique id already used in past.
func ErrOnlyMultisig ¶
func ErrOnlyMultisig(codeSpase sdk.CodespaceType, moduleName string) sdk.Error
Only multisig calls supported for module.
func ErrRouteDoesntExist ¶
When msg route doesnt exist.
func ErrWrongCallId ¶
When call with provided id doesnt exist.
func GetKeyVotesById ¶
Get a key to store votes for call by id.
Types ¶
type Call ¶
type Call struct { // Creator Creator sdk.AccAddress `json:"creator"` // ID MsgID uint64 `json:"msg_id"` // Unique ID UniqueID string `json:"unique_id"` // When call approved to execute Approved bool `json:"approved"` // Execution failed or executed Executed bool `json:"executed"` Failed bool `json:"failed"` // If call was rejected Rejected bool `json:"rejected"` Error string `json:"error"` // Msg to execute Msg core.MsMsg `json:"msg_data"` // Msg route MsgRoute string `json:"msg_route"` // Msg type MsgType string `json:"msg_type"` // Height when call submitted Height int64 `json:"height"` }
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 CallsResp ¶
type CallsResp []CallResp
Slice of call responses (in case of multiplay calls to response).