Documentation ¶
Index ¶
- Constants
- func AbsUint(n1 uint, n2 uint) uint
- func BytesReverse(u []byte) []byte
- func BytesToHexString(data []byte) string
- func BytesToInt(b []byte) []int
- func BytesToInt16(b []byte) int16
- func ClearBytes(arr []byte, len int)
- func CompareHeight(blockHeight uint32, heights []uint32) bool
- func FileExisted(filename string) bool
- func GetCompactUint(buf []byte) (uint64, uint8)
- func GetNonce() uint64
- func GetUint16Array(source []byte) ([]uint16, error)
- func HexStringToBytes(value string) ([]byte, error)
- func HexStringToBytesReverse(value string) ([]byte, error)
- func IntToBytes(n int) []byte
- func IsEqualBytes(b1 []byte, b2 []byte) bool
- func SetCompactUint(num uint64) []byte
- func SliceRemove(slice []uint32, h uint32) []uint32
- func ToArrayReverse(arr []byte) []byte
- func ToByteArray(source []uint16) []byte
- type Cache
- type CompactUint
- type Fixed64
- type GoCache
- type Inventory
- type InventoryType
- type Uint160
- func (u *Uint160) Big() *big.Int
- func (u *Uint160) CompareTo(o Uint160) int
- func (f *Uint160) Deserialize(r io.Reader) error
- func (u *Uint160) Serialize(w io.Writer) (int, error)
- func (u *Uint160) SetBytes(b []byte)
- func (f *Uint160) ToAddress() (string, error)
- func (u *Uint160) ToArray() []byte
- func (u *Uint160) ToArrayReverse() []byte
- type Uint256
Constants ¶
View Source
const ( // supported max asset precision is 8 MaximumPrecision = 8 StorageFactor = 100000000 )
View Source
const MaxUint32 = ^uint32(0)
View Source
const UINT160SIZE = 20
View Source
const UINT256SIZE = 32
Variables ¶
This section is empty.
Functions ¶
func BytesReverse ¶
func BytesToHexString ¶
func BytesToInt ¶
func BytesToInt16 ¶
func ClearBytes ¶
func CompareHeight ¶
func FileExisted ¶
func GetCompactUint ¶
func GetUint16Array ¶
func HexStringToBytes ¶
func HexStringToBytesReverse ¶
func IntToBytes ¶
func IsEqualBytes ¶
func SetCompactUint ¶
TODO Fix the return value to the correct number
func SliceRemove ¶
func ToArrayReverse ¶
func ToByteArray ¶
Types ¶
type Cache ¶
type Cache interface { Add([]byte, interface{}) error Get([]byte) (interface{}, bool) Set([]byte, interface{}) error }
Cache is an anstract cache layer
type CompactUint ¶
type CompactUint struct {
// contains filtered or unexported fields
}
type Fixed64 ¶
type Fixed64 int64
the 64 bit fixed-point number, precise 10^-8
func StringToFixed64 ¶
type GoCache ¶
type GoCache struct {
// contains filtered or unexported fields
}
GoCache is the caching layer implemented by go-cache.
func NewGoCache ¶
NewGoCache creates a go-cache cache with a given default expiration duration and cleanup interval.
func (*GoCache) Add ¶
Add adds an item to the cache only if an item doesn't already exist for the given key, or if the existing item has expired. Returns an error otherwise.
type Inventory ¶
type Inventory interface { //sig.SignableData Hash() Uint256 Verify() error Type() InventoryType }
TODO: temp inventory
type InventoryType ¶
type InventoryType byte
const ( TRANSACTION InventoryType = 0x01 BLOCK InventoryType = 0x02 )
type Uint160 ¶
type Uint160 [UINT160SIZE]uint8
func BigToUint160 ¶
func BytesToUint160 ¶
func ToCodeHash ¶
func ToScriptHash ¶
func Uint160ParseFromBytes ¶
func (*Uint160) ToArrayReverse ¶
type Uint256 ¶
type Uint256 [UINT256SIZE]uint8
var EmptyUint256 Uint256
func Uint256ParseFromBytes ¶
func (*Uint256) ToArrayReverse ¶
func (*Uint256) ToHexString ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.