Documentation
¶
Index ¶
- type BatchCacheStub
- func (bs *BatchCacheStub) Commit() error
- func (bs *BatchCacheStub) DelState(key string) error
- func (bs *BatchCacheStub) GetMultipleStates(keys ...string) ([][]byte, error)
- func (bs *BatchCacheStub) GetState(key string) ([]byte, error)
- func (bs *BatchCacheStub) InvokeChaincode(chaincodeName string, args [][]byte, channel string) *peer.Response
- func (bs *BatchCacheStub) NewTxCacheStub(txID string, txTimestamp *timestamppb.Timestamp) *TxCacheStub
- func (bs *BatchCacheStub) PutState(key string, value []byte) error
- type TxCacheStub
- func (bts *TxCacheStub) AddAccountingRecord(token string, from *types.Address, to *types.Address, amount *big.Int, ...)
- func (bts *TxCacheStub) Commit() ([]*proto.WriteElement, []*proto.Event)
- func (bts *TxCacheStub) DelState(key string) error
- func (bts *TxCacheStub) GetMultipleStates(keys ...string) ([][]byte, error)
- func (bts *TxCacheStub) GetState(key string) ([]byte, error)
- func (bts *TxCacheStub) GetTxID() string
- func (bts *TxCacheStub) GetTxTimestamp() (*timestamppb.Timestamp, error)
- func (bts *TxCacheStub) InvokeChaincode(chaincodeName string, args [][]byte, channel string) *pb.Response
- func (bts *TxCacheStub) PutState(key string, value []byte) error
- func (bts *TxCacheStub) SetEvent(name string, payload []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchCacheStub ¶
type BatchCacheStub struct {
shim.ChaincodeStubInterface
Swaps []*proto.Swap
MultiSwaps []*proto.MultiSwap
// contains filtered or unexported fields
}
func NewBatchCacheStub ¶
func NewBatchCacheStub(stub shim.ChaincodeStubInterface) *BatchCacheStub
func (*BatchCacheStub) Commit ¶
func (bs *BatchCacheStub) Commit() error
Commit puts state from a BatchCacheStub cache to the chaincode state
func (*BatchCacheStub) DelState ¶
func (bs *BatchCacheStub) DelState(key string) error
DelState - marks state in BatchCacheStub cache as deleted
func (*BatchCacheStub) GetMultipleStates ¶ added in v0.1.4
func (bs *BatchCacheStub) GetMultipleStates(keys ...string) ([][]byte, error)
GetMultipleStates returns state from BatchCacheStub cache or, if absent, from batchState cache
func (*BatchCacheStub) GetState ¶
func (bs *BatchCacheStub) GetState(key string) ([]byte, error)
GetState returns state from BatchCacheStub cache or, if absent, from chaincode state
func (*BatchCacheStub) InvokeChaincode ¶ added in v0.0.3
func (*BatchCacheStub) NewTxCacheStub ¶
func (bs *BatchCacheStub) NewTxCacheStub(txID string, txTimestamp *timestamppb.Timestamp) *TxCacheStub
type TxCacheStub ¶
type TxCacheStub struct {
*BatchCacheStub
Accounting []*proto.AccountingRecord
// contains filtered or unexported fields
}
func (*TxCacheStub) AddAccountingRecord ¶
func (bts *TxCacheStub) AddAccountingRecord( token string, from *types.Address, to *types.Address, amount *big.Int, senderBalanceType balance.BalanceType, recipientBalanceType balance.BalanceType, reason string, )
func (*TxCacheStub) Commit ¶
func (bts *TxCacheStub) Commit() ([]*proto.WriteElement, []*proto.Event)
Commit puts state from a TxCacheStub cache to the BatchCacheStub cache
func (*TxCacheStub) DelState ¶
func (bts *TxCacheStub) DelState(key string) error
DelState marks state in TxCacheStub as deleted
func (*TxCacheStub) GetMultipleStates ¶ added in v0.1.4
func (bts *TxCacheStub) GetMultipleStates(keys ...string) ([][]byte, error)
GetMultipleStates returns state from TxCacheStub cache or, if absent, from batchState cache
func (*TxCacheStub) GetState ¶
func (bts *TxCacheStub) GetState(key string) ([]byte, error)
GetState returns state from TxCacheStub cache or, if absent, from batchState cache
func (*TxCacheStub) GetTxID ¶
func (bts *TxCacheStub) GetTxID() string
GetTxID returns TxCacheStub transaction ID
func (*TxCacheStub) GetTxTimestamp ¶ added in v0.0.10
func (bts *TxCacheStub) GetTxTimestamp() (*timestamppb.Timestamp, error)
GetTxTimestamp returns TxCacheStub transaction timestamp