txtool

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: GPL-3.0 Imports: 12 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDelayNumber

func GetDelayNumber(current uint64, delay uint64) (num uint64)

Types

type Block

type Block struct {
	Num  hexutil.Uint64
	Hash keys.Uint256
	Outs []Out
	Nils []keys.Uint256
	Pkgs []localdb.ZPkg
}

type BlockChain

type BlockChain interface {
	IsValid() bool
	GetCurrenHeader() *types.Header
	GetHeader(hash *common.Hash) *types.Header
	CurrentState(hash *common.Hash) *zstate.ZState
	GetSeroGasLimit(to *common.Address, tfee *assets.Token, gasPrice *big.Int) (gaslimit uint64, e error)
	GetTks() []keys.Uint512
	GetTkAt(tk *keys.Uint512) uint64
	GetBlockByNumber(num uint64) *types.Block
	GetHeaderByNumber(num uint64) *types.Header
	GetDB() serodb.Database
}

type Cmds

type Cmds struct {
	//Share
	BuyShare *stx.BuyShareCmd
	//Pool
	RegistPool *stx.RegistPoolCmd
	ClosePool  *stx.ClosePoolCmd
	//Contract
	Contract *stx.ContractCmd
	//Package
	PkgCreate   *GPkgCreateCmd
	PkgTransfer *GPkgTransferCmd
	PkgClose    *GPkgCloseCmd
}

type DOut

type DOut struct {
	Asset assets.Asset
	Memo  keys.Uint512
	Nil   keys.Uint256
}

type GIn

type GIn struct {
	SKr     keys.PKr
	Out     Out
	Witness Witness
}

type GOut

type GOut struct {
	PKr   keys.PKr
	Asset assets.Asset
	Memo  keys.Uint512
}

type GPkgCloseCmd

type GPkgCloseCmd struct {
	Id      keys.Uint256
	Owner   keys.PKr
	AssetCM keys.Uint256
	Ar      keys.Uint256
}

type GPkgCreateCmd

type GPkgCreateCmd struct {
	Id    keys.Uint256
	PKr   keys.PKr
	Asset assets.Asset
	Memo  keys.Uint512
}

type GPkgTransferCmd

type GPkgTransferCmd struct {
	Id    keys.Uint256
	Owner keys.PKr
	PKr   keys.PKr
}

type GTx

type GTx struct {
	Gas      hexutil.Uint64
	GasPrice hexutil.Big
	Tx       stx.T
	Hash     keys.Uint256
}

type GTxParam

type GTxParam struct {
	Gas      uint64
	GasPrice big.Int
	Fee      assets.Token
	From     Kr
	Ins      []GIn
	Outs     []GOut
	Cmds     Cmds
}

type ISLI

type ISLI interface {
	CreateKr() Kr
	DecOuts(outs []Out, skr *keys.PKr) ([]DOut, error)
	GenTx(param *GTxParam) (GTx, error)
}

type ISRI

type ISRI interface {
	GetBlocksInfo(start uint64, count uint64) ([]Block, error)
	GetAnchor(roots []keys.Uint256) ([]Witness, error)
	CommitTx(tx *GTx) error
}

type Kr

type Kr struct {
	SKr keys.PKr
	PKr keys.PKr
}

type Out

type Out struct {
	Root  keys.Uint256
	State localdb.RootState
}

type Ref

type Ref struct {
	Bc BlockChain
}
var Ref_inst Ref

func (*Ref) CurrentState

func (self *Ref) CurrentState() (ret *zstate.ZState)

func (*Ref) GetDelayedNum

func (self *Ref) GetDelayedNum(delay uint64) (ret uint64)

func (*Ref) SetBC

func (self *Ref) SetBC(bc BlockChain)

type Tx

type Tx struct {
	Hash keys.Uint256
	Tx   stx.T
}

type Witness

type Witness struct {
	Pos    hexutil.Uint64
	Paths  [cpt.DEPTH]keys.Uint256
	Anchor keys.Uint256
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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