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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SyncQueryResult

func SyncQueryResult(msg proto.Message, out chan QueryResp) error

Types

type BatchTxCall

type BatchTxCall struct {
	Msg pb.TxBatch
	*TxGenerator
	// contains filtered or unexported fields
}

func (*BatchTxCall) CommitBatch

func (t *BatchTxCall) CommitBatch(method string) error

func (*BatchTxCall) FailAllQueries

func (t *BatchTxCall) FailAllQueries(err error)

func (*BatchTxCall) Invoke

func (t *BatchTxCall) Invoke(method string, msg proto.Message) error

func (*BatchTxCall) Nonce

func (t *BatchTxCall) Nonce() []byte

func (*BatchTxCall) Query

func (t *BatchTxCall) Query(method string, msg proto.Message) (chan QueryResp, error)

type InnerChaincode

type InnerChaincode string

the chaincodename is the name in fabric-level (not the framework's cc name)

func (InnerChaincode) NewInnerTxInterface

func (s InnerChaincode) NewInnerTxInterface(stub shim.ChaincodeStubInterface, nonce []byte) *InnerTxGenerator

type InnerTxGenerator

type InnerTxGenerator struct {
	impl.InnerInvoke
	// contains filtered or unexported fields
}

func (*InnerTxGenerator) GetNonce

func (t *InnerTxGenerator) GetNonce() []byte

func (*InnerTxGenerator) Invoke

func (t *InnerTxGenerator) Invoke(method string, msg proto.Message) error

we use sync invoking and return the invoking result, but still allow async query

func (*InnerTxGenerator) Query

func (t *InnerTxGenerator) Query(method string, msg proto.Message) (chan QueryResp, error)

func (*InnerTxGenerator) Result

func (t *InnerTxGenerator) Result() TxCallResult

func (*InnerTxGenerator) TxDone

func (t *InnerTxGenerator) TxDone() chan struct{}

func (*InnerTxGenerator) TxID

func (t *InnerTxGenerator) TxID() (string, error)

type QueryResp

type QueryResp struct {
	SuccMsg []byte
	ErrMsg  error
}

type TxCallResult

type TxCallResult interface {
	TxID() (string, error)
}

type TxCaller

type TxCaller interface {
	Invoke(method string, msg proto.Message) error
	Query(method string, msg proto.Message) (chan QueryResp, error)
	GetNonce() []byte
	TxDone() chan struct{}
	Result() TxCallResult
}

type TxCredHandler

type TxCredHandler interface {
	DoCred(txutil.Builder) error
}

func NewMultiKeyCred

func NewMultiKeyCred(privkey ...crypto.Signer) TxCredHandler

func NewSingleKeyCred

func NewSingleKeyCred(privkey crypto.Signer) TxCredHandler

type TxGenerator

type TxGenerator struct {
	Timelock      time.Time
	Credgenerator TxCredHandler
	Dispatcher    rpc.Caller
	MethodMapper  map[string]string
	Ccname        string
	// contains filtered or unexported fields
}

func DefaultTxGen

func DefaultTxGen(ccname string, privkey crypto.Signer) *TxGenerator

func SimpleTxGen

func SimpleTxGen(ccname string) *TxGenerator

func (*TxGenerator) BeginDeploy

func (t *TxGenerator) BeginDeploy(nonce []byte)

func (*TxGenerator) BeginTx

func (t *TxGenerator) BeginTx(nonce []byte)

func (*TxGenerator) GetBuilder

func (t *TxGenerator) GetBuilder() txutil.Builder

func (*TxGenerator) GetNonce

func (t *TxGenerator) GetNonce() []byte

func (*TxGenerator) Invoke

func (t *TxGenerator) Invoke(method string, msg proto.Message) error

func (*TxGenerator) MapMethod

func (t *TxGenerator) MapMethod(m map[string]string)

func (*TxGenerator) Query

func (t *TxGenerator) Query(method string, msg proto.Message) (chan QueryResp, error)

func (*TxGenerator) Result

func (t *TxGenerator) Result() TxCallResult

func (*TxGenerator) SetDeploy

func (t *TxGenerator) SetDeploy()

func (*TxGenerator) TxDone

func (t *TxGenerator) TxDone() chan struct{}

func (*TxGenerator) TxID

func (t *TxGenerator) TxID() (string, error)

Jump to

Keyboard shortcuts

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