generaltoken

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Method_Init        = "TOKEN.INIT"
	Method_Transfer    = "TOKEN.TRANSFER"
	Method_Transfer2   = "TOKEN.TRANSFER2"
	Method_Assign      = "TOKEN.ASSIGN"
	Method_TouchAddr   = "TOKEN.TOUCHADDR"
	Method_QueryToken  = "TOKEN.BALANCEQUERY"
	Method_QueryGlobal = "TOKEN.GLOBALQUERY"
)

Variables

This section is empty.

Functions

func AssignHandler

func AssignHandler(cfg TokenConfig) txh.TxHandler

func ExtendInvokingTemplate

func ExtendInvokingTemplate(cts tx.CollectiveTxs, verifier tx.AddrVerifier) tx.CollectiveTxs

func ExtendedQueryTemplate

func ExtendedQueryTemplate(ccname string, cfg LocalConfig) (ret tx.CollectiveTxs)

func GeneralAdminTemplate

func GeneralAdminTemplate(ccname string, cfg TokenConfig) (ret tx.CollectiveTxs)

admintemplate has no verifier

func GeneralInvokingTemplate

func GeneralInvokingTemplate(ccname string, cfg TokenConfig) (ret tx.CollectiveTxs)

func GeneralQueryTemplate

func GeneralQueryTemplate(ccname string, cfg TokenConfig) (ret tx.CollectiveTxs)

func GlobalQueryHandler

func GlobalQueryHandler(cfg TokenConfig) txh.TxHandler

func InitHandler

func InitHandler(cfg TokenConfig) txh.TxHandler

func NewTokenTxImpl

func NewTokenTxImpl(rt *runtime.ChaincodeRuntime, nc []byte, ncTx nonce.TokenNonceTx) *baseTokenTx

func TokenQueryHandler

func TokenQueryHandler(cfg TokenConfig) txh.TxHandler

func TouchHandler

func TouchHandler(TokenConfig) txh.TxHandler

func TransferHandler

func TransferHandler(cfg TokenConfig) txh.TxHandler

func TransferHandler2

func TransferHandler2(cfg TokenConfig) txh.TxHandler

Types

type GeneralCall

type GeneralCall struct {
	txgen.TxCaller
}

func (*GeneralCall) Account

func (i *GeneralCall) Account(addr []byte) (error, *pb.AccountData_s)

func (*GeneralCall) Assign

func (i *GeneralCall) Assign(to []byte, amount *big.Int) (pb.NonceKey, error)

func (*GeneralCall) Global

func (i *GeneralCall) Global() (error, *pb.TokenGlobalData_s)

func (*GeneralCall) Init

func (i *GeneralCall) Init(amount *big.Int) error

func (*GeneralCall) TouchAddr

func (i *GeneralCall) TouchAddr(to []byte) error

func (*GeneralCall) Transfer

func (i *GeneralCall) Transfer(from []byte, to []byte, amount *big.Int) (pb.NonceKey, error)

func (*GeneralCall) Transfer2

func (i *GeneralCall) Transfer2(from []byte, to []byte, amount *big.Int) (pb.NonceKey, error)

type InnerInvokeConfig

type InnerInvokeConfig struct {
	txgen.InnerChaincode
}

func (InnerInvokeConfig) NewTx

type LocalConfig

type LocalConfig interface {
	TokenConfig
	Nonce() nonce.NonceConfig
}

the local config must provide both a executable interface and the sub-config (corresponding its sub interface) for local handler building

type StandardTokenConfig

type StandardTokenConfig struct {
	Root string
	*runtime.Config
	NonceCfg nonce.NonceConfig
}

func NewConfig

func NewConfig(tag string) *StandardTokenConfig

func (*StandardTokenConfig) NewTx

type TokenConfig

type TokenConfig interface {
	NewTx(shim.ChaincodeStubInterface, []byte) TokenTx
}

type TokenTx

type TokenTx interface {
	Init(amount *big.Int) error
	Transfer(from []byte, to []byte, amount *big.Int) (pb.NonceKey, error)
	Transfer2(from []byte, to []byte, amount *big.Int) (pb.NonceKey, error)
	Assign(to []byte, amount *big.Int) (pb.NonceKey, error)
	Account(addr []byte) (error, *pb.AccountData_s)
	Global() (error, *pb.TokenGlobalData_s)
	//this is only used for inner call to register their address, have
	//no effect on the status of module
	//--------------- DEPRECATED, see addrspace module--------------
	TouchAddr([]byte) error
}

type TokenTxExt

type TokenTxExt interface {
	TokenTx
	nonce.TokenNonceTx
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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