multisig

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2019 License: Apache-2.0 Imports: 10 Imported by: 13

Documentation

Overview

Package multisig is a generated protocol buffer package.

It is generated from these files:

x/multisig/codec.proto

It has these top-level messages:

Contract
CreateContractMsg
UpdateContractMsg

Index

Constants

View Source
const (
	CodeInvalidMsg             = 1030
	CodeMultisigAuthentication = 1031
)

ABCI Response Codes multisig takes 1030-1040

View Source
const (
	// BucketName is where we store the contracts
	BucketName = "contracts"
	// SequenceName is an auto-increment ID counter for contracts
	SequenceName = "id"
)

Variables

View Source
var (
	ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCodec   = fmt.Errorf("proto: integer overflow")
)

Functions

func ErrContractNotFound

func ErrContractNotFound(contract []byte) error

func ErrInvalidActivationThreshold

func ErrInvalidActivationThreshold() error

func ErrInvalidChangeThreshold

func ErrInvalidChangeThreshold() error

func ErrMissingSigs

func ErrMissingSigs() error

func ErrUnauthorizedMultiSig

func ErrUnauthorizedMultiSig(contract []byte) error

func IsInvalidMsgErr

func IsInvalidMsgErr(err error) bool

func IsMultiSigAuthenticationErr

func IsMultiSigAuthenticationErr(err error) bool

func MultiSigCondition

func MultiSigCondition(id []byte) weave.Condition

MultiSigCondition returns condition for a contract ID

func RegisterQuery

func RegisterQuery(qr weave.QueryRouter)

RegisterQuery register queries from buckets in this package

func RegisterRoutes

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

RegisterRoutes will instantiate and register all handlers in this package

Types

type Authenticate

type Authenticate struct {
}

Authenticate gets/sets permissions on the given context key

func (Authenticate) GetConditions

func (a Authenticate) GetConditions(ctx weave.Context) []weave.Condition

GetConditions returns permissions previously set on this context

func (Authenticate) HasAddress

func (a Authenticate) HasAddress(ctx weave.Context, addr weave.Address) bool

HasAddress returns true iff this address is in GetConditions

type Contract

type Contract struct {
	// addresses to control it
	Sigs [][]byte `protobuf:"bytes,1,rep,name=sigs" json:"sigs,omitempty"`
	// threshold needed to sign to activate it
	ActivationThreshold int64 `protobuf:"varint,2,opt,name=activation_threshold,json=activationThreshold,proto3" json:"activation_threshold,omitempty"`
	// threshold needed to sign to change it
	AdminThreshold int64 `protobuf:"varint,3,opt,name=admin_threshold,json=adminThreshold,proto3" json:"admin_threshold,omitempty"`
}

func (*Contract) Copy

func (c *Contract) Copy() orm.CloneableData

Copy makes a new Profile with the same data

func (*Contract) Descriptor

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

func (*Contract) GetActivationThreshold

func (m *Contract) GetActivationThreshold() int64

func (*Contract) GetAdminThreshold

func (m *Contract) GetAdminThreshold() int64

func (*Contract) GetSigs

func (m *Contract) GetSigs() [][]byte

func (*Contract) Marshal

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

func (*Contract) MarshalTo

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

func (*Contract) ProtoMessage

func (*Contract) ProtoMessage()

func (*Contract) Reset

func (m *Contract) Reset()

func (*Contract) Size

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

func (*Contract) String

func (m *Contract) String() string

func (*Contract) Unmarshal

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

func (*Contract) Validate

func (c *Contract) Validate() error

Validate enforces sigs and threshold boundaries

type ContractBucket

type ContractBucket struct {
	orm.Bucket
	// contains filtered or unexported fields
}

ContractBucket is a type-safe wrapper around orm.Bucket

func NewContractBucket

func NewContractBucket() ContractBucket

NewContractBucket initializes a ContractBucket with default name

inherit Get and Save from orm.Bucket add run-time check on Save

func (ContractBucket) Build added in v0.10.0

func (b ContractBucket) Build(db weave.KVStore, c *Contract) orm.Object

Build assigns an ID to given contract instance and returns it as an orm Object. It does not persist the escrow in the store.

func (ContractBucket) Save

func (b ContractBucket) Save(db weave.KVStore, obj orm.Object) error

Save enforces the proper type

type CreateContractMsg

type CreateContractMsg struct {
	// addresses to control it
	Sigs [][]byte `protobuf:"bytes,1,rep,name=sigs" json:"sigs,omitempty"`
	// threshold needed to sign to activate it
	ActivationThreshold int64 `protobuf:"varint,2,opt,name=activation_threshold,json=activationThreshold,proto3" json:"activation_threshold,omitempty"`
	// threshold needed to sign to change it
	AdminThreshold int64 `protobuf:"varint,3,opt,name=admin_threshold,json=adminThreshold,proto3" json:"admin_threshold,omitempty"`
}

