utils

package
v1.0.1-rc7-dev Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2019 License: GPL-3.0 Imports: 23 Imported by: 36

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base58Decode

func Base58Decode(str string, bytes []byte) (e error)

func Base58Encode

func Base58Encode(bytes []byte) (ret *string)

func BytesToCurrency

func BytesToCurrency(bs []byte) string

func CurrencyToBytes

func CurrencyToBytes(currency string) []byte

func CurrencyToUint256

func CurrencyToUint256(str string) (ret c_type.Uint256)

func DecodeNumber

func DecodeNumber(data []byte) uint64

func DecodeNumber32

func DecodeNumber32(data []byte) uint32

func DeepCopy

func DeepCopy(dst, src interface{})

func DeepSerial

func DeepSerial(src interface{}) (ret bytes.Buffer)

func DeepUnserial

func DeepUnserial(buf *bytes.Buffer, dst interface{})

func EncodeNumber

func EncodeNumber(number uint64) []byte

func EncodeNumber32

func EncodeNumber32(number uint32) []byte

func Int64ToBytes

func Int64ToBytes(r int64) []byte

func NewPKrChecker

func NewPKrChecker() (ret pkrsChecker)

func ParseAmount

func ParseAmount(s string) (*big.Int, error)

func ShowStack

func ShowStack()

func Uint256SliceCut

func Uint256SliceCut(is []c_type.Uint256, l int) (ret []c_type.Uint256)

func Uint256ToCurrency

func Uint256ToCurrency(u *c_type.Uint256) (ret string)

func Uint64ToBytes

func Uint64ToBytes(r uint64) []byte

Types

type Dirtys

type Dirtys struct {
	Orders []c_type.Uint256
}

func (*Dirtys) Append

func (self *Dirtys) Append(item *c_type.Uint256)

func (*Dirtys) Clear

func (self *Dirtys) Clear()

func (*Dirtys) List

func (self *Dirtys) List() (ret []c_type.Uint256)

type H2Hash

type H2Hash struct {
	Name string
	M    map[c_type.Uint256]c_type.Uint256
}

func NewH2Hash

func NewH2Hash(name string) (ret H2Hash)

func (*H2Hash) Add

func (self *H2Hash) Add(id *c_type.Uint256, hash *c_type.Uint256)

func (*H2Hash) Clear

func (self *H2Hash) Clear()

func (*H2Hash) Del

func (self *H2Hash) Del(id *c_type.Uint256) (ret c_type.Uint256)

func (*H2Hash) Get

func (self *H2Hash) Get(id *c_type.Uint256) (ret c_type.Uint256)

func (*H2Hash) GetByDB

func (self *H2Hash) GetByDB(getter serodb.Getter, id *c_type.Uint256) (ret c_type.Uint256)

func (*H2Hash) GetByTri

func (self *H2Hash) GetByTri(tr tri.Tri, id *c_type.Uint256) (ret c_type.Uint256)

func (*H2Hash) K2Name

func (self *H2Hash) K2Name(k *c_type.Uint256) (ret []byte)

func (*H2Hash) SaveByDB

func (self *H2Hash) SaveByDB(putter serodb.Putter, id *c_type.Uint256)

func (*H2Hash) SaveByTri

func (self *H2Hash) SaveByTri(tr tri.Tri, id *c_type.Uint256)

type HSet

type HSet struct {
	Name   string
	M      map[c_type.Uint256]bool
	Orders []c_type.Uint256
}

func NewHSet

func NewHSet(name string) (ret HSet)

func (*HSet) Append

func (self *HSet) Append(item *c_type.Uint256)

func (*HSet) Clear

func (self *HSet) Clear()

func (*HSet) Has

func (self *HSet) Has(tr tri.Tri, k *c_type.Uint256) (ret bool)

func (*HSet) K2Name

func (self *HSet) K2Name(k *c_type.Uint256) (ret []byte)

func (*HSet) List

func (self *HSet) List() (ret []c_type.Uint256)

func (*HSet) Save

func (self *HSet) Save(tr tri.Tri)

type I256

type I256 big.Int
var I256_0 I256 = I256(*big.NewInt(0))

func NewI256

func NewI256(i int64) (ret I256)

func (I256) Abs

func (self I256) Abs() (ret U256)

func (*I256) AddI

func (self *I256) AddI(a *I256)

func (*I256) AddU

func (self *I256) AddU(a *U256)

func (*I256) Cmp

func (self *I256) Cmp(a *I256) int

func (*I256) DecodeRLP

func (b *I256) DecodeRLP(s *rlp.Stream) error

func (I256) DeepCopy

func (self I256) DeepCopy() interface{}

func (I256) EncodeRLP

func (b I256) EncodeRLP(w io.Writer) error

func (*I256) GobDecode

func (z *I256) GobDecode(buf []byte) error

func (*I256) GobEncode

func (x *I256) GobEncode() ([]byte, error)

func (I256) IsPositive

func (self I256) IsPositive() bool

func (I256) MarshalText

