common

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: Apache-2.0 Imports: 10 Imported by: 52

Documentation

Index

Constants

View Source
const TicksPerBlock = int64(1000)

Variables

View Source
var File_common_proto protoreflect.FileDescriptor

Functions

func AddressArrayToEth added in v0.5.0

func AddressArrayToEth(addresses []Address) []ethcommon.Address

func SetDurationPerBlock

func SetDurationPerBlock(d time.Duration)

Types

type Address

type Address [20]byte

func AddressArrayFromEth added in v0.5.0

func AddressArrayFromEth(addresses []ethcommon.Address) []Address

func HexToAddress

func HexToAddress(hex string) Address

func NewAddressFromEth

func NewAddressFromEth(a ethcommon.Address) Address

func (Address) Equals

func (a Address) Equals(a2 Address) bool

func (Address) Hex

func (a Address) Hex() string

func (Address) IsZero

func (a Address) IsZero() bool

func (Address) MarshallToBuf

func (a Address) MarshallToBuf() *AddressBuf

func (Address) ShortString

func (a Address) ShortString() string

func (Address) String

func (a Address) String() string

func (Address) ToEthAddress

func (a Address) ToEthAddress() ethcommon.Address

type AddressBuf

type AddressBuf struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*AddressBuf) Descriptor deprecated

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

Deprecated: Use AddressBuf.ProtoReflect.Descriptor instead.

func (*AddressBuf) GetValue

func (x *AddressBuf) GetValue() []byte

func (*AddressBuf) ProtoMessage

func (*AddressBuf) ProtoMessage()

func (*AddressBuf) ProtoReflect added in v0.5.0

func (x *AddressBuf) ProtoReflect() protoreflect.Message

func (*AddressBuf) Reset

func (x *AddressBuf) Reset()

func (*AddressBuf) String

func (x *AddressBuf) String() string

func (*AddressBuf) Unmarshal

func (a *AddressBuf) Unmarshal() Address

type BigIntegerBuf

type BigIntegerBuf struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func MarshalBigInt

func MarshalBigInt(bi *big.Int) *BigIntegerBuf

func (*BigIntegerBuf) Descriptor deprecated

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

Deprecated: Use BigIntegerBuf.ProtoReflect.Descriptor instead.

func (*BigIntegerBuf) GetValue

func (x *BigIntegerBuf) GetValue() []byte

func (*BigIntegerBuf) ProtoMessage

func (*BigIntegerBuf) ProtoMessage()

func (*BigIntegerBuf) ProtoReflect added in v0.5.0

func (x *BigIntegerBuf) ProtoReflect() protoreflect.Message

func (*BigIntegerBuf) Reset

func (x *BigIntegerBuf) Reset()

func (*BigIntegerBuf) String

func (x *BigIntegerBuf) String() string

func (*BigIntegerBuf) Unmarshal

func (buf *BigIntegerBuf) Unmarshal() *big.Int

type BlockId

type BlockId struct {
	Height     *TimeBlocks
	HeaderHash Hash
}

func (*BlockId) Clone

func (id *BlockId) Clone() *BlockId

func (*BlockId) Equals

func (id *BlockId) Equals(id2 *BlockId) bool

func (*BlockId) MarshalToBuf

func (id *BlockId) MarshalToBuf() *BlockIdBuf

func (*BlockId) String

func (id *BlockId) String() string

type BlockIdBuf

type BlockIdBuf struct {
	Height     *TimeBlocksBuf `protobuf:"bytes,1,opt,name=height,proto3" json:"height,omitempty"`
	HeaderHash *HashBuf       `protobuf:"bytes,2,opt,name=headerHash,proto3" json:"headerHash,omitempty"`
	// contains filtered or unexported fields
}

func (*BlockIdBuf) Descriptor deprecated

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

Deprecated: Use BlockIdBuf.ProtoReflect.Descriptor instead.

func (*BlockIdBuf) GetHeaderHash

func (x *BlockIdBuf) GetHeaderHash() *HashBuf

func (*BlockIdBuf) GetHeight

func (x *BlockIdBuf) GetHeight() *TimeBlocksBuf

func (*BlockIdBuf) ProtoMessage

func (*BlockIdBuf) ProtoMessage()

func (*BlockIdBuf) ProtoReflect added in v0.5.0

func (x *BlockIdBuf) ProtoReflect() protoreflect.Message

func (*BlockIdBuf) Reset

func (x *BlockIdBuf) Reset()

func (*BlockIdBuf) String

func (x *BlockIdBuf) String() string

func (*BlockIdBuf) Unmarshal

func (idb *BlockIdBuf) Unmarshal() *BlockId

type Hash

type Hash [32]byte

func NewHashFromEth

func NewHashFromEth(a ethcommon.Hash) Hash

func (Hash) Bytes

func (h Hash) Bytes() []byte

func (Hash) Equals

func (h Hash) Equals(h2 Hash) bool

func (Hash) MarshalToBuf

func (h Hash) MarshalToBuf() *HashBuf

func (Hash) ShortString

func (h Hash) ShortString() string

