types

package
v0.0.0-...-3606b63 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HashlockActionLock   = 1
	HashlockActionSend   = 2
	HashlockActionUnlock = 3
)

hashlock status

Variables

View Source
var (
	ErrHashlockAmount       = errors.New("ErrHashlockAmount")
	ErrHashlockHash         = errors.New("ErrHashlockHash")
	ErrHashlockStatus       = errors.New("ErrHashlockStatus")
	ErrTime                 = errors.New("ErrTime")
	ErrHashlockReturnAddrss = errors.New("ErrHashlockReturnAddrss")
	ErrHashlockTime         = errors.New("ErrHashlockTime")
	ErrHashlockReapeathash  = errors.New("ErrHashlockReapeathash")
	ErrHashlockSendAddress  = errors.New("ErrHashlockSendAddress")
)

hashlock errors

View Source
var (
	HashlockX            = "hashlock"
	ForkBadRepeatSecretX = "ForkBadRepeatSecret"
)

HashlockX name

Functions

func CreateRawHashlockLockTx

func CreateRawHashlockLockTx(parm *HashlockLockTx) (*types.Transaction, error)

CreateRawHashlockLockTx method

func CreateRawHashlockSendTx

func CreateRawHashlockSendTx(parm *HashlockSendTx) (*types.Transaction, error)

CreateRawHashlockSendTx method

func CreateRawHashlockUnlockTx

func CreateRawHashlockUnlockTx(parm *HashlockUnlockTx) (*types.Transaction, error)

CreateRawHashlockUnlockTx method

Types

type HashRecv

