Documentation ¶
Index ¶
- Constants
- func DecodeString(s string) ([]byte, error)
- func DefaultDBProvider(stub shim.ChaincodeStubInterface) dbm.DB
- func EncodeToString(bz []byte) string
- func HandlePacketAcknowledgementEvent(ctx contractapi.TransactionContextInterface, events []abci.Event) (continue_ bool, err error)
- func HandlePacketEvent(ctx contractapi.TransactionContextInterface, events []abci.Event) (continue_ bool, err error)
- type AppProvider
- type AppRunner
- func (r AppRunner) GetBlockProvider(stub shim.ChaincodeStubInterface) app.BlockProvider
- func (r AppRunner) Init(stub shim.ChaincodeStubInterface, appStateBytes []byte) error
- func (r AppRunner) Query(stub shim.ChaincodeStubInterface, req app.RequestQuery) (*app.ResponseQuery, error)
- func (r AppRunner) RunFunc(stub shim.ChaincodeStubInterface, f func(app.Application) error) error
- func (r AppRunner) RunTx(stub shim.ChaincodeStubInterface, txBytes []byte) (*app.ResponseTx, []abci.Event, error)
- type DBProvider
- type EventHandler
- type EventHandlerFunc
- type IBCChaincode
- func (c *IBCChaincode) EndorseChannelState(ctx contractapi.TransactionContextInterface, portID, channelID string) (*commitment.CommitmentEntry, error)
- func (c *IBCChaincode) EndorseClientState(ctx contractapi.TransactionContextInterface, clientID string) (*commitment.CommitmentEntry, error)
- func (c *IBCChaincode) EndorseConnectionState(ctx contractapi.TransactionContextInterface, connectionID string) (*commitment.CommitmentEntry, error)
- func (c *IBCChaincode) EndorseConsensusStateCommitment(ctx contractapi.TransactionContextInterface, clientID string, height uint64) (*commitment.CommitmentEntry, error)
- func (c *IBCChaincode) EndorseNextSequenceRecv(ctx contractapi.TransactionContextInterface, portID, channelID string) (*commitment.CommitmentEntry, error)
- func (c *IBCChaincode) EndorsePacketAcknowledgement(ctx contractapi.TransactionContextInterface, portID, channelID string, ...) (*commitment.CommitmentEntry, error)
- func (c *IBCChaincode) EndorsePacketCommitment(ctx contractapi.TransactionContextInterface, portID, channelID string, ...) (*commitment.CommitmentEntry, error)
- func (c *IBCChaincode) EndorsePacketReceiptAbsence(ctx contractapi.TransactionContextInterface, portID, channelID string, ...) (*commitment.CommitmentEntry, error)
- func (c *IBCChaincode) EndorseSequenceCommitment(ctx contractapi.TransactionContextInterface) (*commitment.CommitmentEntry, error)
- func (c IBCChaincode) GetAppRunner() AppRunner
- func (c *IBCChaincode) GetIgnoredFunctions() []string
- func (c *IBCChaincode) GetSequence(ctx contractapi.TransactionContextInterface) (*commitment.Sequence, error)
- func (c *IBCChaincode) HandleTx(ctx contractapi.TransactionContextInterface, txJSON string) (*app.ResponseTx, error)
- func (c *IBCChaincode) InitChaincode(ctx contractapi.TransactionContextInterface, appStateJSON string) error
- func (c *IBCChaincode) Query(ctx contractapi.TransactionContextInterface, reqJSON string) (*app.ResponseQuery, error)
- func (c *IBCChaincode) QueryPacket(ctx contractapi.TransactionContextInterface, portID, channelID string, ...) (string, error)
- func (c *IBCChaincode) QueryPacketAcknowledgement(ctx contractapi.TransactionContextInterface, portID, channelID string, ...) (string, error)
- func (c *IBCChaincode) SetEventHandler(handler MultiEventHandler)
- func (c *IBCChaincode) UpdateSequence(ctx contractapi.TransactionContextInterface) (*commitment.Sequence, error)
- type MultiEventHandler
Constants ¶
const (
EventIBC = "ibc"
)
Variables ¶
This section is empty.
Functions ¶
func DecodeString ¶
func DefaultDBProvider ¶
func DefaultDBProvider(stub shim.ChaincodeStubInterface) dbm.DB
func EncodeToString ¶
func HandlePacketAcknowledgementEvent ¶
func HandlePacketAcknowledgementEvent(ctx contractapi.TransactionContextInterface, events []abci.Event) (continue_ bool, err error)
HandlePacketAcknowledgementEvent handles events and put acks which are parsed from events on state DB
func HandlePacketEvent ¶
func HandlePacketEvent(ctx contractapi.TransactionContextInterface, events []abci.Event) (continue_ bool, err error)
HandlePacketEvent handles events and put packets which are parsed from events on state DB
Types ¶
type AppProvider ¶
type AppProvider func(appName string, logger log.Logger, db dbm.DB, traceStore io.Writer, seqMgr commitment.SequenceManager, blockProvider app.BlockProvider, anteHandlerProvider app.AnteHandlerProvider) (app.Application, error)
type AppRunner ¶
type AppRunner struct {
// contains filtered or unexported fields
}
func NewAppRunner ¶
func NewAppRunner( appName string, logger log.Logger, appProvider AppProvider, anteHandlerProvider app.AnteHandlerProvider, dbProvider DBProvider, seqMgr commitment.SequenceManager, ) AppRunner
func (AppRunner) GetBlockProvider ¶
func (r AppRunner) GetBlockProvider(stub shim.ChaincodeStubInterface) app.BlockProvider
func (AppRunner) Init ¶
func (r AppRunner) Init(stub shim.ChaincodeStubInterface, appStateBytes []byte) error
func (AppRunner) Query ¶
func (r AppRunner) Query(stub shim.ChaincodeStubInterface, req app.RequestQuery) (*app.ResponseQuery, error)
func (AppRunner) RunFunc ¶
func (r AppRunner) RunFunc(stub shim.ChaincodeStubInterface, f func(app.Application) error) error
type DBProvider ¶
type DBProvider func(shim.ChaincodeStubInterface) dbm.DB
type EventHandler ¶
type EventHandler interface {
Handle(ctx contractapi.TransactionContextInterface, events []abci.Event) (continue_ bool, err error)
}
EventHandler defines the interface of handling the events of application
type EventHandlerFunc ¶
type EventHandlerFunc func(ctx contractapi.TransactionContextInterface, events []abci.Event) (continue_ bool, err error)
EventHandlerFunc is a function type which handles application events
func (EventHandlerFunc) Handle ¶
func (f EventHandlerFunc) Handle(ctx contractapi.TransactionContextInterface, events []abci.Event) (continue_ bool, err error)
Handle implements EventHandler.Handle
type IBCChaincode ¶
type IBCChaincode struct { contractapi.Contract // contains filtered or unexported fields }
IBCChaincode provides Cosmos-SDK based Applicatoin which implements IBC
func NewIBCChaincode ¶
func NewIBCChaincode(appName string, logger log.Logger, seqMgr commitment.SequenceManager, appProvider AppProvider, anteHandlerProvider app.AnteHandlerProvider, dbProvider DBProvider, eventHandler MultiEventHandler) *IBCChaincode
NewIBCChaincode returns a new instance of IBCChaincode
func (*IBCChaincode) EndorseChannelState ¶
func (c *IBCChaincode) EndorseChannelState(ctx contractapi.TransactionContextInterface, portID, channelID string) (*commitment.CommitmentEntry, error)
func (*IBCChaincode) EndorseClientState ¶
func (c *IBCChaincode) EndorseClientState(ctx contractapi.TransactionContextInterface, clientID string) (*commitment.CommitmentEntry, error)
func (*IBCChaincode) EndorseConnectionState ¶
func (c *IBCChaincode) EndorseConnectionState(ctx contractapi.TransactionContextInterface, connectionID string) (*commitment.CommitmentEntry, error)
func (*IBCChaincode) EndorseConsensusStateCommitment ¶
func (c *IBCChaincode) EndorseConsensusStateCommitment(ctx contractapi.TransactionContextInterface, clientID string, height uint64) (*commitment.CommitmentEntry, error)
func (*IBCChaincode) EndorseNextSequenceRecv ¶
func (c *IBCChaincode) EndorseNextSequenceRecv(ctx contractapi.TransactionContextInterface, portID, channelID string) (*commitment.CommitmentEntry, error)
func (*IBCChaincode) EndorsePacketAcknowledgement ¶
func (c *IBCChaincode) EndorsePacketAcknowledgement(ctx contractapi.TransactionContextInterface, portID, channelID string, sequence uint64) (*commitment.CommitmentEntry, error)
func (*IBCChaincode) EndorsePacketCommitment ¶
func (c *IBCChaincode) EndorsePacketCommitment(ctx contractapi.TransactionContextInterface, portID, channelID string, sequence uint64) (*commitment.CommitmentEntry, error)
func (*IBCChaincode) EndorsePacketReceiptAbsence ¶ added in v0.2.1
func (c *IBCChaincode) EndorsePacketReceiptAbsence(ctx contractapi.TransactionContextInterface, portID, channelID string, sequence uint64) (*commitment.CommitmentEntry, error)
func (*IBCChaincode) EndorseSequenceCommitment ¶
func (c *IBCChaincode) EndorseSequenceCommitment(ctx contractapi.TransactionContextInterface) (*commitment.CommitmentEntry, error)
func (IBCChaincode) GetAppRunner ¶
func (c IBCChaincode) GetAppRunner() AppRunner
func (*IBCChaincode) GetIgnoredFunctions ¶
func (c *IBCChaincode) GetIgnoredFunctions() []string
func (*IBCChaincode) GetSequence ¶
func (c *IBCChaincode) GetSequence(ctx contractapi.TransactionContextInterface) (*commitment.Sequence, error)
GetSequence returns current Sequence
func (*IBCChaincode) HandleTx ¶
func (c *IBCChaincode) HandleTx(ctx contractapi.TransactionContextInterface, txJSON string) (*app.ResponseTx, error)
HandleTx handles a transaction
func (*IBCChaincode) InitChaincode ¶
func (c *IBCChaincode) InitChaincode(ctx contractapi.TransactionContextInterface, appStateJSON string) error
InitChaincode initialize the state of the chaincode This must be called when the chaincode is initialized
func (*IBCChaincode) Query ¶
func (c *IBCChaincode) Query(ctx contractapi.TransactionContextInterface, reqJSON string) (*app.ResponseQuery, error)
func (*IBCChaincode) QueryPacket ¶
func (c *IBCChaincode) QueryPacket(ctx contractapi.TransactionContextInterface, portID, channelID string, sequence uint64) (string, error)
QueryPacket returns a packet that matches given arguments
func (*IBCChaincode) QueryPacketAcknowledgement ¶
func (c *IBCChaincode) QueryPacketAcknowledgement(ctx contractapi.TransactionContextInterface, portID, channelID string, sequence uint64) (string, error)
QueryPacketAcknowledgement returns a packet acknowledgement that matches given arguments
func (*IBCChaincode) SetEventHandler ¶
func (c *IBCChaincode) SetEventHandler(handler MultiEventHandler)
SetEventHandler sets IBCChaincode to a given handler
func (*IBCChaincode) UpdateSequence ¶
func (c *IBCChaincode) UpdateSequence(ctx contractapi.TransactionContextInterface) (*commitment.Sequence, error)
UpdateSequence updates Sequence
type MultiEventHandler ¶
type MultiEventHandler struct {
// contains filtered or unexported fields
}
MultiEventHandler is a handler which handles application events by multiple handlers
func DefaultMultiEventHandler ¶
func DefaultMultiEventHandler() MultiEventHandler
DefaultMultiEventHandler returns a handler which satisfies minimum requirements
func NewMultiEventHandler ¶
func NewMultiEventHandler(handlers ...EventHandler) MultiEventHandler
NewMultiEventHandler creates a instance of MultiEventHandler
func (MultiEventHandler) Handle ¶
func (mh MultiEventHandler) Handle(ctx contractapi.TransactionContextInterface, events []abci.Event) error
Handle handles a given events by multiple handlers