tx

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Verifier_CheckCred = fmt.Errorf("Pass if credential can be verified")

Functions

func AttachAddrVerifier

func AttachAddrVerifier(phs []TxPreHandler, v AddrVerifier)

func BatchArgParser

func BatchArgParser(ccn string, p map[string]txutil.TxArgParser) txutil.TxArgParser

func EmptyAddrCredVerifier

func EmptyAddrCredVerifier(la ListAddresses) *addrCredVerifier

func GenerateTxArgParser

func GenerateTxArgParser(m map[string]*ChaincodeTx) map[string]tx.TxArgParser

build tx arg parser from txhandler

func NewAddrCredVerifier

func NewAddrCredVerifier(la ListAddresses) *addrCredVerifier

create default verifier

func NewAddrCredVerifierFromTemplate

func NewAddrCredVerifierFromTemplate(la ListAddresses, tp TxPreHandler) *addrCredVerifier

func NewAddrOrCredVerifier

func NewAddrOrCredVerifier(la ListAddresses) addrOrCredVerifier

Types

type AddrCredInspector

type AddrCredInspector interface {
	AddVerifier(AddrVerifier) bool
}

type AddrVerifier

type AddrVerifier interface {
	TxPreHandler
	Verify(*txutil.Address) error
}

type ChaincodeTx

type ChaincodeTx struct {
	Ccname       string
	Handler      TxHandler
	PreHandlers  []TxPreHandler
	PostHandlers []TxPostHandler
}

func (*ChaincodeTx) TxCall

func (cci *ChaincodeTx) TxCall(stub shim.ChaincodeStubInterface,
	function string, args [][]byte) ([]byte, error)

type ClonableAddrVerifier

type ClonableAddrVerifier interface {
	Clone() AddrVerifier
}

type CollectiveTxs

type CollectiveTxs map[string]*ChaincodeTx

func NewCollectiveTxs

func NewCollectiveTxs() CollectiveTxs

func (CollectiveTxs) Invoke

func (s CollectiveTxs) Invoke(stub shim.ChaincodeStubInterface, function string, args [][]byte, _ bool) ([]byte, error)

provide a simple chaincode interface ...

func (CollectiveTxs) Map

func (s CollectiveTxs) Map() map[string]*ChaincodeTx

func (CollectiveTxs) Merge

func (s CollectiveTxs) Merge(ins ...CollectiveTxs) (CollectiveTxs, error)

func (CollectiveTxs) MustMerge

func (s CollectiveTxs) MustMerge(ins ...CollectiveTxs) CollectiveTxs

type CollectiveTxs_InnerSupport

type CollectiveTxs_InnerSupport CollectiveTxs

func (CollectiveTxs_InnerSupport) Invoke

func (itxh CollectiveTxs_InnerSupport) Invoke(stub shim.ChaincodeStubInterface, function string, args [][]byte, ro bool) ([]byte, error)

innerTx handler also provide a chaincode interface to handling inner calling

func (CollectiveTxs_InnerSupport) TxCall

func (itxh CollectiveTxs_InnerSupport) TxCall(stub shim.ChaincodeStubInterface,
	function string, args [][]byte) ([]byte, error)

type IsTxExpired

type IsTxExpired bool

func (IsTxExpired) PreHandling

func (force IsTxExpired) PreHandling(_ shim.ChaincodeStubInterface, _ string, tx txutil.Parser) error

type ListAddresses

type ListAddresses func(shim.ChaincodeStubInterface, proto.Message) []*txutil.Address

it is safe to return nil for a mal-formed message and MUST return empty array if some expected addresses is not available (that is, even there is still some address can be returned, they MUST NOT shown)

type MsgAddresses

type MsgAddresses interface {
	GetAddresses() []*txutil.Address
}

type TxAttrVerifier

type TxAttrVerifier map[string]string

func (TxAttrVerifier) PreHandling

func (req TxAttrVerifier) PreHandling(stub shim.ChaincodeStubInterface, _ string, _ txutil.Parser) error

type TxHandler

type TxHandler interface {
	Msg() proto.Message
	Call(shim.ChaincodeStubInterface, txutil.Parser) ([]byte, error)
}

func BatchTxHandler

func BatchTxHandler(hs map[string]*ChaincodeTx) TxHandler

type TxMultiAttrVerifier

type TxMultiAttrVerifier map[string][]string

func (TxMultiAttrVerifier) PreHandling

type TxPostHandler

type TxPostHandler interface {
	PostHandling(shim.ChaincodeStubInterface, string, txutil.Parser, []byte) ([]byte, error)
}

type TxPreHandler

type TxPreHandler interface {
	PreHandling(shim.ChaincodeStubInterface, string, txutil.Parser) error
}

Jump to

Keyboard shortcuts

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