type HashRecv struct {
	HashlockId           []byte         `protobuf:"bytes,1,opt,name=HashlockId,proto3" json:"HashlockId,omitempty"`
	Information          *Hashlockquery `protobuf:"bytes,2,opt,name=Information,proto3" json:"Information,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*HashRecv) Descriptor

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

func (*HashRecv) GetHashlockId

func (m *HashRecv) GetHashlockId() []byte

func (*HashRecv) GetInformation

func (m *HashRecv) GetInformation() *Hashlockquery

func (*HashRecv) ProtoMessage

func (*HashRecv) ProtoMessage()

func (*HashRecv) Reset

func (m *HashRecv) Reset()

func (*HashRecv) String

func (m *HashRecv) String() string

func (*HashRecv) XXX_DiscardUnknown

func (m *HashRecv) XXX_DiscardUnknown()

func (*HashRecv) XXX_Marshal

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

func (*HashRecv) XXX_Merge

func (dst *HashRecv) XXX_Merge(src proto.Message)

func (*HashRecv) XXX_Size

func (m *HashRecv) XXX_Size() int

func (*HashRecv) XXX_Unmarshal

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

type Hashlock

type Hashlock struct {
	HashlockId           []byte   `protobuf:"bytes,1,opt,name=hashlockId,proto3" json:"hashlockId,omitempty"`
	Status               int32    `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
	CreateTime           int64    `protobuf:"varint,3,opt,name=CreateTime,proto3" json:"CreateTime,omitempty"`
	ToAddress            string   `protobuf:"bytes,4,opt,name=toAddress,proto3" json:"toAddress,omitempty"`
	ReturnAddress        string   `protobuf:"bytes,5,opt,name=returnAddress,proto3" json:"returnAddress,omitempty"`
	Amount               int64    `protobuf:"varint,6,opt,name=amount,proto3" json:"amount,omitempty"`
	Frozentime           int64    `protobuf:"varint,7,opt,name=frozentime,proto3" json:"frozentime,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Hashlock) Descriptor

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

func (*Hashlock) GetAmount

func (m *Hashlock) GetAmount() int64

func (*Hashlock) GetCreateTime

func (m *Hashlock) GetCreateTime() int64

func (*Hashlock) GetFrozentime

func (m *Hashlock) GetFrozentime() int64

func (*Hashlock) GetHashlockId

func (m *Hashlock) GetHashlockId() []byte

func (*Hashlock) GetReturnAddress

func (m *Hashlock) GetReturnAddress() string

func (*Hashlock) GetStatus

func (m *Hashlock) GetStatus() int32

func (*Hashlock) GetToAddress

func (m *Hashlock) GetToAddress() string

func (*Hashlock) ProtoMessage

func (*Hashlock) ProtoMessage()

func (*Hashlock) Reset

func (m *Hashlock) Reset()

func (*Hashlock) String

func (m *Hashlock) String() string

func (*Hashlock) XXX_DiscardUnknown

func (m *Hashlock) XXX_DiscardUnknown()

func (*Hashlock) XXX_Marshal

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

func (*Hashlock) XXX_Merge

func (dst *Hashlock) XXX_Merge(src proto.Message)

func (*Hashlock) XXX_Size

func (m *Hashlock) XXX_Size() int

func (*Hashlock) XXX_Unmarshal

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

type HashlockAction

type HashlockAction struct {
	// Types that are valid to be assigned to Value:
	//	*HashlockAction_Hlock
	//	*HashlockAction_Hsend
	//	*HashlockAction_Hunlock
	Value                isHashlockAction_Value `protobuf_oneof:"value"`
	Ty                   int32                  `protobuf:"varint,4,opt,name=ty,proto3" json:"ty,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

message for hashlock

func (*HashlockAction) Descriptor

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

func (*HashlockAction) GetHlock

func (m *HashlockAction) GetHlock() *HashlockLock

func (*HashlockAction) GetHsend

func (m *HashlockAction) GetHsend() *HashlockSend

func (*HashlockAction) GetHunlock

func (m *HashlockAction) GetHunlock() *HashlockUnlock

func (*HashlockAction) GetTy

func (m *HashlockAction) GetTy() int32

func (*HashlockAction) GetValue

func (m *HashlockAction) GetValue() isHashlockAction_Value

func (*HashlockAction) ProtoMessage

func (*HashlockAction) ProtoMessage()

func (*HashlockAction) Reset

func (m *HashlockAction) Reset()

func (*HashlockAction) String

func (m *HashlockAction) String() string

func (*HashlockAction) XXX_DiscardUnknown

func (m *HashlockAction) XXX_DiscardUnknown()

func (*HashlockAction) XXX_Marshal

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

func (*HashlockAction) XXX_Merge

func (dst *HashlockAction) XXX_Merge(src proto.Message)

func (*HashlockAction) XXX_OneofFuncs

func (*HashlockAction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*HashlockAction) XXX_Size

func (m *HashlockAction) XXX_Size() int

func (*HashlockAction) XXX_Unmarshal

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

type HashlockAction_Hlock

type HashlockAction_Hlock struct {
	Hlock *HashlockLock `protobuf:"bytes,1,opt,name=hlock,proto3,oneof"`
}

type HashlockAction_Hsend

type HashlockAction_Hsend struct {
	Hsend *HashlockSend `protobuf:"bytes,2,opt,name=hsend,proto3,oneof"`
}

type HashlockAction_Hunlock

type HashlockAction_Hunlock struct {
	Hunlock *HashlockUnlock `protobuf:"bytes,3,opt,name=hunlock,proto3,oneof"`
}

type HashlockLock

type HashlockLock struct {
	Amount               int64    `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"`
	Time                 int64    `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"`
	Hash                 []byte   `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"`
	ToAddress            string   `protobuf:"bytes,4,opt,name=toAddress,proto3" json:"toAddress,omitempty"`
	ReturnAddress        string   `protobuf:"bytes,5,opt,name=returnAddress,proto3" json:"returnAddress,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HashlockLock) Descriptor

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

func (*HashlockLock) GetAmount

func (m *HashlockLock) GetAmount() int64

func (*HashlockLock) GetHash

func (m *HashlockLock) GetHash() []byte

func (*HashlockLock) GetReturnAddress

func (m *HashlockLock) GetReturnAddress() string

func (*HashlockLock) GetTime

func (m *HashlockLock) GetTime() int64

func (*HashlockLock) GetToAddress

func (m *HashlockLock) GetToAddress() string

func (*HashlockLock) ProtoMessage

func (*HashlockLock) ProtoMessage()

func (*HashlockLock) Reset

func (m *HashlockLock) Reset()

func (*HashlockLock) String

func (m *HashlockLock) String() string

func (*HashlockLock) XXX_DiscardUnknown

func (m *HashlockLock) XXX_DiscardUnknown()

func (*HashlockLock) XXX_Marshal

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

func (*HashlockLock) XXX_Merge

func (dst *HashlockLock) XXX_Merge(src proto.Message)

func (*HashlockLock) XXX_Size

func (m *HashlockLock) XXX_Size() int

func (*HashlockLock) XXX_Unmarshal

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

type HashlockLockTx

type HashlockLockTx struct {
	Secret     string `json:"secret"`
	Amount     int64  `json:"amount"`
	Time       int64  `json:"time"`
	ToAddr     string `json:"toAddr"`
	ReturnAddr string `json:"returnAddr"`
	Fee        int64  `json:"fee"`
}

HashlockLockTx for construction

type HashlockSend

type HashlockSend struct {
	Secret               []byte   `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HashlockSend) Descriptor

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

func (*HashlockSend) GetSecret

func (m *HashlockSend) GetSecret() []byte

func (*HashlockSend) ProtoMessage

func (*HashlockSend) ProtoMessage()

func (*HashlockSend) Reset

func (m *HashlockSend) Reset()

func (*HashlockSend) String

func (m *HashlockSend) String() string

func (*HashlockSend) XXX_DiscardUnknown

func (m *HashlockSend) XXX_DiscardUnknown()

func (*HashlockSend) XXX_Marshal

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

func (*HashlockSend) XXX_Merge

func (dst *HashlockSend) XXX_Merge(src proto.Message)

func (*HashlockSend) XXX_Size

func (m *HashlockSend) XXX_Size() int

func (*HashlockSend) XXX_Unmarshal

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

type HashlockSendTx

type HashlockSendTx struct {
	Secret string `json:"secret"`
	Fee    int64  `json:"fee"`
}

HashlockSendTx for construction

type HashlockType

type HashlockType struct {
	types.ExecTypeBase
}

HashlockType def

func NewType

func NewType() *HashlockType

NewType method

func (*HashlockType) CreateTx

func (hashlock *HashlockType) CreateTx(action string, message json.RawMessage) (*types.Transaction, error)

CreateTx method

func (*HashlockType) GetLogMap

func (hashlock *HashlockType) GetLogMap() map[int64]*types.LogInfo

GetLogMap method

func (*HashlockType) GetName

func (hashlock *HashlockType) GetName() string

GetName 获取执行器名称

func (*HashlockType) GetPayload

func (hashlock *HashlockType) GetPayload() types.Message

GetPayload method

func (*HashlockType) GetTypeMap

func (hashlock *HashlockType) GetTypeMap() map[string]int32

GetTypeMap method

type HashlockUnlock

type HashlockUnlock struct {
	Secret               []byte   `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HashlockUnlock) Descriptor

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

func (*HashlockUnlock) GetSecret

func (m *HashlockUnlock) GetSecret() []byte

func (*HashlockUnlock) ProtoMessage

func (*HashlockUnlock) ProtoMessage()

func (*HashlockUnlock) Reset

func (m *HashlockUnlock) Reset()

func (*HashlockUnlock) String

func (m *HashlockUnlock) String() string

func (*HashlockUnlock) XXX_DiscardUnknown

func (m *HashlockUnlock) XXX_DiscardUnknown()

func (*HashlockUnlock) XXX_Marshal

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

func (*HashlockUnlock) XXX_Merge

func (dst *HashlockUnlock) XXX_Merge(src proto.Message)

func (*HashlockUnlock) XXX_Size

func (m *HashlockUnlock) XXX_Size() int

func (*HashlockUnlock) XXX_Unmarshal

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

type HashlockUnlockTx

type HashlockUnlockTx struct {
	Secret string `json:"secret"`
	Fee    int64  `json:"fee"`
}

HashlockUnlockTx for construction

type Hashlockquery

type Hashlockquery struct {
	Time                 int64    `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"`
	Status               int32    `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
	Amount               int64    `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
	CreateTime           int64    `protobuf:"varint,4,opt,name=createTime,proto3" json:"createTime,omitempty"`
	CurrentTime          int64    `protobuf:"varint,5,opt,name=currentTime,proto3" json:"currentTime,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Hashlockquery) Descriptor

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

func (*Hashlockquery) GetAmount

func (m *Hashlockquery) GetAmount() int64

func (*Hashlockquery) GetCreateTime

func (m *Hashlockquery) GetCreateTime() int64

func (*Hashlockquery) GetCurrentTime

func (m *Hashlockquery) GetCurrentTime() int64

func (*Hashlockquery) GetStatus

func (m *Hashlockquery) GetStatus() int32

func (*Hashlockquery) GetTime

func (m *Hashlockquery) GetTime() int64

func (*Hashlockquery) ProtoMessage

func (*Hashlockquery) ProtoMessage()

func (*Hashlockquery) Reset

func (m *Hashlockquery) Reset()

func (*Hashlockquery) String

func (m *Hashlockquery) String() string

func (*Hashlockquery) XXX_DiscardUnknown

func (m *Hashlockquery) XXX_DiscardUnknown()

func (*Hashlockquery) XXX_Marshal

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

func (*Hashlockquery) XXX_Merge

func (dst *Hashlockquery) XXX_Merge(src proto.Message)

func (*Hashlockquery) XXX_Size

func (m *Hashlockquery) XXX_Size() int

func (*Hashlockquery) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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