Documentation ¶
Index ¶
- Constants
- Variables
- func KeyContractResult(txID TxID, txIndex TxIndex) []byte
- func KeyCoordinator(txID TxID) []byte
- func KeyPrefixBytes(prefix uint8) []byte
- func KeyTx(txID TxID, txIndex TxIndex) []byte
- func KeyUnacknowledgedPacket(sourcePort, sourceChannel string, seq uint64) []byte
- func MakeHashFromABCIHeader(header abci.Header) *tmtypes.Header
- func MakeObjectKey(callInfo ContractCallInfo, signers []sdk.AccAddress) []byte
- func MarshalJSONPacketAcknowledgementData(data PacketAcknowledgementData) ([]byte, error)
- func MarshalPacketData(data PacketData) ([]byte, error)
- func RegisterCodec(cdc *codec.Codec)
- func SignersFromContext(ctx sdk.Context) ([]sdk.AccAddress, bool)
- func UnmarshalJSONPacketAcknowledgementData(bz []byte, ad *PacketAcknowledgementData) error
- func UnmarshalJSONPacketData(bz []byte, pd *PacketData) error
- func UnmarshalJSONPacketDataPayload(cdc *codec.Codec, bz []byte, pd *PacketData, ptr interface{}) error
- func WithSigners(ctx sdk.Context, signers []sdk.AccAddress) sdk.Context
- type ACKSender
- type CallResultLink
- type ChainID
- type ChannelInfo
- type ChannelInfoResolver
- type ChannelKeeper
- type ChannelResolver
- type ChannelResolverCapabilities
- type Committer
- type ConstantValueObject
- type ContractCallInfo
- type ContractCallResult
- type ContractHandler
- type ContractHandlerAbortResult
- type ContractHandlerResult
- type ContractRuntimeInfo
- type ContractTransaction
- type ContractTransactionInfo
- type ContractTransactions
- type CoordinatorInfo
- type FakeResolver
- type Header
- type HexByteArray32
- func (bz HexByteArray32) Bytes() []byte
- func (bz HexByteArray32) Format(s fmt.State, verb rune)
- func (bz *HexByteArray32) FromString(s string) error
- func (bz HexByteArray32) Marshal() ([]byte, error)
- func (bz HexByteArray32) MarshalJSON() ([]byte, error)
- func (bz HexByteArray32) String() string
- func (bz *HexByteArray32) Unmarshal(data []byte) error
- func (bz *HexByteArray32) UnmarshalJSON(data []byte) error
- type IncomingPacket
- type IncomingPacketAcknowledgement
- type Link
- type LinkType
- type Linker
- type MsgInitiate
- type OP
- type OPs
- type Object
- type ObjectResolver
- type ObjectResolverProvider
- type ObjectType
- type OutgoingPacket
- type OutgoingPacketAcknowledgement
- type PacketAcknowledgementData
- type PacketAcknowledgementPayload
- type PacketData
- type PacketDataPayload
- type PacketMiddleware
- type PacketSender
- type PortKeeper
- type QueryCoordinatorStatusRequest
- type QueryCoordinatorStatusResponse
- type QueryUnacknowledgedPacketsRequest
- type QueryUnacknowledgedPacketsResponse
- type ReturnValue
- type SequentialResolver
- type State
- type StateConstraint
- type StateConstraintType
- type Store
- type TxID
- type TxIndex
- type TxInfo
- type UnacknowledgedPacket
Constants ¶
const ( // ModuleName is the name of the module ModuleName = "cross" // Version defines the current version the Cross // module supports Version = "cross-1" // PortID that Cross module binds to PortID = "cross" // StoreKey to be used when creating the KVStore StoreKey = ModuleName // RouterKey is the msg router key for the IBC module RouterKey string = ModuleName // QuerierRoute is the querier route for Cross QuerierRoute = ModuleName )
const ( KeyCoordinatorPrefix uint8 = iota KeyTxPrefix KeyContractResultPrefix KeyUnacknowledgedPacketPrefix )
const ( QueryCoordinatorStatus = "coordinator_status" QueryUnacknowledgedPackets = "unacknowledged_packets" )
const ( CO_STATUS_NONE uint8 = iota CO_STATUS_INIT CO_STATUS_DECIDED // abort or commit )
const ( CO_DECISION_NONE uint8 = iota CO_DECISION_COMMIT CO_DECISION_ABORT )
const ( COMMIT_PROTOCOL_SIMPLE uint8 = iota // Default COMMIT_PROTOCOL_TPC // Two-phase commit )
const ( PREPARE_RESULT_OK uint8 = iota + 1 PREPARE_RESULT_FAILED )
const ( TX_STATUS_PREPARE uint8 = iota + 1 TX_STATUS_COMMIT TX_STATUS_ABORT )
const (
MaxContractTransactoinNum = math.MaxUint8
)
const TypeInitiate = "cross_initiate"
Variables ¶
var ( ErrFailedInitiateTx = sdkerrors.Register(ModuleName, 2, "failed to initiate a transaction") ErrFailedPrepare = sdkerrors.Register(ModuleName, 3, "failed to prepare a commit") ErrFailedRecievePrepareResult = sdkerrors.Register(ModuleName, 4, "failed to receive a PrepareResult") ErrFailedMulticastCommitPacket = sdkerrors.Register(ModuleName, 5, "failed to multicast a CommitPacket") ErrFailedReceiveCommitPacket = sdkerrors.Register(ModuleName, 6, "failed to receive a CommitPacket") ErrFailedSendAckCommitPacket = sdkerrors.Register(ModuleName, 7, "failed to send an AckCommitPacket") ErrFailedReceiveAckCommitPacket = sdkerrors.Register(ModuleName, 8, "failed to receive an AckCommitPacket") ErrCoordinatorNotFound = sdkerrors.Register(ModuleName, 100, "coordinator not found") )
var ModuleCdc = codec.New()
ModuleCdc is the codec for the module
Functions ¶
func KeyContractResult ¶
func KeyCoordinator ¶
func KeyPrefixBytes ¶
KeyPrefixBytes return the key prefix bytes from a URL string format
func KeyUnacknowledgedPacket ¶
func MakeObjectKey ¶ added in v0.0.5
func MakeObjectKey(callInfo ContractCallInfo, signers []sdk.AccAddress) []byte
MakeObjectKey returns a key that can be used to identify a contract call
func MarshalJSONPacketAcknowledgementData ¶ added in v0.0.6
func MarshalJSONPacketAcknowledgementData(data PacketAcknowledgementData) ([]byte, error)
func MarshalPacketData ¶ added in v0.0.6
func MarshalPacketData(data PacketData) ([]byte, error)
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
func SignersFromContext ¶
func SignersFromContext(ctx sdk.Context) ([]sdk.AccAddress, bool)
func UnmarshalJSONPacketAcknowledgementData ¶ added in v0.0.6
func UnmarshalJSONPacketAcknowledgementData(bz []byte, ad *PacketAcknowledgementData) error
func UnmarshalJSONPacketData ¶ added in v0.0.6
func UnmarshalJSONPacketData(bz []byte, pd *PacketData) error
func UnmarshalJSONPacketDataPayload ¶ added in v0.0.6
func UnmarshalJSONPacketDataPayload(cdc *codec.Codec, bz []byte, pd *PacketData, ptr interface{}) error
func WithSigners ¶
Types ¶
type ACKSender ¶ added in v0.0.6
type ACKSender interface { SendACK( ctx sdk.Context, ack OutgoingPacketAcknowledgement, ) error }
func NewSimpleACKSender ¶ added in v0.0.6
func NewSimpleACKSender() ACKSender
type CallResultLink ¶ added in v0.0.5
type CallResultLink struct {
ContractTransactionIndex TxIndex
}
CallResultLink is a link with an object returned from external contract call
func NewCallResultLink ¶ added in v0.0.5
func NewCallResultLink(idx TxIndex) CallResultLink
NewCallResultLink returns CallResultLink
func (CallResultLink) SourceIndex ¶ added in v0.0.5
func (l CallResultLink) SourceIndex() TxIndex
SourceIndex implements Link.SourceIndex
func (CallResultLink) Type ¶ added in v0.0.5
func (l CallResultLink) Type() LinkType
Type implements Link.Type
type ChainID ¶ added in v0.0.6
ChainID represents an ID of chain that contains a contract function to be called
type ChannelInfo ¶
type ChannelInfo struct { Port string `json:"port" yaml:"port"` // the port on which the packet will be sent Channel string `json:"channel" yaml:"channel"` // the channel by which the packet will be sent }
func NewChannelInfo ¶
func NewChannelInfo(port, channel string) ChannelInfo
func (ChannelInfo) Equal ¶ added in v0.0.6
func (ci ChannelInfo) Equal(other ChainID) bool
Equal implements ChainID.Equal
func (ChannelInfo) String ¶ added in v0.0.6
func (ci ChannelInfo) String() string
String implements ChainID.String
func (ChannelInfo) Type ¶ added in v0.0.6
func (ci ChannelInfo) Type() string
Type implements ChainID.Type
func (ChannelInfo) ValidateBasic ¶
func (c ChannelInfo) ValidateBasic() error
type ChannelInfoResolver ¶ added in v0.0.6
type ChannelInfoResolver struct{}
ChannelInfoResolver just returns a given ChannelInfo as is.
func (ChannelInfoResolver) Capabilities ¶ added in v0.0.6
func (r ChannelInfoResolver) Capabilities() ChannelResolverCapabilities
Capabilities implements ChannelResolver.Capabilities
func (ChannelInfoResolver) Resolve ¶ added in v0.0.6
func (r ChannelInfoResolver) Resolve(ctx sdk.Context, chainID ChainID) (*ChannelInfo, error)
Resolve implements ChannelResolver.ResResolve
type ChannelKeeper ¶
type ChannelKeeper interface { GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channel.Channel, found bool) GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool) SendPacket(ctx sdk.Context, channelCap *capability.Capability, packet channelexported.PacketI) error PacketExecuted(ctx sdk.Context, chanCap *capability.Capability, packet channelexported.PacketI, acknowledgement []byte) error }
ChannelKeeper defines the expected IBC channel keeper
type ChannelResolver ¶ added in v0.0.6
type ChannelResolver interface { Resolve(ctx sdk.Context, chainID ChainID) (*ChannelInfo, error) Capabilities() ChannelResolverCapabilities }
ChannelResolver defines the interface of resolver resolves chainID to ChannelInfo
type ChannelResolverCapabilities ¶ added in v0.0.6
type ChannelResolverCapabilities interface { // CrossChainCalls returns true if support for cross-chain calls is enabled. CrossChainCalls() bool }
ChannelResolverCapabilities defines the capabilities for the ChannelResolver
type ConstantValueObject ¶ added in v0.0.5
ConstantValueObject is an Object wraps a constant value
func MakeConstantValueObject ¶ added in v0.0.5
func MakeConstantValueObject(chainID ChainID, key []byte, value []byte) ConstantValueObject
MakeConstantValueObject returns ConstantValueObject
func (ConstantValueObject) ChainID ¶ added in v0.0.6
func (l ConstantValueObject) ChainID() ChainID
ChainID implements Object.ChainID
func (ConstantValueObject) Evaluate ¶ added in v0.0.5
func (l ConstantValueObject) Evaluate(bz []byte) ([]byte, error)
Evaluate returns a constant value
func (ConstantValueObject) Key ¶ added in v0.0.5
func (l ConstantValueObject) Key() []byte
Key implements Object.Key
func (ConstantValueObject) Type ¶ added in v0.0.5
func (l ConstantValueObject) Type() ObjectType
Type implements Object.Type
type ContractCallInfo ¶ added in v0.0.3
type ContractCallInfo []byte
type ContractCallResult ¶
type ContractCallResult struct { ChainID string `json:"chain_id" yaml:"chain_id"` Height int64 `json:"height" yaml:"height"` Signers []sdk.AccAddress `json:"signers" yaml:"signers"` CallInfo ContractCallInfo `json:"call_info" yaml:"call_info"` StateConstraint StateConstraint `json:"state_constraint" yaml:"state_constraint"` }
func (ContractCallResult) String ¶
func (r ContractCallResult) String() string
type ContractHandler ¶
type ContractHandler interface { GetState(ctx sdk.Context, callInfo ContractCallInfo, rtInfo ContractRuntimeInfo) (State, error) Handle(ctx sdk.Context, callInfo ContractCallInfo, rtInfo ContractRuntimeInfo) (State, ContractHandlerResult, error) OnCommit(ctx sdk.Context, result ContractHandlerResult) ContractHandlerResult }
type ContractHandlerAbortResult ¶
type ContractHandlerAbortResult struct{}
func (ContractHandlerAbortResult) GetData ¶
func (ContractHandlerAbortResult) GetData() []byte
func (ContractHandlerAbortResult) GetEvents ¶
func (ContractHandlerAbortResult) GetEvents() sdk.Events
type ContractHandlerResult ¶
type ContractRuntimeInfo ¶ added in v0.0.5
type ContractRuntimeInfo struct { StateConstraintType StateConstraintType ExternalObjectResolver ObjectResolver }
type ContractTransaction ¶
type ContractTransaction struct { ChainID ChainID `json:"chain_id" yaml:"chain_id"` Signers []sdk.AccAddress `json:"signers" yaml:"signers"` CallInfo ContractCallInfo `json:"call_info" yaml:"call_info"` StateConstraint StateConstraint `json:"state_constraint" yaml:"state_constraint"` ReturnValue *ReturnValue `json:"return_value" yaml:"return_value"` Links []Link `json:"links" yaml:"links"` }
func NewContractTransaction ¶
func NewContractTransaction(chainID ChainID, signers []sdk.AccAddress, callInfo ContractCallInfo, sc StateConstraint, rv *ReturnValue, links []Link) ContractTransaction
func (ContractTransaction) ValidateBasic ¶
func (t ContractTransaction) ValidateBasic() error
type ContractTransactionInfo ¶ added in v0.0.5
type ContractTransactionInfo struct { Transaction ContractTransaction `json:"transaction" yaml:"transaction"` LinkObjects []Object `json:"link_objects" yaml:"link_objects"` }
func NewContractTransactionInfo ¶ added in v0.0.5
func NewContractTransactionInfo(tx ContractTransaction, linkObjects []Object) ContractTransactionInfo
func (ContractTransactionInfo) ValidateBasic ¶ added in v0.0.5
func (ti ContractTransactionInfo) ValidateBasic() error
type ContractTransactions ¶
type ContractTransactions = []ContractTransaction
type CoordinatorInfo ¶
type CoordinatorInfo struct { Transactions []string // {TxIndex => ConnectionID} Channels []ChannelInfo // {TxIndex => Channel} Status uint8 Decision uint8 ConfirmedTransactions []TxIndex // [TxIndex] Acks []TxIndex // [TxIndex] }
func NewCoordinatorInfo ¶
func NewCoordinatorInfo(status uint8, tss []string, channels []ChannelInfo) CoordinatorInfo
func (*CoordinatorInfo) AddAck ¶
func (ci *CoordinatorInfo) AddAck(txIndex TxIndex) bool
func (*CoordinatorInfo) Confirm ¶
func (ci *CoordinatorInfo) Confirm(txIndex TxIndex, connectionID string) error
func (*CoordinatorInfo) IsCompleted ¶
func (ci *CoordinatorInfo) IsCompleted() bool
func (*CoordinatorInfo) IsReceivedALLAcks ¶
func (ci *CoordinatorInfo) IsReceivedALLAcks() bool
type FakeResolver ¶ added in v0.0.5
type FakeResolver struct{}
FakeResolver is a resolver that always fails to resolve an object
func NewFakeResolver ¶ added in v0.0.5
func NewFakeResolver() FakeResolver
NewFakeResolver returns FakeResolver
type HexByteArray32 ¶
type HexByteArray32 [32]byte
func (HexByteArray32) Bytes ¶
func (bz HexByteArray32) Bytes() []byte
Allow it to fulfill various interfaces in light-client, etc...
func (*HexByteArray32) FromString ¶
func (bz *HexByteArray32) FromString(s string) error
func (HexByteArray32) Marshal ¶
func (bz HexByteArray32) Marshal() ([]byte, error)
Marshal needed for protobuf compatibility
func (HexByteArray32) MarshalJSON ¶
func (bz HexByteArray32) MarshalJSON() ([]byte, error)
This is the point of Bytes.
func (HexByteArray32) String ¶
func (bz HexByteArray32) String() string
func (*HexByteArray32) Unmarshal ¶
func (bz *HexByteArray32) Unmarshal(data []byte) error
Unmarshal needed for protobuf compatibility
func (*HexByteArray32) UnmarshalJSON ¶
func (bz *HexByteArray32) UnmarshalJSON(data []byte) error
This is the point of Bytes.
type IncomingPacket ¶ added in v0.0.6
type IncomingPacket interface { exported.PacketI PacketData() PacketData Header() Header Payload() PacketDataPayload }
IncomingPacket defines the interface of incoming packet
func NewIncomingPacket ¶ added in v0.0.6
func NewIncomingPacket(raw exported.PacketI, packetData PacketData, payload PacketDataPayload) IncomingPacket
NewIncomingPacket returns a new IncomingPacket
func UnmarshalJSONIncomingPacket ¶ added in v0.0.6
type IncomingPacketAcknowledgement ¶ added in v0.0.6
type IncomingPacketAcknowledgement interface { Data() PacketAcknowledgementData Header() Header Payload() PacketAcknowledgementPayload }
IncomingPacketAcknowledgement defines the interface of incoming packet acknowledgement
func NewIncomingPacketAcknowledgement ¶ added in v0.0.6
func NewIncomingPacketAcknowledgement(h *Header, payload PacketAcknowledgementPayload) IncomingPacketAcknowledgement
NewIncomingPacketAcknowledgement returns a new IncomingPacketAcknowledgement
func UnmarshalJSONIncomingPacketAcknowledgement ¶ added in v0.0.6
func UnmarshalJSONIncomingPacketAcknowledgement(cdc *codec.Codec, bz []byte) (IncomingPacketAcknowledgement, error)
type Link ¶ added in v0.0.5
Link is a link to an Object that is referenced in the call to the contract
type Linker ¶ added in v0.0.5
type Linker struct {
// contains filtered or unexported fields
}
Linker resolves links that each ContractTransaction has.
func MakeLinker ¶ added in v0.0.5
func MakeLinker(txs ContractTransactions) (*Linker, error)
MakeLinker returns Linker
type MsgInitiate ¶
type MsgInitiate struct { Sender sdk.AccAddress ChainID string // chainID of Coordinator node ContractTransactions []ContractTransaction TimeoutHeight int64 // Timeout for this msg Nonce uint64 CommitProtocol uint8 // Commit type }
MsgInitiate initiates a Cross-chain transaction
func NewMsgInitiate ¶
func NewMsgInitiate(sender sdk.AccAddress, chainID string, transactions []ContractTransaction, timeoutHeight int64, nonce uint64, cp uint8) MsgInitiate
NewMsgInitiate returns MsgInitiate
func (MsgInitiate) GetSignBytes ¶
func (msg MsgInitiate) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (MsgInitiate) GetSigners ¶
func (msg MsgInitiate) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg GetSigners returns the addresses that must sign the transaction. Addresses are returned in a deterministic order. Duplicate addresses will be omitted.
func (MsgInitiate) ValidateBasic ¶
func (msg MsgInitiate) ValidateBasic() error
ValidateBasic implements sdk.Msg
type Object ¶ added in v0.0.5
type Object interface { Type() ObjectType Key() []byte ChainID() ChainID Evaluate([]byte) ([]byte, error) }
Object wraps an actual value
type ObjectResolver ¶ added in v0.0.5
ObjectResolver resolves a given key to Object
type ObjectResolverProvider ¶ added in v0.0.5
type ObjectResolverProvider func(libs []Object) (ObjectResolver, error)
ObjectResolverProvider is a provider of ObjectResolver
func DefaultResolverProvider ¶ added in v0.0.5
func DefaultResolverProvider() ObjectResolverProvider
DefaultResolverProvider returns a default implements of ObjectResolver
type ObjectType ¶ added in v0.0.5
type ObjectType = uint8
ObjectType is a type of Object
const ( // ObjectTypeConstantValue is ObjectType indicates a constant value ObjectTypeConstantValue ObjectType = iota + 1 )
type OutgoingPacket ¶ added in v0.0.6
type OutgoingPacket interface { IncomingPacket SetPacketData(header Header, payload PacketDataPayload) }
OutgoingPacket defines the interface of outgoing packet
func NewOutgoingPacket ¶ added in v0.0.6
func NewOutgoingPacket(raw exported.PacketI, packetData PacketData, payload PacketDataPayload) OutgoingPacket
NewOutgoingPacket returns a new OutgoingPacket
type OutgoingPacketAcknowledgement ¶ added in v0.0.6
type OutgoingPacketAcknowledgement interface { IncomingPacketAcknowledgement SetData(header Header, payload PacketAcknowledgementPayload) }
OutgoingPacketAcknowledgement defines the interface of outgoing packet acknowledgement
func NewOutgoingPacketAcknowledgement ¶ added in v0.0.6
func NewOutgoingPacketAcknowledgement(h *Header, payload PacketAcknowledgementPayload) OutgoingPacketAcknowledgement
NewOutgoingPacketAcknowledgement returns a new OutgoingPacketAcknowledgement
type PacketAcknowledgementData ¶ added in v0.0.6
type PacketAcknowledgementData = PacketData
func NewPacketAcknowledgementData ¶ added in v0.0.6
func NewPacketAcknowledgementData(h *Header, payload PacketAcknowledgementPayload) PacketAcknowledgementData
NewPacketAcknowledgementData returns a new PacketAcknowledgementData
type PacketAcknowledgementPayload ¶ added in v0.0.6
type PacketAcknowledgementPayload interface { ValidateBasic() error GetBytes() []byte Type() string }
PacketAcknowledgementPayload defines the interface of packet ack's payload
type PacketData ¶
type PacketData = sptypes.PacketData
func NewPacketData ¶ added in v0.0.6
func NewPacketData(h *Header, payload []byte) PacketData
NewPacketData returns a new packet data
type PacketDataPayload ¶ added in v0.0.6
PacketDataPayload defines the interface of packet data's payload
type PacketMiddleware ¶ added in v0.0.6
type PacketMiddleware interface { // HandleMsg handles sdk.Msg HandleMsg(ctx sdk.Context, msg sdk.Msg, ps PacketSender) (sdk.Context, PacketSender, error) // HandlePacket handles a packet HandlePacket(ctx sdk.Context, packet IncomingPacket, ps PacketSender, as ACKSender) (sdk.Context, PacketSender, ACKSender, error) // HandleACK handles a packet and packet ack HandleACK(ctx sdk.Context, packet IncomingPacket, ack IncomingPacketAcknowledgement, ps PacketSender) (sdk.Context, PacketSender, error) }
PacketMiddleware defines middleware interface of handling packets
func NewNOPPacketMiddleware ¶ added in v0.0.6
func NewNOPPacketMiddleware() PacketMiddleware
NewNOPPacketMiddleware returns nopPacketMiddleware
type PacketSender ¶ added in v0.0.6
type PacketSender interface { SendPacket( ctx sdk.Context, channelCap *capabilitytypes.Capability, packet OutgoingPacket, ) error }
PacketSender defines packet-sender interface
func NewSimplePacketSender ¶ added in v0.0.6
func NewSimplePacketSender(channelKeeper ChannelKeeper) PacketSender
type PortKeeper ¶
type PortKeeper interface {
BindPort(ctx sdk.Context, portID string) *capability.Capability
}
PortKeeper defines the expected IBC port keeper
type QueryCoordinatorStatusRequest ¶
type QueryCoordinatorStatusRequest struct {
TxID TxID `json:"tx_id" yaml:"tx_id"`
}
type QueryCoordinatorStatusResponse ¶
type QueryCoordinatorStatusResponse struct { TxID TxID `json:"tx_id" yaml:"tx_id"` CoordinatorInfo CoordinatorInfo `json:"coordinator_info" yaml:"coordinator_info"` Completed bool `json:"completed" yaml:"completed"` }
type QueryUnacknowledgedPacketsRequest ¶
type QueryUnacknowledgedPacketsRequest struct{}
type QueryUnacknowledgedPacketsResponse ¶
type QueryUnacknowledgedPacketsResponse struct {
Packets []UnacknowledgedPacket `json:"packets" yaml:"packets"`
}
type ReturnValue ¶ added in v0.0.5
type ReturnValue []byte
func NewReturnValue ¶ added in v0.0.5
func NewReturnValue(v []byte) *ReturnValue
func (*ReturnValue) Equal ¶ added in v0.0.5
func (rv *ReturnValue) Equal(bz []byte) bool
func (*ReturnValue) IsNil ¶ added in v0.0.5
func (rv *ReturnValue) IsNil() bool
type SequentialResolver ¶ added in v0.0.5
type SequentialResolver struct {
// contains filtered or unexported fields
}
SequentialResolver is a resolver that resolves an object in sequential
func NewSequentialResolver ¶ added in v0.0.5
func NewSequentialResolver(objects []Object) *SequentialResolver
NewSequentialResolver returns SequentialResolver
type StateConstraint ¶ added in v0.0.3
type StateConstraint struct { Type StateConstraintType `json:"type" yaml:"type"` OPs OPs `json:"ops" yaml:"ops"` }
func NewStateConstraint ¶ added in v0.0.3
func NewStateConstraint(tp StateConstraintType, ops OPs) StateConstraint
type StateConstraintType ¶ added in v0.0.3
type StateConstraintType = uint8
const ( NoStateConstraint StateConstraintType = iota // NoStateConstraint indicates that no constraints on the state before and after the precommit is performed ExactMatchStateConstraint // ExactMatchStateConstraint indicates the constraint on state state before and after the precommit is performed PreStateConstraint // PreStateConstraint indicates the constraint on state before the precommit is performed PostStateConstraint // PostStateConstraint indicates the constraint on state after the precommit is performed )
type Store ¶
type Store interface { // Get returns nil iff key doesn't exist. Panics on nil key. Get(key []byte) []byte // Has checks if a key exists. Panics on nil key. Has(key []byte) bool // Set sets the key. Panics on nil key or value. Set(key, value []byte) // Delete deletes the key. Panics on nil key. Delete(key []byte) }
type TxID ¶
type TxID = HexByteArray32
type TxInfo ¶
type TxInfo struct { Status uint8 `json:"status" yaml:"status"` PrepareResult uint8 `json:"prepare_result" yaml:"prepare_result"` CoordinatorConnectionID string `json:"coordinator_connection_id" yaml:"coordinator_connection_id"` ContractCallInfo []byte `json:"contract_call_info" yaml:"contract_call_info"` }
type UnacknowledgedPacket ¶
type UnacknowledgedPacket struct { Sequence uint64 `json:"sequence" yaml:"sequence"` // number corresponds to the order of sends and receives, where a Packet with an earlier sequence number must be sent and received before a Packet with a later sequence number. SourcePort string `json:"source_port" yaml:"source_port"` // identifies the port on the sending chain. SourceChannel string `json:"source_channel" yaml:"source_channel"` // identifies the channel end on the sending chain. }
func ParseUnacknowledgedPacketKey ¶
func ParseUnacknowledgedPacketKey(key []byte) (*UnacknowledgedPacket, error)