Documentation ¶
Index ¶
- Constants
- Variables
- func Compress(bs []byte) []byte
- func DecodeAny(o *codec.TypedObj) (interface{}, error)
- func DecodeAnyForJSON(o *codec.TypedObj) (interface{}, error)
- func DecodeAsString(o *codec.TypedObj, s string) string
- func Decompress(bs []byte) []byte
- func EncodeAny(obj interface{}) (*codec.TypedObj, error)
- func HexPre(bs []byte) string
- func MarshalAny(c codec.Codec, obj interface{}) ([]byte, error)
- func MustDecodeAny(o *codec.TypedObj) interface{}
- func MustEncodeAny(obj interface{}) *codec.TypedObj
- func NewBlockInfo(height, timestamp int64) module.BlockInfo
- func StrLeft(n int, s string) string
- func UnixMicroFromTime(t time.Time) int64
- func UnmarshalAny(c codec.Codec, bs []byte) (interface{}, error)
- type Address
- func (a *Address) Bytes() []byte
- func (a *Address) Equal(a2 module.Address) bool
- func (a *Address) ID() []byte
- func (a *Address) IsContract() bool
- func (a Address) MarshalJSON() ([]byte, error)
- func (a *Address) RLPDecodeSelf(d codec.Decoder) error
- func (a *Address) RLPEncodeSelf(e codec.Encoder) error
- func (a *Address) Set(address module.Address) error
- func (a *Address) SetBytes(b []byte) error
- func (a *Address) SetString(s string) error
- func (a *Address) SetTypeAndID(ic bool, id []byte) error
- func (a *Address) String() string
- func (a *Address) UnmarshalJSON(b []byte) error
- type AutoCallLocker
- type AutoUnlock
- type Clock
- type GoTimeClock
- type HexBytes
- type HexInt
- func (i *HexInt) Bytes() []byte
- func (i *HexInt) Clone() HexInt
- func (i *HexInt) MarshalBinary() (data []byte, err error)
- func (i HexInt) MarshalJSON() ([]byte, error)
- func (i *HexInt) SetBytes(bs []byte) *big.Int
- func (i HexInt) String() string
- func (i *HexInt) UnmarshalBinary(data []byte) error
- func (i *HexInt) UnmarshalJSON(b []byte) error
- type HexInt16
- type HexInt32
- type HexInt64
- type HexUint16
- type HexUint32
- type HexUint64
- type ITimer
- type Mutex
- type RawHexBytes
- type Signature
- type TestClock
- type Timer
Constants ¶
View Source
const ( AddressIDBytes = 20 AddressBytes = AddressIDBytes + 1 )
View Source
const ( TypeAddress = iota + codec.TypeCustom TypeInt )
View Source
const PrefixLen = 4
Variables ¶
View Source
var ( ErrUnknown = errors.ErrUnknown ErrIllegalArgument = errors.ErrIllegalArgument ErrInvalidState = errors.ErrInvalidState ErrUnsupported = errors.ErrUnsupported ErrNotFound = errors.ErrNotFound )
View Source
var HexIntZero = &hexIntZero
View Source
var TypeCodec = &typeCodec{}
Functions ¶
func DecodeAnyForJSON ¶
func Decompress ¶
func MustDecodeAny ¶
func MustEncodeAny ¶
func NewBlockInfo ¶
func UnixMicroFromTime ¶
Types ¶
type Address ¶
type Address [AddressBytes]byte
func AddressToPtr ¶ added in v0.9.3
func NewAccountAddress ¶
func NewAddress ¶
func NewAddressFromString ¶
func NewContractAddress ¶
func (*Address) IsContract ¶
func (Address) MarshalJSON ¶
func (*Address) UnmarshalJSON ¶
type AutoCallLocker ¶
type AutoCallLocker struct {
// contains filtered or unexported fields
}
func LockForAutoCall ¶
func LockForAutoCall(locker sync.Locker) *AutoCallLocker
func (*AutoCallLocker) CallAfterUnlock ¶
func (m *AutoCallLocker) CallAfterUnlock(f func())
CallAfterUnlock schedules to call f after next unlock. This function shall be called while lock is acquired.
func (*AutoCallLocker) CallBeforeUnlock ¶
func (m *AutoCallLocker) CallBeforeUnlock(f func())
CallBeforeUnlock schedules to call f before next unlock. This function shall be called while lock is acquired.
func (*AutoCallLocker) Unlock ¶
func (m *AutoCallLocker) Unlock()
Unlock calls scheduled functions and releases lock.
type AutoUnlock ¶
type AutoUnlock struct {
// contains filtered or unexported fields
}
func Lock ¶
func Lock(l sync.Locker) AutoUnlock
Lock lock the locker and return handle for unlock to be used for deferred unlock.
func (*AutoUnlock) Unlock ¶
func (l *AutoUnlock) Unlock()
type GoTimeClock ¶
type GoTimeClock struct { }
func (*GoTimeClock) Now ¶
func (cl *GoTimeClock) Now() time.Time
func (*GoTimeClock) Sleep ¶
func (cl *GoTimeClock) Sleep(d time.Duration)
type HexBytes ¶
type HexBytes []byte
func SliceOfHexBytes ¶
func (HexBytes) MarshalJSON ¶
func (*HexBytes) UnmarshalJSON ¶
type HexInt ¶
func (*HexInt) MarshalBinary ¶
func (HexInt) MarshalJSON ¶
func (*HexInt) UnmarshalBinary ¶
func (*HexInt) UnmarshalJSON ¶
type HexInt16 ¶
type HexInt16 struct {
Value int16
}
func (HexInt16) MarshalJSON ¶
func (*HexInt16) UnmarshalJSON ¶
type HexInt32 ¶
type HexInt32 struct {
Value int32
}
func (HexInt32) MarshalJSON ¶
func (*HexInt32) UnmarshalJSON ¶
type HexInt64 ¶
type HexInt64 struct {
Value int64
}
func (HexInt64) MarshalJSON ¶
func (*HexInt64) UnmarshalJSON ¶
type HexUint16 ¶
type HexUint16 struct {
Value uint16
}
func (HexUint16) MarshalJSON ¶
func (*HexUint16) UnmarshalJSON ¶
type HexUint32 ¶
type HexUint32 struct {
Value uint32
}
func (HexUint32) MarshalJSON ¶
func (*HexUint32) UnmarshalJSON ¶
type HexUint64 ¶
type HexUint64 struct {
Value uint64
}
func (HexUint64) MarshalJSON ¶
func (*HexUint64) UnmarshalJSON ¶
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
Mutex is wrapper for sync.Mutex.
func (*Mutex) CallAfterUnlock ¶
func (m *Mutex) CallAfterUnlock(f func())
CallAfterUnlock schedules to call f after next unlock. This function shall be called while lock is acquired.
func (*Mutex) CallBeforeUnlock ¶
func (m *Mutex) CallBeforeUnlock(f func())
CallBeforeUnlock schedules to call f before next unlock. This function shall be called while lock is acquired.
type RawHexBytes ¶
type RawHexBytes []byte
func (RawHexBytes) Bytes ¶
func (rh RawHexBytes) Bytes() []byte
func (RawHexBytes) MarshalJSON ¶
func (rh RawHexBytes) MarshalJSON() ([]byte, error)
func (RawHexBytes) String ¶
func (rh RawHexBytes) String() string
func (*RawHexBytes) UnmarshalJSON ¶
func (rh *RawHexBytes) UnmarshalJSON(b []byte) error
type Signature ¶
func (*Signature) MarshalBinary ¶
func (Signature) MarshalJSON ¶
func (Signature) RecoverPublicKey ¶
func (*Signature) UnmarshalBinary ¶
func (*Signature) UnmarshalJSON ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.