validators

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 11 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 RegisterQuery

func RegisterQuery(qr weave.QueryRouter)

RegisterQuery will register this bucket as "/validators".

func RegisterRoutes

func RegisterRoutes(r weave.Registry, auth x.Authenticator)

RegisterRoutes will instantiate and register all handlers in this package.

Types

type AccountBucket added in v0.15.0

type AccountBucket struct {
	orm.Bucket
}

func NewAccountBucket added in v0.15.0

func NewAccountBucket() *AccountBucket

func (*AccountBucket) GetAccounts added in v0.15.0

func (b *AccountBucket) GetAccounts(kv weave.KVStore) (*Accounts, error)

type Accounts

type Accounts struct {
	Metadata  *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	Addresses [][]byte        `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"`
}

Accounts is a list of accounts allowed to update validators

func AsAccounts

func AsAccounts(a WeaveAccounts) *Accounts

func (*Accounts) Descriptor

func (*Accounts) Descriptor() ([]byte, []int)

func (*Accounts) GetAddresses

func (m *Accounts) GetAddresses() [][]byte

func (*Accounts) GetMetadata added in v0.15.0

func (m *Accounts) GetMetadata() *weave.Metadata

func (*Accounts) Marshal

func (m *Accounts) Marshal() (dAtA []byte, err error)

func (*Accounts) MarshalTo

func (m *Accounts) MarshalTo(dAtA []byte) (int, error)

func (*Accounts) ProtoMessage

func (*Accounts) ProtoMessage()

func (*Accounts) Reset

func (m *Accounts) Reset()

func (*Accounts) Size

func (m *Accounts) Size() (n int)

func (*Accounts) String

func (m *Accounts) String() string

func (*Accounts) Unmarshal

func (m *Accounts) Unmarshal(dAtA []byte) error

func (*Accounts) Validate

func (m *Accounts) Validate() error

func (*Accounts) XXX_DiscardUnknown added in v0.12.0

func (m *Accounts) XXX_DiscardUnknown()

func (*Accounts) XXX_Marshal added in v0.12.0

func (m *Accounts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Accounts) XXX_Merge added in v0.12.0

func (m *Accounts) XXX_Merge(src proto.Message)

func (*Accounts) XXX_Size added in v0.12.0

func (m *Accounts) XXX_Size() int

func (*Accounts) XXX_Unmarshal added in v0.12.0

func (m *Accounts) XXX_Unmarshal(b []byte) error

type ApplyDiffMsg added in v0.17.0

type ApplyDiffMsg struct {
	Metadata         *weave.Metadata         `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	ValidatorUpdates []weave.ValidatorUpdate `protobuf:"bytes,2,rep,name=validator_updates,json=validatorUpdates,proto3" json:"validator_updates"`
}

ApplyDiffMsg is designed to update validator power

func (*ApplyDiffMsg) AsABCI added in v0.17.0

func (m *ApplyDiffMsg) AsABCI() []abci.ValidatorUpdate

func (*ApplyDiffMsg) Descriptor added in v0.17.0

func (*ApplyDiffMsg) Descriptor() ([]byte, []int)

func (*ApplyDiffMsg) GetMetadata added in v0.17.0

func (m *ApplyDiffMsg) GetMetadata() *weave.Metadata

func (*ApplyDiffMsg) GetValidatorUpdates added in v0.17.0

func (m *ApplyDiffMsg) GetValidatorUpdates() []weave.ValidatorUpdate

func (*ApplyDiffMsg) Marshal added in v0.17.0

func (m *ApplyDiffMsg) Marshal() (dAtA []byte, err error)

func (*ApplyDiffMsg) MarshalTo added in v0.17.0

func (m *ApplyDiffMsg) MarshalTo(dAtA []byte) (int, error)

func (*ApplyDiffMsg) Path added in v0.17.0

func (*ApplyDiffMsg) Path() string

Path implements weave.Msg interface.

func (*ApplyDiffMsg) ProtoMessage added in v0.17.0

func (*ApplyDiffMsg) ProtoMessage()

func (*ApplyDiffMsg) Reset added in v0.17.0

func (m *ApplyDiffMsg) Reset()

func (*ApplyDiffMsg) Size added in v0.17.0

func (m *ApplyDiffMsg) Size() (n int)

func (*ApplyDiffMsg) String added in v0.17.0

func (m *ApplyDiffMsg) String() string

func (*ApplyDiffMsg) Unmarshal added in v0.17.0

func (m *ApplyDiffMsg) Unmarshal(dAtA []byte) error

func (*ApplyDiffMsg) Validate added in v0.17.0

func (m *ApplyDiffMsg) Validate() error

func (*ApplyDiffMsg) XXX_DiscardUnknown added in v0.17.0

func (m *ApplyDiffMsg) XXX_DiscardUnknown()

func (*ApplyDiffMsg) XXX_Marshal added in v0.17.0

func (m *ApplyDiffMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ApplyDiffMsg) XXX_Merge added in v0.17.0

func (m *ApplyDiffMsg) XXX_Merge(src proto.Message)

func (*ApplyDiffMsg) XXX_Size added in v0.17.0

func (m *ApplyDiffMsg) XXX_Size() int

func (*ApplyDiffMsg) XXX_Unmarshal added in v0.17.0

func (m *ApplyDiffMsg) XXX_Unmarshal(b []byte) error

type Initializer

type Initializer struct{}

Initializer fulfils the InitStater interface to load data from the genesis file

func (Initializer) FromGenesis

func (Initializer) FromGenesis(opts weave.Options, params weave.GenesisParams, kv weave.KVStore) error

FromGenesis will parse initial account info from genesis and save it to the database

type WeaveAccounts

type WeaveAccounts struct {
	Addresses []weave.Address `json:"addresses"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL