ticket

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Method_Add   = "TICKET.UPDATE"
	Method_Apply = "TICKET.QUERY"
	Method_Query = "TICKET.CONTRACT"
)

Variables

This section is empty.

Functions

func AddHandler

func AddHandler(cfg TicketConfig) addHandler

func ApplyHandler

func ApplyHandler(cfg TicketConfig) applyHandler

func GeneralInvokingTemplate

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

func GeneralQueryTemplate

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

func QueryHandler

func QueryHandler(cfg TicketConfig) queryHandler

Types

type GeneralCall

type GeneralCall struct {
	txgen.TxCaller
}

func (*GeneralCall) Add

func (i *GeneralCall) Add(owner []byte, id []byte, ticketCat int, desc string) error

func (*GeneralCall) Apply

func (i *GeneralCall) Apply(owner []byte, id []byte) error

func (*GeneralCall) Query

func (i *GeneralCall) Query(owner []byte, id []byte) (int, string)

type InnerInvokeConfig

type InnerInvokeConfig struct {
	txgen.InnerChaincode
}

func (InnerInvokeConfig) NewTx

type StandardTicketConfig

type StandardTicketConfig struct {
	Root string
	*runtime.Config
}

func NewConfig

func NewConfig(tag string) *StandardTicketConfig

func (*StandardTicketConfig) NewTx

func (cfg *StandardTicketConfig) NewTx(stub shim.ChaincodeStubInterface, nonce []byte) TicketTx

type TicketConfig

type TicketConfig interface {
	NewTx(shim.ChaincodeStubInterface, []byte) TicketTx
}

type TicketTx

type TicketTx interface {

	//add an ticket belong to the owner, which MUST has an unique id,
	//or error will be returned if the id is duplicated
	//ticket catalogy MUST start from 1 (0 or less is not allowed)
	Add(owner []byte, id []byte, ticketCat int, desc string) error
	//check if the ticket with specified id existed (error is returned
	//if not) and remove it
	Apply(owner []byte, id []byte) error
	//query the desc and catalogy, a catalogy less than 0 indicate the
	//ticket is not exist
	Query(owner []byte, id []byte) (int, string)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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