cachestub

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 (bs *BatchCacheStub) InvokeChaincode(chaincodeName string, args [][]byte, channel string) *peer.Response

func (*BatchCacheStub) NewTxCacheStub

func (bs *BatchCacheStub) NewTxCacheStub(txID string, txTimestamp *timestamppb.Timestamp) *TxCacheStub

func (*BatchCacheStub) PutState

func (bs *BatchCacheStub) PutState(key string, value []byte) error

PutState puts state to a BatchCacheStub cache

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

func (*TxCacheStub) InvokeChaincode added in v0.0.3

func (bts *TxCacheStub) InvokeChaincode(chaincodeName string, args [][]byte, channel string) *pb.Response

func (*TxCacheStub) PutState

func (bts *TxCacheStub) PutState(key string, value []byte) error

PutState puts state to the TxCacheStub's cache

func (*TxCacheStub) SetEvent

func (bts *TxCacheStub) SetEvent(name string, payload []byte) error

SetEvent sets payload to a TxCacheStub events

Jump to

Keyboard shortcuts

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