func (*CreateContractMsg) Descriptor

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

func (*CreateContractMsg) GetActivationThreshold

func (m *CreateContractMsg) GetActivationThreshold() int64

func (*CreateContractMsg) GetAdminThreshold

func (m *CreateContractMsg) GetAdminThreshold() int64

func (*CreateContractMsg) GetSigs

func (m *CreateContractMsg) GetSigs() [][]byte

func (*CreateContractMsg) Marshal

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

func (*CreateContractMsg) MarshalTo

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

func (CreateContractMsg) Path

func (CreateContractMsg) Path() string

Path fulfills weave.Msg interface to allow routing

func (*CreateContractMsg) ProtoMessage

func (*CreateContractMsg) ProtoMessage()

func (*CreateContractMsg) Reset

func (m *CreateContractMsg) Reset()

func (*CreateContractMsg) Size

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

func (*CreateContractMsg) String

func (m *CreateContractMsg) String() string

func (*CreateContractMsg) Unmarshal

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

func (*CreateContractMsg) Validate

func (c *CreateContractMsg) Validate() error

Validate enforces sigs and threshold boundaries

type CreateContractMsgHandler

type CreateContractMsgHandler struct {
	// contains filtered or unexported fields
}

func (CreateContractMsgHandler) Check

func (CreateContractMsgHandler) Deliver

type Decorator

type Decorator struct {
	// contains filtered or unexported fields
}

Decorator checks multisig contract if available

func NewDecorator

func NewDecorator(auth x.Authenticator) Decorator

NewDecorator returns a default multisig decorator

func (Decorator) Check

func (d Decorator) Check(ctx weave.Context, store weave.KVStore, tx weave.Tx, next weave.Checker) (weave.CheckResult, error)

Check enforce multisig contract before calling down the stack

func (Decorator) Deliver

func (d Decorator) Deliver(ctx weave.Context, store weave.KVStore, tx weave.Tx, next weave.Deliverer) (weave.DeliverResult, error)

Deliver enforces multisig contract before calling down the stack

type Initializer added in v0.10.0

type Initializer struct{}

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

func (*Initializer) FromGenesis added in v0.10.0

func (*Initializer) FromGenesis(opts weave.Options, db weave.KVStore) error

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

type MultiSigTx

type MultiSigTx interface {
	GetMultisig() [][]byte
}

MultiSigTx is an optional interface for a Tx that allows it to support multisig contract

type UpdateContractMsg

type UpdateContractMsg struct {
	// contract id
	Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// addresses to control it
	Sigs [][]byte `protobuf:"bytes,2,rep,name=sigs" json:"sigs,omitempty"`
	// threshold needed to sign to activate it
	ActivationThreshold int64 `protobuf:"varint,3,opt,name=activation_threshold,json=activationThreshold,proto3" json:"activation_threshold,omitempty"`
	// threshold needed to sign to change it
	AdminThreshold int64 `protobuf:"varint,4,opt,name=admin_threshold,json=adminThreshold,proto3" json:"admin_threshold,omitempty"`
}

func (*UpdateContractMsg) Descriptor

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

func (*UpdateContractMsg) GetActivationThreshold

func (m *UpdateContractMsg) GetActivationThreshold() int64

func (*UpdateContractMsg) GetAdminThreshold

func (m *UpdateContractMsg) GetAdminThreshold() int64

func (*UpdateContractMsg) GetId

func (m *UpdateContractMsg) GetId() []byte

func (*UpdateContractMsg) GetSigs

func (m *UpdateContractMsg) GetSigs() [][]byte

func (*UpdateContractMsg) Marshal

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

func (*UpdateContractMsg) MarshalTo

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

func (UpdateContractMsg) Path

func (UpdateContractMsg) Path() string

Path fulfills weave.Msg interface to allow routing

func (*UpdateContractMsg) ProtoMessage

func (*UpdateContractMsg) ProtoMessage()

func (*UpdateContractMsg) Reset

func (m *UpdateContractMsg) Reset()

func (*UpdateContractMsg) Size

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

func (*UpdateContractMsg) String

func (m *UpdateContractMsg) String() string

func (*UpdateContractMsg) Unmarshal

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

func (*UpdateContractMsg) Validate

func (c *UpdateContractMsg) Validate() error

Validate enforces sigs and threshold boundaries

type UpdateContractMsgHandler

type UpdateContractMsgHandler struct {
	// contains filtered or unexported fields
}

func (UpdateContractMsgHandler) Check

func (UpdateContractMsgHandler) Deliver

Jump to

Keyboard shortcuts

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