func (Hash) String

func (h Hash) String() string

func (Hash) ToEthHash

func (h Hash) ToEthHash() ethcommon.Hash

type HashBuf

type HashBuf struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func MarshalSliceOfHashes

func MarshalSliceOfHashes(hs []Hash) []*HashBuf

func (*HashBuf) Descriptor deprecated

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

Deprecated: Use HashBuf.ProtoReflect.Descriptor instead.

func (*HashBuf) GetValue

func (x *HashBuf) GetValue() []byte

func (*HashBuf) ProtoMessage

func (*HashBuf) ProtoMessage()

func (*HashBuf) ProtoReflect added in v0.5.0

func (x *HashBuf) ProtoReflect() protoreflect.Message

func (*HashBuf) Reset

func (x *HashBuf) Reset()

func (*HashBuf) String

func (x *HashBuf) String() string

func (*HashBuf) Unmarshal

func (hb *HashBuf) Unmarshal() Hash

type TimeBlocks

type TimeBlocks big.Int

func BlocksFromSeconds

func BlocksFromSeconds(seconds int64) *TimeBlocks

func NewTimeBlocks

func NewTimeBlocks(val *big.Int) *TimeBlocks

func NewTimeBlocksInt

func NewTimeBlocksInt(val int64) *TimeBlocks

func (*TimeBlocks) AsInt

func (tb *TimeBlocks) AsInt() *big.Int

func (*TimeBlocks) Clone

func (tb *TimeBlocks) Clone() *TimeBlocks

func (*TimeBlocks) Cmp

func (tb *TimeBlocks) Cmp(tb2 *TimeBlocks) int

func (*TimeBlocks) Duration

func (tb *TimeBlocks) Duration() time.Duration

func (*TimeBlocks) Marshal

func (tb *TimeBlocks) Marshal() *TimeBlocksBuf

func (*TimeBlocks) String

func (tb *TimeBlocks) String() string

type TimeBlocksBuf

type TimeBlocksBuf struct {
	Val *BigIntegerBuf `protobuf:"bytes,1,opt,name=val,proto3" json:"val,omitempty"`
	// contains filtered or unexported fields
}

func (*TimeBlocksBuf) Descriptor deprecated

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

Deprecated: Use TimeBlocksBuf.ProtoReflect.Descriptor instead.

func (*TimeBlocksBuf) GetVal

func (x *TimeBlocksBuf) GetVal() *BigIntegerBuf

func (*TimeBlocksBuf) ProtoMessage

func (*TimeBlocksBuf) ProtoMessage()

func (*TimeBlocksBuf) ProtoReflect added in v0.5.0

func (x *TimeBlocksBuf) ProtoReflect() protoreflect.Message

func (*TimeBlocksBuf) Reset

func (x *TimeBlocksBuf) Reset()

func (*TimeBlocksBuf) String

func (x *TimeBlocksBuf) String() string

func (*TimeBlocksBuf) Unmarshal

func (tb *TimeBlocksBuf) Unmarshal() *TimeBlocks

type TimeTicks

type TimeTicks struct {
	Val *big.Int
}

func TicksFromBlockNum

func TicksFromBlockNum(blockNum *TimeBlocks) TimeTicks

func TicksFromSeconds

func TicksFromSeconds(seconds int64) TimeTicks

func (TimeTicks) Add

func (rt TimeTicks) Add(rt2 TimeTicks) TimeTicks

func (TimeTicks) Clone

func (rt TimeTicks) Clone() TimeTicks

func (TimeTicks) Cmp

func (rt TimeTicks) Cmp(rt2 TimeTicks) int

func (TimeTicks) Duration

func (rt TimeTicks) Duration() time.Duration

func (TimeTicks) Equals

func (rt TimeTicks) Equals(rt2 TimeTicks) bool

func (TimeTicks) MarshalToBuf

func (rt TimeTicks) MarshalToBuf() *TimeTicksBuf

func (TimeTicks) String

func (rt TimeTicks) String() string

type TimeTicksBuf

type TimeTicksBuf struct {
	Val *BigIntegerBuf `protobuf:"bytes,1,opt,name=val,proto3" json:"val,omitempty"`
	// contains filtered or unexported fields
}

func (*TimeTicksBuf) Descriptor deprecated

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

Deprecated: Use TimeTicksBuf.ProtoReflect.Descriptor instead.

func (*TimeTicksBuf) GetVal

func (x *TimeTicksBuf) GetVal() *BigIntegerBuf

func (*TimeTicksBuf) ProtoMessage

func (*TimeTicksBuf) ProtoMessage()

func (*TimeTicksBuf) ProtoReflect added in v0.5.0

func (x *TimeTicksBuf) ProtoReflect() protoreflect.Message

func (*TimeTicksBuf) Reset

func (x *TimeTicksBuf) Reset()

func (*TimeTicksBuf) String

func (x *TimeTicksBuf) String() string

func (*TimeTicksBuf) Unmarshal

func (rtb *TimeTicksBuf) Unmarshal() TimeTicks

Jump to

Keyboard shortcuts

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