Documentation ¶
Overview ¶
Package validators is a generated protocol buffer package.
It is generated from these files:
x/validators/codec.proto
It has these top-level messages:
Validator PubKey SetValidators Accounts
Index ¶
- Constants
- Variables
- func AccountsWith(acct WeaveAccounts) orm.Object
- func ErrEmptyDiff() error
- func ErrWrongType(t interface{}) error
- func HasPermission(accts WeaveAccounts, checkAddress CheckAddress) bool
- func NewAccounts() orm.Object
- func NewBucket() orm.Bucket
- func RegisterQuery(qr weave.QueryRouter)
- func RegisterRoutes(r weave.Registry, auth x.Authenticator, control Controller)
- type Accounts
- func (m *Accounts) Copy() orm.CloneableData
- func (*Accounts) Descriptor() ([]byte, []int)
- func (m *Accounts) GetAddresses() [][]byte
- func (m *Accounts) Marshal() (dAtA []byte, err error)
- func (m *Accounts) MarshalTo(dAtA []byte) (int, error)
- func (*Accounts) ProtoMessage()
- func (m *Accounts) Reset()
- func (m *Accounts) Size() (n int)
- func (m *Accounts) String() string
- func (m *Accounts) Unmarshal(dAtA []byte) error
- func (m *Accounts) Validate() error
- type AuthCheckAddress
- type BaseController
- type CheckAddress
- type Controller
- type Initializer
- type PubKey
- func (m PubKey) AsABCI() abci.PubKey
- func (*PubKey) Descriptor() ([]byte, []int)
- func (m *PubKey) GetData() []byte
- func (m *PubKey) GetType() string
- func (m *PubKey) Marshal() (dAtA []byte, err error)
- func (m *PubKey) MarshalTo(dAtA []byte) (int, error)
- func (*PubKey) ProtoMessage()
- func (m *PubKey) Reset()
- func (m *PubKey) Size() (n int)
- func (m *PubKey) String() string
- func (m *PubKey) Unmarshal(dAtA []byte) error
- type SetValidators
- func (m *SetValidators) AsABCI() []abci.Validator
- func (*SetValidators) Descriptor() ([]byte, []int)
- func (m *SetValidators) GetValidators() []*Validator
- func (m *SetValidators) Marshal() (dAtA []byte, err error)
- func (m *SetValidators) MarshalTo(dAtA []byte) (int, error)
- func (*SetValidators) Path() string
- func (*SetValidators) ProtoMessage()
- func (m *SetValidators) Reset()
- func (m *SetValidators) Size() (n int)
- func (m *SetValidators) String() string
- func (m *SetValidators) Unmarshal(dAtA []byte) error
- type UpdateHandler
- type Validator
- func (m Validator) AsABCI() abci.Validator
- func (*Validator) Descriptor() ([]byte, []int)
- func (m *Validator) GetAddress() []byte
- func (m *Validator) GetPower() int64
- func (m *Validator) GetPubKey() PubKey
- func (m *Validator) Marshal() (dAtA []byte, err error)
- func (m *Validator) MarshalTo(dAtA []byte) (int, error)
- func (*Validator) ProtoMessage()
- func (m *Validator) Reset()
- func (m *Validator) Size() (n int)
- func (m *Validator) String() string
- func (m *Validator) Unmarshal(dAtA []byte) error
- type WeaveAccounts
Constants ¶
const ( CodeEmptyDiff uint32 = 40 CodeWrongType = 41 )
ABCI Response Codes x/update_validators reserves 40 ~ 49.
const ( // BucketName contains address that are allowed to update validators BucketName = "uvalid" // Key is used to store account data Key = "accounts" )
Variables ¶
var ( ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCodec = fmt.Errorf("proto: integer overflow") )
Functions ¶
func AccountsWith ¶
func AccountsWith(acct WeaveAccounts) orm.Object
func ErrEmptyDiff ¶
func ErrEmptyDiff() error
func ErrWrongType ¶
func ErrWrongType(t interface{}) error
func HasPermission ¶
func HasPermission(accts WeaveAccounts, checkAddress CheckAddress) bool
func NewAccounts ¶
NewWallet creates an empty wallet with this address serves as an object for the bucket
func RegisterQuery ¶
func RegisterQuery(qr weave.QueryRouter)
RegisterQuery will register this bucket as "/validators"
func RegisterRoutes ¶
func RegisterRoutes(r weave.Registry, auth x.Authenticator, control Controller)
RegisterRoutes will instantiate and register all handlers in this package
Types ¶
type Accounts ¶
type Accounts struct {
Addresses [][]byte `protobuf:"bytes,1,rep,name=addresses" json:"addresses,omitempty"`
}
Accounts is a list of accounts allowed to update validators
func AsAccounts ¶
func AsAccounts(a WeaveAccounts) *Accounts
func (*Accounts) Copy ¶
func (m *Accounts) Copy() orm.CloneableData
Copy makes new accounts object with the same addresses
func (*Accounts) Descriptor ¶
func (*Accounts) GetAddresses ¶
func (*Accounts) ProtoMessage ¶
func (*Accounts) ProtoMessage()
type AuthCheckAddress ¶
type AuthCheckAddress = func(auth x.Authenticator, ctx weave.Context) CheckAddress
type BaseController ¶
type BaseController struct {
// contains filtered or unexported fields
}
BaseController is a simple implementation of controller wallet must return something that supports AsSet
func NewController ¶
func NewController(bucket orm.Bucket) BaseController
NewController returns a basic controller implementation
func (BaseController) CanUpdateValidators ¶
func (c BaseController) CanUpdateValidators(store weave.KVStore, checkAddress CheckAddress, diff []abci.Validator) ([]abci.Validator, error)
type CheckAddress ¶
type Controller ¶
type Controller interface {
CanUpdateValidators(store weave.KVStore, checkAddress CheckAddress, diff []abci.Validator) ([]abci.Validator, error)
}
Controller is the functionality needed by cash.Handler and cash.Decorator. BaseController should work plenty fine, but you can add other logic if so desired
type Initializer ¶
type Initializer struct{}
Initializer fulfils the InitStater interface to load data from the genesis file
func (Initializer) FromGenesis ¶
FromGenesis will parse initial account info from genesis and save it to the database
type PubKey ¶
type PubKey struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` }
func (*PubKey) Descriptor ¶
func (*PubKey) ProtoMessage ¶
func (*PubKey) ProtoMessage()
type SetValidators ¶
type SetValidators struct {
Validators []*Validator `protobuf:"bytes,1,rep,name=validators" json:"validators,omitempty"`
}
This message is designed to update validator power
func (*SetValidators) AsABCI ¶
func (m *SetValidators) AsABCI() []abci.Validator
func (*SetValidators) Descriptor ¶
func (*SetValidators) Descriptor() ([]byte, []int)
func (*SetValidators) GetValidators ¶
func (m *SetValidators) GetValidators() []*Validator
func (*SetValidators) Marshal ¶
func (m *SetValidators) Marshal() (dAtA []byte, err error)
func (*SetValidators) Path ¶
func (*SetValidators) Path() string
Path returns the routing path for this message
func (*SetValidators) ProtoMessage ¶
func (*SetValidators) ProtoMessage()
func (*SetValidators) Reset ¶
func (m *SetValidators) Reset()
func (*SetValidators) Size ¶
func (m *SetValidators) Size() (n int)
func (*SetValidators) String ¶
func (m *SetValidators) String() string
func (*SetValidators) Unmarshal ¶
func (m *SetValidators) Unmarshal(dAtA []byte) error
type UpdateHandler ¶
type UpdateHandler struct {
// contains filtered or unexported fields
}
UpdateHandler will handle sending coins
func NewUpdateHandler ¶
func NewUpdateHandler(auth x.Authenticator, control Controller, checkAddr AuthCheckAddress) UpdateHandler
NewUpdateHandler creates a handler for SendMsg
type Validator ¶
type Validator struct { Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` PubKey PubKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey" json:"pub_key"` Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` }
Validator
func (*Validator) Descriptor ¶
func (*Validator) GetAddress ¶
func (*Validator) ProtoMessage ¶
func (*Validator) ProtoMessage()
type WeaveAccounts ¶
WeaveAccounts is used to parse the json from genesis file use weave.Address, so address in hex, not base64
func AsWeaveAccounts ¶
func AsWeaveAccounts(a *Accounts) WeaveAccounts
func (WeaveAccounts) Validate ¶
func (wa WeaveAccounts) Validate() error