func (b I256) MarshalText() ([]byte, error)

func (*I256) Reverse

func (self *I256) Reverse()

func (*I256) SubI

func (self *I256) SubI(a *I256)

func (*I256) SubU

func (self *I256) SubU(a *U256)

func (*I256) ToIntRef

func (self *I256) ToIntRef() (ret *big.Int)

func (I256) ToRef

func (self I256) ToRef() (ret *I256)

func (*I256) ToUint256

func (self *I256) ToUint256() (ret c_type.Uint256)

func (*I256) UnmarshalJSON

func (b *I256) UnmarshalJSON(input []byte) error

func (*I256) UnmarshalText

func (b *I256) UnmarshalText(input []byte) error

type Proc

type Proc interface {
	Run() error
}

type Procs

type Procs struct {
	Runs []Proc
	E    error
	ERun Proc
	// contains filtered or unexported fields
}

func NewProcs

func NewProcs(num int) (ret Procs)

func (*Procs) End

func (self *Procs) End() error

func (*Procs) HasProc

func (self *Procs) HasProc() bool

func (*Procs) StartProc

func (self *Procs) StartProc(run Proc)

type ProcsPool

type ProcsPool struct {
	// contains filtered or unexported fields
}

func NewProcsPool

func NewProcsPool(numget func() int) (ret ProcsPool)

func (*ProcsPool) GetProcs

func (self *ProcsPool) GetProcs() (ret *Procs)

func (*ProcsPool) PutProcs

func (self *ProcsPool) PutProcs(p *Procs)

type Progress

type Progress struct {
	// contains filtered or unexported fields
}

func NewProgress

func NewProgress(label string, target uint64) (ret Progress)

func (*Progress) Tick

func (self *Progress) Tick(cur uint64, ctx ...interface{})

type Runner

type Runner interface {
	Run() error
}

type Snapshot

type Snapshot struct {
	// contains filtered or unexported fields
}

type Snapshots

type Snapshots struct {
	// contains filtered or unexported fields
}

func (*Snapshots) Push

func (self *Snapshots) Push(id int, obj interface{})

func (*Snapshots) Revert

func (self *Snapshots) Revert(id int) (to interface{})

type TimeRecord

type TimeRecord struct {
	// contains filtered or unexported fields
}

func TR_enter

func TR_enter(name string) (tr TimeRecord)

func TR_enter_f

func TR_enter_f(name string) (tr TimeRecord)

func (*TimeRecord) Leave

func (tr *TimeRecord) Leave() time.Duration

func (*TimeRecord) Renter

func (tr *TimeRecord) Renter(name string)

type U256

type U256 big.Int
var U256_0 U256 = U256(*big.NewInt(0))

func NewU256

func NewU256(i uint64) (ret U256)

func NewU256_ByKey

func NewU256_ByKey(k *c_type.Uint256) (ret U256)

func (*U256) AddU

func (self *U256) AddU(a *U256)

func (*U256) Cmp

func (self *U256) Cmp(a *U256) int

func (*U256) DecodeRLP

func (b *U256) DecodeRLP(s *rlp.Stream) error

func (U256) DeepCopy

func (self U256) DeepCopy() interface{}

func (U256) EncodeRLP

func (b U256) EncodeRLP(w io.Writer) error

func (*U256) GobDecode

func (z *U256) GobDecode(buf []byte) error

func (*U256) GobEncode

func (x *U256) GobEncode() ([]byte, error)

func (U256) IsValid

func (self U256) IsValid() bool

func (U256) MarshalJSON

func (b U256) MarshalJSON() ([]byte, error)

func (*U256) SubU

func (self *U256) SubU(a *U256)

func (*U256) ToBEBytes

func (b *U256) ToBEBytes() (ret []byte)

func (*U256) ToI256

func (self *U256) ToI256() (ret I256)

func (*U256) ToInt

func (b *U256) ToInt() *big.Int

func (*U256) ToIntRef

func (self *U256) ToIntRef() (ret *big.Int)

func (*U256) ToLEBytes

func (self *U256) ToLEBytes() (ret []byte)

func (U256) ToRef

func (self U256) ToRef() (ret *U256)

func (*U256) ToUint256

func (self *U256) ToUint256() (ret c_type.Uint256)

func (*U256) UnmarshalJSON

func (b *U256) UnmarshalJSON(input []byte) error

func (*U256) UnmarshalText

func (b *U256) UnmarshalText(input []byte) error

type Uint256s

type Uint256s []c_type.Uint256

func (Uint256s) Len

func (self Uint256s) Len() int

func (Uint256s) Less

func (self Uint256s) Less(i, j int) bool

func (Uint256s) Swap

func (self Uint256s) Swap(i, j int)

type WorkChain

type WorkChain struct {
	// contains filtered or unexported fields
}

func NewWorkChain

func NewWorkChain(runners []Runner) (ret *WorkChain)

func (*WorkChain) Release

func (self *WorkChain) Release()

type WorkResult

type WorkResult struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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