cachestub

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 5 Imported by: 0

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) GetState

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

GetState returns state from BatchCacheStub cache or, if absent, from chaincode state

func (*BatchCacheStub) NewTxCacheStub

func (bs *BatchCacheStub) NewTxCacheStub(txID string) *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, 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) 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) 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