Documentation ¶
Overview ¶
Package escrow is a generated protocol buffer package.
It is generated from these files:
x/escrow/codec.proto
It has these top-level messages:
Escrow CreateEscrowMsg ReleaseEscrowMsg ReturnEscrowMsg UpdateEscrowPartiesMsg
Index ¶
- Constants
- Variables
- func Condition(key []byte) weave.Condition
- func ErrEscrowExpired(timeout int64) error
- func ErrEscrowNotExpired(timeout int64) error
- func ErrInvalidCondition(perm []byte) error
- func ErrInvalidEscrowID(id []byte) error
- func ErrInvalidMemo(memo string) error
- func ErrInvalidTimeout(timeout int64) error
- func ErrMissingAllConditions() error
- func ErrMissingArbiter() error
- func ErrMissingRecipient() error
- func ErrMissingSender() error
- func ErrNoSuchEscrow(id []byte) error
- func IsInvalidConditionErr(err error) bool
- func IsInvalidMetadataErr(err error) bool
- func IsMissingConditionErr(err error) bool
- func IsNoSuchEscrowErr(err error) bool
- func NewController(cash cash.Controller, bucket Bucket) *controller
- func NewEscrow(id []byte, sender, rcpt weave.Address, arb weave.Condition, amount x.Coins, ...) orm.Object
- func RegisterQuery(qr weave.QueryRouter)
- func RegisterRoutes(r weave.Registry, auth x.Authenticator, cashctrl cash.Controller)
- type Bucket
- type CreateEscrowHandler
- type CreateEscrowMsg
- func (*CreateEscrowMsg) Descriptor() ([]byte, []int)
- func (m *CreateEscrowMsg) GetAmount() []*x.Coin
- func (m *CreateEscrowMsg) GetArbiter() []byte
- func (m *CreateEscrowMsg) GetMemo() string
- func (m *CreateEscrowMsg) GetRecipient() []byte
- func (m *CreateEscrowMsg) GetSrc() []byte
- func (m *CreateEscrowMsg) GetTimeout() int64
- func (m *CreateEscrowMsg) Marshal() (dAtA []byte, err error)
- func (m *CreateEscrowMsg) MarshalTo(dAtA []byte) (int, error)
- func (CreateEscrowMsg) Path() string
- func (*CreateEscrowMsg) ProtoMessage()
- func (m *CreateEscrowMsg) Reset()
- func (m *CreateEscrowMsg) Size() (n int)
- func (m *CreateEscrowMsg) String() string
- func (m *CreateEscrowMsg) Unmarshal(dAtA []byte) error
- func (m *CreateEscrowMsg) Validate() error
- type Escrow
- func (e *Escrow) Copy() orm.CloneableData
- func (*Escrow) Descriptor() ([]byte, []int)
- func (m *Escrow) GetAmount() []*x.Coin
- func (m *Escrow) GetArbiter() []byte
- func (m *Escrow) GetMemo() string
- func (m *Escrow) GetRecipient() []byte
- func (m *Escrow) GetSender() []byte
- func (m *Escrow) GetTimeout() int64
- func (m *Escrow) Marshal() (dAtA []byte, err error)
- func (m *Escrow) MarshalTo(dAtA []byte) (int, error)
- func (*Escrow) ProtoMessage()
- func (m *Escrow) Reset()
- func (m *Escrow) Size() (n int)
- func (m *Escrow) String() string
- func (m *Escrow) Unmarshal(dAtA []byte) error
- func (e *Escrow) Validate() error
- type ReleaseEscrowHandler
- type ReleaseEscrowMsg
- func (*ReleaseEscrowMsg) Descriptor() ([]byte, []int)
- func (m *ReleaseEscrowMsg) GetAmount() []*x.Coin
- func (m *ReleaseEscrowMsg) GetEscrowId() []byte
- func (m *ReleaseEscrowMsg) Marshal() (dAtA []byte, err error)
- func (m *ReleaseEscrowMsg) MarshalTo(dAtA []byte) (int, error)
- func (ReleaseEscrowMsg) Path() string
- func (*ReleaseEscrowMsg) ProtoMessage()
- func (m *ReleaseEscrowMsg) Reset()
- func (m *ReleaseEscrowMsg) Size() (n int)
- func (m *ReleaseEscrowMsg) String() string
- func (m *ReleaseEscrowMsg) Unmarshal(dAtA []byte) error
- func (m *ReleaseEscrowMsg) Validate() error
- type ReturnEscrowHandler
- type ReturnEscrowMsg
- func (*ReturnEscrowMsg) Descriptor() ([]byte, []int)
- func (m *ReturnEscrowMsg) GetEscrowId() []byte
- func (m *ReturnEscrowMsg) Marshal() (dAtA []byte, err error)
- func (m *ReturnEscrowMsg) MarshalTo(dAtA []byte) (int, error)
- func (ReturnEscrowMsg) Path() string
- func (*ReturnEscrowMsg) ProtoMessage()
- func (m *ReturnEscrowMsg) Reset()
- func (m *ReturnEscrowMsg) Size() (n int)
- func (m *ReturnEscrowMsg) String() string
- func (m *ReturnEscrowMsg) Unmarshal(dAtA []byte) error
- func (m *ReturnEscrowMsg) Validate() error
- type UpdateEscrowHandler
- type UpdateEscrowPartiesMsg
- func (*UpdateEscrowPartiesMsg) Descriptor() ([]byte, []int)
- func (m *UpdateEscrowPartiesMsg) GetArbiter() []byte
- func (m *UpdateEscrowPartiesMsg) GetEscrowId() []byte
- func (m *UpdateEscrowPartiesMsg) GetRecipient() []byte
- func (m *UpdateEscrowPartiesMsg) GetSender() []byte
- func (m *UpdateEscrowPartiesMsg) Marshal() (dAtA []byte, err error)
- func (m *UpdateEscrowPartiesMsg) MarshalTo(dAtA []byte) (int, error)
- func (UpdateEscrowPartiesMsg) Path() string
- func (*UpdateEscrowPartiesMsg) ProtoMessage()
- func (m *UpdateEscrowPartiesMsg) Reset()
- func (m *UpdateEscrowPartiesMsg) Size() (n int)
- func (m *UpdateEscrowPartiesMsg) String() string
- func (m *UpdateEscrowPartiesMsg) Unmarshal(dAtA []byte) error
- func (m *UpdateEscrowPartiesMsg) Validate() error
Constants ¶
const ( CodeNoEscrow = 1010 CodeMissingCondition = 1011 CodeInvalidCondition = 1012 CodeInvalidMetadata = 1013 CodeInvalidHeight = 1014 )
ABCI Response Codes bov takes 1000-1100 escrow takes 1010-1020
const ( // BucketName is where we store the escrows BucketName = "esc" // SequenceName is an auto-increment ID counter for escrows SequenceName = "id" )
Variables ¶
var ( ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCodec = fmt.Errorf("proto: integer overflow") )
Functions ¶
func ErrEscrowExpired ¶
func ErrEscrowNotExpired ¶
func ErrInvalidCondition ¶
func ErrInvalidEscrowID ¶
func ErrInvalidMemo ¶
func ErrInvalidTimeout ¶
func ErrMissingAllConditions ¶
func ErrMissingAllConditions() error
func ErrMissingArbiter ¶
func ErrMissingArbiter() error
func ErrMissingRecipient ¶
func ErrMissingRecipient() error
func ErrMissingSender ¶
func ErrMissingSender() error
func ErrNoSuchEscrow ¶
func IsInvalidConditionErr ¶
func IsInvalidMetadataErr ¶
func IsMissingConditionErr ¶
func IsNoSuchEscrowErr ¶
func NewController ¶ added in v0.9.0
func NewController(cash cash.Controller, bucket Bucket) *controller
func NewEscrow ¶
func NewEscrow(id []byte, sender, rcpt weave.Address, arb weave.Condition, amount x.Coins, timeout int64, memo string) orm.Object
NewEscrow creates an escrow orm.Object
func RegisterQuery ¶
func RegisterQuery(qr weave.QueryRouter)
RegisterQuery will register this bucket as "/escrows"
func RegisterRoutes ¶
func RegisterRoutes(r weave.Registry, auth x.Authenticator, cashctrl cash.Controller)
RegisterRoutes will instantiate and register all handlers in this package
Types ¶
type Bucket ¶
Bucket is a type-safe wrapper around orm.Bucket
func NewBucket ¶
func NewBucket() Bucket
NewBucket initializes a Bucket with default name
inherit Get and Save from orm.Bucket add Create
type CreateEscrowHandler ¶
type CreateEscrowHandler struct {
// contains filtered or unexported fields
}
CreateEscrowHandler will set a name for objects in this bucket
type CreateEscrowMsg ¶
type CreateEscrowMsg struct { // Sender, Arbiter, Recipient are all weave.Permission Src []byte `protobuf:"bytes,1,opt,name=src,proto3" json:"src,omitempty"` Arbiter []byte `protobuf:"bytes,2,opt,name=arbiter,proto3" json:"arbiter,omitempty"` Recipient []byte `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` // amount may contain multiple token types Amount []*x.Coin `protobuf:"bytes,4,rep,name=amount" json:"amount,omitempty"` // if unreleased before timeout, will return to sender Timeout int64 `protobuf:"varint,5,opt,name=timeout,proto3" json:"timeout,omitempty"` // max length 128 character Memo string `protobuf:"bytes,6,opt,name=memo,proto3" json:"memo,omitempty"` }
CreateEscrowMsg is a request to create an Escrow with some tokens. If sender is not defined, it defaults to the first signer The rest must be defined
func NewCreateMsg ¶
func NewCreateMsg(send, rcpt weave.Address, arb weave.Condition, amount x.Coins, timeout int64, memo string) *CreateEscrowMsg
NewCreateMsg is a helper to quickly build a create escrow message
func (*CreateEscrowMsg) Descriptor ¶
func (*CreateEscrowMsg) Descriptor() ([]byte, []int)
func (*CreateEscrowMsg) GetAmount ¶
func (m *CreateEscrowMsg) GetAmount() []*x.Coin
func (*CreateEscrowMsg) GetArbiter ¶
func (m *CreateEscrowMsg) GetArbiter() []byte
func (*CreateEscrowMsg) GetMemo ¶
func (m *CreateEscrowMsg) GetMemo() string
func (*CreateEscrowMsg) GetRecipient ¶
func (m *CreateEscrowMsg) GetRecipient() []byte
func (*CreateEscrowMsg) GetSrc ¶ added in v0.9.0
func (m *CreateEscrowMsg) GetSrc() []byte
func (*CreateEscrowMsg) GetTimeout ¶
func (m *CreateEscrowMsg) GetTimeout() int64
func (*CreateEscrowMsg) Marshal ¶
func (m *CreateEscrowMsg) Marshal() (dAtA []byte, err error)
func (CreateEscrowMsg) Path ¶
func (CreateEscrowMsg) Path() string
Path fulfills weave.Msg interface to allow routing
func (*CreateEscrowMsg) ProtoMessage ¶
func (*CreateEscrowMsg) ProtoMessage()
func (*CreateEscrowMsg) Reset ¶
func (m *CreateEscrowMsg) Reset()
func (*CreateEscrowMsg) Size ¶
func (m *CreateEscrowMsg) Size() (n int)
func (*CreateEscrowMsg) String ¶
func (m *CreateEscrowMsg) String() string
func (*CreateEscrowMsg) Unmarshal ¶
func (m *CreateEscrowMsg) Unmarshal(dAtA []byte) error
func (*CreateEscrowMsg) Validate ¶
func (m *CreateEscrowMsg) Validate() error
Validate makes sure that this is sensible
type Escrow ¶
type Escrow struct { // Sender, Arbiter, Recipient are all weave.Permission Sender []byte `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` Arbiter []byte `protobuf:"bytes,2,opt,name=arbiter,proto3" json:"arbiter,omitempty"` Recipient []byte `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` // amount may contain multiple token types Amount []*x.Coin `protobuf:"bytes,4,rep,name=amount" json:"amount,omitempty"` // if unreleased before timeout, will return to sender // timeout stored here is absolute block height Timeout int64 `protobuf:"varint,5,opt,name=timeout,proto3" json:"timeout,omitempty"` // max length 128 character Memo string `protobuf:"bytes,6,opt,name=memo,proto3" json:"memo,omitempty"` }
Escrow holds some coins. The arbiter or sender can release them to the recipient. The recipient can return them to the sender. Upon timeout, they will be returned to the sender.
Note that if the arbiter is a Hashlock permission, we have an HTLC ;)
func AsEscrow ¶
AsEscrow extracts an *Escrow value or nil from the object Must be called on a Bucket result that is an *Escrow, will panic on bad type.
func (*Escrow) Copy ¶
func (e *Escrow) Copy() orm.CloneableData
Copy makes a new set with the same coins
func (*Escrow) Descriptor ¶
func (*Escrow) GetArbiter ¶
func (*Escrow) GetRecipient ¶
func (*Escrow) GetTimeout ¶
func (*Escrow) ProtoMessage ¶
func (*Escrow) ProtoMessage()
type ReleaseEscrowHandler ¶
type ReleaseEscrowHandler struct {
// contains filtered or unexported fields
}
ReleaseEscrowHandler will set a name for objects in this bucket
type ReleaseEscrowMsg ¶
type ReleaseEscrowMsg struct { EscrowId []byte `protobuf:"bytes,1,opt,name=escrow_id,json=escrowId,proto3" json:"escrow_id,omitempty"` Amount []*x.Coin `protobuf:"bytes,2,rep,name=amount" json:"amount,omitempty"` }
ReleaseEscrowMsg releases the content to the recipient. Must be authorized by sender or arbiter. If amount not provided, defaults to entire escrow, May be a subset of the current balance.
func (*ReleaseEscrowMsg) Descriptor ¶
func (*ReleaseEscrowMsg) Descriptor() ([]byte, []int)
func (*ReleaseEscrowMsg) GetAmount ¶
func (m *ReleaseEscrowMsg) GetAmount() []*x.Coin
func (*ReleaseEscrowMsg) GetEscrowId ¶
func (m *ReleaseEscrowMsg) GetEscrowId() []byte
func (*ReleaseEscrowMsg) Marshal ¶
func (m *ReleaseEscrowMsg) Marshal() (dAtA []byte, err error)
func (ReleaseEscrowMsg) Path ¶
func (ReleaseEscrowMsg) Path() string
Path fulfills weave.Msg interface to allow routing
func (*ReleaseEscrowMsg) ProtoMessage ¶
func (*ReleaseEscrowMsg) ProtoMessage()
func (*ReleaseEscrowMsg) Reset ¶
func (m *ReleaseEscrowMsg) Reset()
func (*ReleaseEscrowMsg) Size ¶
func (m *ReleaseEscrowMsg) Size() (n int)
func (*ReleaseEscrowMsg) String ¶
func (m *ReleaseEscrowMsg) String() string
func (*ReleaseEscrowMsg) Unmarshal ¶
func (m *ReleaseEscrowMsg) Unmarshal(dAtA []byte) error
func (*ReleaseEscrowMsg) Validate ¶
func (m *ReleaseEscrowMsg) Validate() error
Validate makes sure that this is sensible
type ReturnEscrowHandler ¶
type ReturnEscrowHandler struct {
// contains filtered or unexported fields
}
ReturnEscrowHandler will set a name for objects in this bucket
type ReturnEscrowMsg ¶
type ReturnEscrowMsg struct {
EscrowId []byte `protobuf:"bytes,1,opt,name=escrow_id,json=escrowId,proto3" json:"escrow_id,omitempty"`
}
ReturnEscrowMsg returns the content to the sender. Must be authorized by the sender or an expired timeout
func (*ReturnEscrowMsg) Descriptor ¶
func (*ReturnEscrowMsg) Descriptor() ([]byte, []int)
func (*ReturnEscrowMsg) GetEscrowId ¶
func (m *ReturnEscrowMsg) GetEscrowId() []byte
func (*ReturnEscrowMsg) Marshal ¶
func (m *ReturnEscrowMsg) Marshal() (dAtA []byte, err error)
func (ReturnEscrowMsg) Path ¶
func (ReturnEscrowMsg) Path() string
Path fulfills weave.Msg interface to allow routing
func (*ReturnEscrowMsg) ProtoMessage ¶
func (*ReturnEscrowMsg) ProtoMessage()
func (*ReturnEscrowMsg) Reset ¶
func (m *ReturnEscrowMsg) Reset()
func (*ReturnEscrowMsg) Size ¶
func (m *ReturnEscrowMsg) Size() (n int)
func (*ReturnEscrowMsg) String ¶
func (m *ReturnEscrowMsg) String() string
func (*ReturnEscrowMsg) Unmarshal ¶
func (m *ReturnEscrowMsg) Unmarshal(dAtA []byte) error
func (*ReturnEscrowMsg) Validate ¶
func (m *ReturnEscrowMsg) Validate() error
Validate always returns true for no data
type UpdateEscrowHandler ¶
type UpdateEscrowHandler struct {
// contains filtered or unexported fields
}
UpdateEscrowHandler will set a name for objects in this bucket
type UpdateEscrowPartiesMsg ¶
type UpdateEscrowPartiesMsg struct { EscrowId []byte `protobuf:"bytes,1,opt,name=escrow_id,json=escrowId,proto3" json:"escrow_id,omitempty"` Sender []byte `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` Arbiter []byte `protobuf:"bytes,3,opt,name=arbiter,proto3" json:"arbiter,omitempty"` Recipient []byte `protobuf:"bytes,4,opt,name=recipient,proto3" json:"recipient,omitempty"` }
UpdateEscrowPartiesMsg changes any of the parties of the escrow: sender, arbiter, recipient. This must be authorized by the current holder of that position (eg. only sender can update sender).
Represents delegating responsibility
func (*UpdateEscrowPartiesMsg) Descriptor ¶
func (*UpdateEscrowPartiesMsg) Descriptor() ([]byte, []int)
func (*UpdateEscrowPartiesMsg) GetArbiter ¶
func (m *UpdateEscrowPartiesMsg) GetArbiter() []byte
func (*UpdateEscrowPartiesMsg) GetEscrowId ¶
func (m *UpdateEscrowPartiesMsg) GetEscrowId() []byte
func (*UpdateEscrowPartiesMsg) GetRecipient ¶
func (m *UpdateEscrowPartiesMsg) GetRecipient() []byte
func (*UpdateEscrowPartiesMsg) GetSender ¶
func (m *UpdateEscrowPartiesMsg) GetSender() []byte
func (*UpdateEscrowPartiesMsg) Marshal ¶
func (m *UpdateEscrowPartiesMsg) Marshal() (dAtA []byte, err error)
func (*UpdateEscrowPartiesMsg) MarshalTo ¶
func (m *UpdateEscrowPartiesMsg) MarshalTo(dAtA []byte) (int, error)
func (UpdateEscrowPartiesMsg) Path ¶
func (UpdateEscrowPartiesMsg) Path() string
Path fulfills weave.Msg interface to allow routing
func (*UpdateEscrowPartiesMsg) ProtoMessage ¶
func (*UpdateEscrowPartiesMsg) ProtoMessage()
func (*UpdateEscrowPartiesMsg) Reset ¶
func (m *UpdateEscrowPartiesMsg) Reset()
func (*UpdateEscrowPartiesMsg) Size ¶
func (m *UpdateEscrowPartiesMsg) Size() (n int)
func (*UpdateEscrowPartiesMsg) String ¶
func (m *UpdateEscrowPartiesMsg) String() string
func (*UpdateEscrowPartiesMsg) Unmarshal ¶
func (m *UpdateEscrowPartiesMsg) Unmarshal(dAtA []byte) error
func (*UpdateEscrowPartiesMsg) Validate ¶
func (m *UpdateEscrowPartiesMsg) Validate() error
Validate makes sure any included items are valid permissions and there is at least one change