Documentation ¶
Index ¶
- Constants
- Variables
- func AddressEqual(a, b module.Address) bool
- func AnyForJSON(o interface{}) (interface{}, error)
- func BlockInfoEqual(bi1 module.BlockInfo, bi2 module.BlockInfo) bool
- func BytesOfAddress(addr module.Address) []byte
- func BytesToAddress(b []byte) (module.Address, error)
- func CompactJSON(js []byte) ([]byte, error)
- func Compress(bs []byte) []byte
- func ConsensusInfoEqual(csi1, csi2 module.ConsensusInfo) bool
- 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 NewConsensusInfo(proposer module.Address, voters module.ValidatorList, voted []bool) module.ConsensusInfo
- 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 AddressToPtr(addr module.Address) *Address
- func MustNewAddress(b []byte) *Address
- func MustNewAddressFromString(s string) *Address
- func NewAccountAddress(b []byte) *Address
- func NewAccountAddressFromPublicKey(pubKey *crypto.PublicKey) *Address
- func NewAddress(b []byte) (*Address, error)
- func NewAddressFromString(s string) (*Address, error)
- func NewAddressWithTypeAndID(isContract bool, id []byte) *Address
- func NewContractAddress(b []byte) *Address
- func ToAddress(addr interface{}) *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) *Address
- func (a *Address) SetBytes(b []byte) error
- func (a *Address) SetString(s string) error
- func (a *Address) SetStringStrict(s string) error
- func (a *Address) SetTypeAndID(ic bool, id []byte)
- func (a *Address) String() string
- func (a *Address) UnmarshalJSON(b []byte) error
- type AutoCallLocker
- type AutoUnlock
- type Clock
- type GoTimeClock
- type HexBytes
- type HexHash
- type HexInt
- func (i *HexInt) AddValue(x, y *big.Int) *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) SetValue(x *big.Int) *HexInt
- func (i HexInt) String() string
- func (i *HexInt) UnmarshalBinary(data []byte) error
- func (i *HexInt) UnmarshalJSON(b []byte) error
- func (i *HexInt) Value() *big.Int
- type HexInt16
- type HexInt32
- type HexInt64
- type HexUint16
- type HexUint32
- type HexUint64
- type ITimer
- type Mutex
- type RawHexBytes
- type Signature
- type Timer
Constants ¶
View Source
const ( AddressIDBytes = 20 AddressBytes = AddressIDBytes + 1 )
View Source
const ( TypeAddress = iota + codec.TypeCustom TypeInt TypeFloat )
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 ( NullHashBytes = make([]byte, crypto.HashLen) NullHashJSON = []byte("\"0x" + hex.EncodeToString(NullHashBytes) + "\"") NullHashString = "0x" + hex.EncodeToString(NullHashBytes) )
View Source
var HexIntZero = &hexIntZero
View Source
var TypeCodec = &typeCodec{}
Functions ¶
func AddressEqual ¶ added in v0.9.4
func AnyForJSON ¶ added in v0.9.4
func AnyForJSON(o interface{}) (interface{}, error)
func BlockInfoEqual ¶ added in v0.9.4
func BytesOfAddress ¶ added in v0.9.10
func CompactJSON ¶ added in v0.9.4
func ConsensusInfoEqual ¶ added in v0.9.4
func ConsensusInfoEqual(csi1, csi2 module.ConsensusInfo) bool
func DecodeAnyForJSON ¶
func Decompress ¶
func MustDecodeAny ¶
func MustEncodeAny ¶
func NewBlockInfo ¶
func NewConsensusInfo ¶ added in v0.9.4
func NewConsensusInfo( proposer module.Address, voters module.ValidatorList, voted []bool, ) module.ConsensusInfo
func UnixMicroFromTime ¶
Types ¶
type Address ¶
type Address [AddressBytes]byte
func AddressToPtr ¶ added in v0.9.3
func MustNewAddress ¶ added in v0.9.4
func MustNewAddressFromString ¶ added in v0.9.6
func NewAccountAddress ¶
func NewAddress ¶
func NewAddressFromString ¶
func NewAddressWithTypeAndID ¶ added in v0.9.4
func NewContractAddress ¶
func (*Address) IsContract ¶
func (Address) MarshalJSON ¶
func (*Address) SetStringStrict ¶ added in v0.9.6
func (*Address) SetTypeAndID ¶
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 HexHash ¶ added in v0.9.6
type HexHash []byte
func (HexHash) MarshalJSON ¶ added in v0.9.6
func (*HexHash) UnmarshalJSON ¶ added in v0.9.6
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 ¶
Directories ¶
Path | Synopsis |
---|---|
* Copyright 2020 ICON Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* Copyright 2020 ICON Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |
Package errors is replacement package for standard errors package.
|
Package errors is replacement package for standard errors package. |
Click to show internal directories.
Click to hide internal directories.