types

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 35 Imported by: 23

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	TypeSignTx    = "SignTx"
	TypeIBCSignTx = "IBCSignTx"
	TypeExtSignTx = "ExtSignTx"
)

msg types

View Source
const (
	KeyTxAuthStatePrefix uint8 = iota
)
View Source
const (
	PacketType = "cross/core/auth"
)
View Source
const SubModuleName = "auth"

Variables

View Source
var (
	ErrInvalidLengthMsgs        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMsgs          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMsgs = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPackets        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPackets          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPackets = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var AuthMode_name = map[int32]string{
	0: "AUTH_MODE_UNSPECIFIED",
	1: "AUTH_MODE_LOCAL",
	2: "AUTH_MODE_CHANNEL",
	3: "AUTH_MODE_EXTENSION",
}
View Source
var AuthMode_value = map[string]int32{
	"AUTH_MODE_UNSPECIFIED": 0,
	"AUTH_MODE_LOCAL":       1,
	"AUTH_MODE_CHANNEL":     2,
	"AUTH_MODE_EXTENSION":   3,
}
View Source
var IBCSignTxStatus_name = map[int32]string{
	0: "IBC_SIGN_TX_STATUS_UNKNOWN",
	1: "IBC_SIGN_TX_STATUS_OK",
	2: "IBC_SIGN_TX_STATUS_FAILED",
}
View Source
var IBCSignTxStatus_value = map[string]int32{
	"IBC_SIGN_TX_STATUS_UNKNOWN": 0,
	"IBC_SIGN_TX_STATUS_OK":      1,
	"IBC_SIGN_TX_STATUS_FAILED":  2,
}
View Source
var (
	// ModuleCdc references the global x/ibc-transfer module codec. Note, the codec
	// should ONLY be used in certain instances of tests and for JSON encoding.
	//
	// The actual codec used for serialization should be provided to x/ibc-transfer and
	// defined at the application level.
	ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
)

Functions

func KeyPrefixBytes

func KeyPrefixBytes(prefix uint8) []byte

KeyPrefixBytes return the key prefix bytes from a URL string format

func KeyTxAuthState

func KeyTxAuthState() []byte

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces register the ibc transfer module interfaces to protobuf Any.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type Account added in v0.2.0

type Account struct {
	Id       AccountID `protobuf:"bytes,1,opt,name=id,proto3,casttype=AccountID" json:"id,omitempty"`
	AuthType AuthType  `protobuf:"bytes,2,opt,name=auth_type,json=authType,proto3" json:"auth_type"`
}

func NewAccount added in v0.2.0

func NewAccount(id AccountID, authType AuthType) Account

NewAccount creates a new instance of Account

func NewAccountFromHexString added in v0.2.0

func NewAccountFromHexString(s string) (*Account, error)

func NewLocalAccount added in v0.2.0

func NewLocalAccount(id AccountID) Account

func (*Account) Descriptor added in v0.2.0

func (*Account) Descriptor() ([]byte, []int)

func (*Account) Equal added in v0.2.0

func (this *Account) Equal(that interface{}) bool

func (Account) HexString added in v0.2.0

func (acc Account) HexString() string

func (*Account) Marshal added in v0.2.0

func (m *Account) Marshal() (dAtA []byte, err error)

func (*Account) MarshalTo added in v0.2.0

func (m *Account) MarshalTo(dAtA []byte) (int, error)

func (*Account) MarshalToSizedBuffer added in v0.2.0

func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Account) ProtoMessage added in v0.2.0

func (*Account) ProtoMessage()

func (*Account) Reset added in v0.2.0

func (m *Account) Reset()

func (*Account) Size added in v0.2.0

func (m *Account) Size() (n int)

func (*Account) String added in v0.2.0

func (m *Account) String() string

func (*Account) Unmarshal added in v0.2.0

func (m *Account) Unmarshal(dAtA []byte) error

func (*Account) UnpackInterfaces added in v0.2.0

func (acc *Account) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

func (*Account) XXX_DiscardUnknown added in v0.2.0

func (m *Account) XXX_DiscardUnknown()

func (*Account) XXX_Marshal added in v0.2.0

func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Account) XXX_Merge added in v0.2.0

func (m *Account) XXX_Merge(src proto.Message)

func (*Account) XXX_Size added in v0.2.0

func (m *Account) XXX_Size() int

func (*Account) XXX_Unmarshal added in v0.2.0

func (m *Account) XXX_Unmarshal(b []byte) error

type AccountID added in v0.2.0

type AccountID []byte

AccountID represents ID of account e.g. AccAddress in cosmos-SDK

func AccountIDFromAccAddress added in v0.2.0

func AccountIDFromAccAddress(acc sdk.AccAddress) AccountID

AccountIDFromAccAddress converts given AccAddress to AccountID

func (AccountID) AccAddress added in v0.2.0

func (id AccountID) AccAddress() sdk.AccAddress

AccAddress returns AccAddress

type AuthExtensionVerifier added in v0.2.0

type AuthExtensionVerifier interface {
	proto.Message
	Verify(ctx sdk.Context, signer Account, signature signing.SignatureV2, tx sdk.Tx) error
}

AuthExtensionVerifier defines an interface that verifies a tx with an auth extension signature

type AuthMode added in v0.2.0

type AuthMode int32
const (
	AuthMode_AUTH_MODE_UNSPECIFIED AuthMode = 0
	AuthMode_AUTH_MODE_LOCAL       AuthMode = 1
	AuthMode_AUTH_MODE_CHANNEL     AuthMode = 2
	AuthMode_AUTH_MODE_EXTENSION   AuthMode = 3
)

func (AuthMode) EnumDescriptor added in v0.2.0

func (AuthMode) EnumDescriptor() ([]byte, []int)

func (AuthMode) String added in v0.2.0

func (x AuthMode) String() string

type AuthType added in v0.2.0

type AuthType struct {
	Mode   AuthMode   `protobuf:"varint,1,opt,name=mode,proto3,enum=cross.core.auth.AuthMode" json:"mode,omitempty"`
	Option *types.Any `protobuf:"bytes,2,opt,name=option,proto3" json:"option,omitempty"`
}

func NewAuthTypeChannel added in v0.2.0

func NewAuthTypeChannel(xcc xcctypes.XCC) AuthType

func NewAuthTypeChannelWithAny added in v0.2.0

func NewAuthTypeChannelWithAny(anyXCC *codectypes.Any) AuthType

func NewAuthTypeExtension added in v0.2.0

func NewAuthTypeExtension(extension AuthExtensionVerifier) AuthType

func NewAuthTypeLocal added in v0.2.0

func NewAuthTypeLocal() AuthType

func (*AuthType) Descriptor added in v0.2.0

func (*AuthType) Descriptor() ([]byte, []int)

func (*AuthType) Equal added in v0.2.0

func (this *AuthType) Equal(that interface{}) bool

func (*AuthType) Marshal added in v0.2.0

func (m *AuthType) Marshal() (dAtA []byte, err error)

func (*AuthType) MarshalTo added in v0.2.0

func (m *AuthType) MarshalTo(dAtA []byte) (int, error)

func (*AuthType) MarshalToSizedBuffer added in v0.2.0

func (m *AuthType) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AuthType) ProtoMessage added in v0.2.0

func (*AuthType) ProtoMessage()

func (*AuthType) Reset added in v0.2.0

func (m *AuthType) Reset()

func (*AuthType) Size added in v0.2.0

func (m *AuthType) Size() (n int)

func (*AuthType) String added in v0.2.0

func (m *AuthType) String() string

func (*AuthType) Unmarshal added in v0.2.0

func (m *AuthType) Unmarshal(dAtA []byte) error

func (*AuthType) XXX_DiscardUnknown added in v0.2.0

func (m *AuthType) XXX_DiscardUnknown()

func (*AuthType) XXX_Marshal added in v0.2.0

func (m *AuthType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AuthType) XXX_Merge added in v0.2.0

func (m *AuthType) XXX_Merge(src proto.Message)

func (*AuthType) XXX_Size added in v0.2.0

func (m *AuthType) XXX_Size() int

func (*AuthType) XXX_Unmarshal added in v0.2.0

func (m *AuthType) XXX_Unmarshal(b []byte) error

type ChannelKeeper

type ChannelKeeper interface {
	GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool)
	GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool)
	SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error
	ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error
}

ChannelKeeper defines the expected IBC channel keeper

type ClientKeeper

type ClientKeeper interface {
	GetClientConsensusState(ctx sdk.Context, clientID string) (connection ibcexported.ConsensusState, found bool)
}

ClientKeeper defines the expected IBC client keeper

type ConnectionKeeper

type ConnectionKeeper interface {
	GetConnection(ctx sdk.Context, connectionID string) (connection connectiontypes.ConnectionEnd, found bool)
}

ConnectionKeeper defines the expected IBC connection keeper

type ErrIDNotFound

type ErrIDNotFound struct {
	// contains filtered or unexported fields
}

ErrIDNotFound is raised when the id not found in store

func NewErrIDNotFound

func NewErrIDNotFound(id []byte) ErrIDNotFound

NewErrIDNotFound creates a new instance of ErrIDNotFound

func (ErrIDNotFound) Error

func (e ErrIDNotFound) Error() string

Error implements error.Error

type ExtAuthMsg added in v0.2.0

type ExtAuthMsg interface {
	GetSignerAccounts() []Account
}

ExtAuthMsg defines an interface that supports an extension signing method

type IBCSignTxStatus

type IBCSignTxStatus int32
const (
	IBC_SIGN_TX_STATUS_UNKNOWN IBCSignTxStatus = 0
	IBC_SIGN_TX_STATUS_OK      IBCSignTxStatus = 1
	IBC_SIGN_TX_STATUS_FAILED  IBCSignTxStatus = 2
)

func (IBCSignTxStatus) EnumDescriptor

func (IBCSignTxStatus) EnumDescriptor() ([]byte, []int)

func (IBCSignTxStatus) String

func (x IBCSignTxStatus) String() string

type MsgClient

type MsgClient interface {
	// SignTx defines a rpc handler method for MsgSignTx.
	SignTx(ctx context.Context, in *MsgSignTx, opts ...grpc.CallOption) (*MsgSignTxResponse, error)
	// IBCSignTx defines a rpc handler method for MsgIBCSignTx.
	IBCSignTx(ctx context.Context, in *MsgIBCSignTx, opts ...grpc.CallOption) (*MsgIBCSignTxResponse, error)
	// ExtSignTx
	ExtSignTx(ctx context.Context, in *MsgExtSignTx, opts ...grpc.CallOption) (*MsgExtSignTxResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgExtSignTx added in v0.2.0

type MsgExtSignTx struct {
	TxID    github_com_datachainlab_cross_x_core_types.TxID `protobuf:"bytes,1,opt,name=txID,proto3,casttype=github.com/datachainlab/cross/x/core/types.TxID" json:"txID,omitempty"`
	Signers []Account                                       `protobuf:"bytes,2,rep,name=signers,proto3" json:"signers"`
}

func (*MsgExtSignTx) Descriptor added in v0.2.0

func (*MsgExtSignTx) Descriptor() ([]byte, []int)

func (MsgExtSignTx) GetSignerAccounts added in v0.2.0

func (msg MsgExtSignTx) GetSignerAccounts() []Account

GetSignerAccounts implements ExtAuthMsg

func (MsgExtSignTx) GetSigners added in v0.2.0

func (msg MsgExtSignTx) GetSigners() []types.AccAddress

Signers returns the addrs of signers that must sign. CONTRACT: All signatures must be present to be valid. CONTRACT: Returns addrs in some deterministic order.

func (*MsgExtSignTx) Marshal added in v0.2.0

func (m *MsgExtSignTx) Marshal() (dAtA []byte, err error)

func (*MsgExtSignTx) MarshalTo added in v0.2.0

func (m *MsgExtSignTx) MarshalTo(dAtA []byte) (int, error)

func (*MsgExtSignTx) MarshalToSizedBuffer added in v0.2.0

func (m *MsgExtSignTx) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgExtSignTx) ProtoMessage added in v0.2.0

func (*MsgExtSignTx) ProtoMessage()

func (*MsgExtSignTx) Reset added in v0.2.0

func (m *MsgExtSignTx) Reset()

func (MsgExtSignTx) Route added in v0.2.0

func (MsgExtSignTx) Route() string

Route implements sdk.Msg

func (*MsgExtSignTx) Size added in v0.2.0

func (m *MsgExtSignTx) Size() (n int)

func (*MsgExtSignTx) String added in v0.2.0

func (m *MsgExtSignTx) String() string

func (MsgExtSignTx) Type added in v0.2.0

func (MsgExtSignTx) Type() string

Type implements sdk.Msg

func (*MsgExtSignTx) Unmarshal added in v0.2.0

func (m *MsgExtSignTx) Unmarshal(dAtA []byte) error

func (*MsgExtSignTx) UnpackInterfaces added in v0.2.0

func (msg *MsgExtSignTx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage

func (MsgExtSignTx) ValidateBasic added in v0.2.0

func (msg MsgExtSignTx) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

func (*MsgExtSignTx) XXX_DiscardUnknown added in v0.2.0

func (m *MsgExtSignTx) XXX_DiscardUnknown()

func (*MsgExtSignTx) XXX_Marshal added in v0.2.0

func (m *MsgExtSignTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgExtSignTx) XXX_Merge added in v0.2.0

func (m *MsgExtSignTx) XXX_Merge(src proto.Message)

func (*MsgExtSignTx) XXX_Size added in v0.2.0

func (m *MsgExtSignTx) XXX_Size() int

func (*MsgExtSignTx) XXX_Unmarshal added in v0.2.0

func (m *MsgExtSignTx) XXX_Unmarshal(b []byte) error

type MsgExtSignTxResponse added in v0.2.0

type MsgExtSignTxResponse struct {
}

func (*MsgExtSignTxResponse) Descriptor added in v0.2.0

func (*MsgExtSignTxResponse) Descriptor() ([]byte, []int)

func (*MsgExtSignTxResponse) Marshal added in v0.2.0

func (m *MsgExtSignTxResponse) Marshal() (dAtA []byte, err error)

func (*MsgExtSignTxResponse) MarshalTo added in v0.2.0

func (m *MsgExtSignTxResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgExtSignTxResponse) MarshalToSizedBuffer added in v0.2.0

func (m *MsgExtSignTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgExtSignTxResponse) ProtoMessage added in v0.2.0

func (*MsgExtSignTxResponse) ProtoMessage()

func (*MsgExtSignTxResponse) Reset added in v0.2.0

func (m *MsgExtSignTxResponse) Reset()

func (*MsgExtSignTxResponse) Size added in v0.2.0

func (m *MsgExtSignTxResponse) Size() (n int)

func (*MsgExtSignTxResponse) String added in v0.2.0

func (m *MsgExtSignTxResponse) String() string

func (*MsgExtSignTxResponse) Unmarshal added in v0.2.0

func (m *MsgExtSignTxResponse) Unmarshal(dAtA []byte) error

func (*MsgExtSignTxResponse) XXX_DiscardUnknown added in v0.2.0

func (m *MsgExtSignTxResponse) XXX_DiscardUnknown()

func (*MsgExtSignTxResponse) XXX_Marshal added in v0.2.0

func (m *MsgExtSignTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgExtSignTxResponse) XXX_Merge added in v0.2.0

func (m *MsgExtSignTxResponse) XXX_Merge(src proto.Message)

func (*MsgExtSignTxResponse) XXX_Size added in v0.2.0

func (m *MsgExtSignTxResponse) XXX_Size() int

func (*MsgExtSignTxResponse) XXX_Unmarshal added in v0.2.0

func (m *MsgExtSignTxResponse) XXX_Unmarshal(b []byte) error

type MsgIBCSignTx

type MsgIBCSignTx struct {
	CrossChainChannel *types1.Any                                     `protobuf:"bytes,1,opt,name=cross_chain_channel,json=crossChainChannel,proto3" json:"cross_chain_channel,omitempty"`
	TxID              github_com_datachainlab_cross_x_core_types.TxID `protobuf:"bytes,2,opt,name=txID,proto3,casttype=github.com/datachainlab/cross/x/core/types.TxID" json:"txID,omitempty"`
	Signers           []AccountID                                     `protobuf:"bytes,3,rep,name=signers,proto3,casttype=AccountID" json:"signers,omitempty"`
	// Timeout height relative to the current block height.
	// The timeout is disabled when set to 0.
	TimeoutHeight types.Height `protobuf:"bytes,4,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"`
	// Timeout timestamp (in nanoseconds) relative to the current block timestamp.
	// The timeout is disabled when set to 0.
	TimeoutTimestamp uint64 `` /* 135-byte string literal not displayed */
}

func NewMsgIBCSignTx

func NewMsgIBCSignTx(
	anyXCC *codectypes.Any, txID crosstypes.TxID, signers []AccountID,
	timeoutHeight clienttypes.Height, timeoutTimestamp uint64,
) *MsgIBCSignTx

NewMsgIBCSignTx creates a new instance of MsgIBCSignTx

func (*MsgIBCSignTx) Descriptor

func (*MsgIBCSignTx) Descriptor() ([]byte, []int)

func (MsgIBCSignTx) GetSignBytes

func (msg MsgIBCSignTx) GetSignBytes() []byte

GetSignBytes implements sdk.Msg. The function will panic since it is used for amino transaction verification which IBC does not support.

func (MsgIBCSignTx) GetSigners

func (msg MsgIBCSignTx) 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 (*MsgIBCSignTx) Marshal

func (m *MsgIBCSignTx) Marshal() (dAtA []byte, err error)

func (*MsgIBCSignTx) MarshalTo

func (m *MsgIBCSignTx) MarshalTo(dAtA []byte) (int, error)

func (*MsgIBCSignTx) MarshalToSizedBuffer

func (m *MsgIBCSignTx) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgIBCSignTx) ProtoMessage

func (*MsgIBCSignTx) ProtoMessage()

func (*MsgIBCSignTx) Reset

func (m *MsgIBCSignTx) Reset()

func (MsgIBCSignTx) Route

func (MsgIBCSignTx) Route() string

Route implements sdk.Msg

func (*MsgIBCSignTx) Size

func (m *MsgIBCSignTx) Size() (n int)

func (*MsgIBCSignTx) String

func (m *MsgIBCSignTx) String() string

func (MsgIBCSignTx) Type

func (MsgIBCSignTx) Type() string

Type implements sdk.Msg

func (*MsgIBCSignTx) Unmarshal

func (m *MsgIBCSignTx) Unmarshal(dAtA []byte) error

func (*MsgIBCSignTx) UnpackInterfaces added in v0.2.0

func (msg *MsgIBCSignTx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage

func (MsgIBCSignTx) ValidateBasic

func (msg MsgIBCSignTx) ValidateBasic() error

ValidateBasic performs a basic check of the MsgInitiateTx fields. NOTE: timeout height or timestamp values can be 0 to disable the timeout.

func (*MsgIBCSignTx) XXX_DiscardUnknown

func (m *MsgIBCSignTx) XXX_DiscardUnknown()

func (*MsgIBCSignTx) XXX_Marshal

func (m *MsgIBCSignTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgIBCSignTx) XXX_Merge

func (m *MsgIBCSignTx) XXX_Merge(src proto.Message)

func (*MsgIBCSignTx) XXX_Size

func (m *MsgIBCSignTx) XXX_Size() int

func (*MsgIBCSignTx) XXX_Unmarshal

func (m *MsgIBCSignTx) XXX_Unmarshal(b []byte) error

type MsgIBCSignTxResponse

type MsgIBCSignTxResponse struct {
}

MsgIBCSignTxResponse defines the Msg/IBCSignTx response type.

func (*MsgIBCSignTxResponse) Descriptor

func (*MsgIBCSignTxResponse) Descriptor() ([]byte, []int)

func (*MsgIBCSignTxResponse) Marshal

func (m *MsgIBCSignTxResponse) Marshal() (dAtA []byte, err error)

func (*MsgIBCSignTxResponse) MarshalTo

func (m *MsgIBCSignTxResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgIBCSignTxResponse) MarshalToSizedBuffer

func (m *MsgIBCSignTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgIBCSignTxResponse) ProtoMessage

func (*MsgIBCSignTxResponse) ProtoMessage()

func (*MsgIBCSignTxResponse) Reset

func (m *MsgIBCSignTxResponse) Reset()

func (*MsgIBCSignTxResponse) Size

func (m *MsgIBCSignTxResponse) Size() (n int)

func (*MsgIBCSignTxResponse) String

func (m *MsgIBCSignTxResponse) String() string

func (*MsgIBCSignTxResponse) Unmarshal

func (m *MsgIBCSignTxResponse) Unmarshal(dAtA []byte) error

func (*MsgIBCSignTxResponse) XXX_DiscardUnknown

func (m *MsgIBCSignTxResponse) XXX_DiscardUnknown()

func (*MsgIBCSignTxResponse) XXX_Marshal

func (m *MsgIBCSignTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgIBCSignTxResponse) XXX_Merge

func (m *MsgIBCSignTxResponse) XXX_Merge(src proto.Message)

func (*MsgIBCSignTxResponse) XXX_Size

func (m *MsgIBCSignTxResponse) XXX_Size() int

func (*MsgIBCSignTxResponse) XXX_Unmarshal

func (m *MsgIBCSignTxResponse) XXX_Unmarshal(b []byte) error

type MsgServer

type MsgServer interface {
	// SignTx defines a rpc handler method for MsgSignTx.
	SignTx(context.Context, *MsgSignTx) (*MsgSignTxResponse, error)
	// IBCSignTx defines a rpc handler method for MsgIBCSignTx.
	IBCSignTx(context.Context, *MsgIBCSignTx) (*MsgIBCSignTxResponse, error)
	// ExtSignTx
	ExtSignTx(context.Context, *MsgExtSignTx) (*MsgExtSignTxResponse, error)
}

MsgServer is the server API for Msg service.

type MsgSignTx

type MsgSignTx struct {
	TxID    github_com_datachainlab_cross_x_core_types.TxID `protobuf:"bytes,1,opt,name=txID,proto3,casttype=github.com/datachainlab/cross/x/core/types.TxID" json:"txID,omitempty"`
	Signers []AccountID                                     `protobuf:"bytes,2,rep,name=signers,proto3,casttype=AccountID" json:"signers,omitempty"`
	// Timeout height relative to the current block height.
	// The timeout is disabled when set to 0.
	TimeoutHeight types.Height `protobuf:"bytes,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"`
	// Timeout timestamp (in nanoseconds) relative to the current block timestamp.
	// The timeout is disabled when set to 0.
	TimeoutTimestamp uint64 `` /* 135-byte string literal not displayed */
}

func (*MsgSignTx) Descriptor

func (*MsgSignTx) Descriptor() ([]byte, []int)

func (MsgSignTx) GetSignBytes

func (msg MsgSignTx) GetSignBytes() []byte

GetSignBytes implements sdk.Msg. The function will panic since it is used for amino transaction verification which IBC does not support.

func (MsgSignTx) GetSigners

func (msg MsgSignTx) 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 (*MsgSignTx) Marshal

func (m *MsgSignTx) Marshal() (dAtA []byte, err error)

func (*MsgSignTx) MarshalTo

func (m *MsgSignTx) MarshalTo(dAtA []byte) (int, error)

func (*MsgSignTx) MarshalToSizedBuffer

func (m *MsgSignTx) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSignTx) ProtoMessage

func (*MsgSignTx) ProtoMessage()

func (*MsgSignTx) Reset

func (m *MsgSignTx) Reset()

func (MsgSignTx) Route

func (MsgSignTx) Route() string

Route implements sdk.Msg

func (*MsgSignTx) Size

func (m *MsgSignTx) Size() (n int)

func (*MsgSignTx) String

func (m *MsgSignTx) String() string

func (MsgSignTx) Type

func (MsgSignTx) Type() string

Type implements sdk.Msg

func (*MsgSignTx) Unmarshal

func (m *MsgSignTx) Unmarshal(dAtA []byte) error

func (MsgSignTx) ValidateBasic

func (msg MsgSignTx) ValidateBasic() error

ValidateBasic performs a basic check of the MsgInitiateTx fields. NOTE: timeout height or timestamp values can be 0 to disable the timeout.

func (*MsgSignTx) XXX_DiscardUnknown

func (m *MsgSignTx) XXX_DiscardUnknown()

func (*MsgSignTx) XXX_Marshal

func (m *MsgSignTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSignTx) XXX_Merge

func (m *MsgSignTx) XXX_Merge(src proto.Message)

func (*MsgSignTx) XXX_Size

func (m *MsgSignTx) XXX_Size() int

func (*MsgSignTx) XXX_Unmarshal

func (m *MsgSignTx) XXX_Unmarshal(b []byte) error

type MsgSignTxResponse

type MsgSignTxResponse struct {
	TxAuthCompleted bool   `protobuf:"varint,1,opt,name=tx_auth_completed,json=txAuthCompleted,proto3" json:"tx_auth_completed,omitempty"`
	Log             string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"`
}

MsgSignTxResponse defines the Msg/SignTx response type.

func (*MsgSignTxResponse) Descriptor

func (*MsgSignTxResponse) Descriptor() ([]byte, []int)

func (*MsgSignTxResponse) Marshal

func (m *MsgSignTxResponse) Marshal() (dAtA []byte, err error)

func (*MsgSignTxResponse) MarshalTo

func (m *MsgSignTxResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgSignTxResponse) MarshalToSizedBuffer

func (m *MsgSignTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSignTxResponse) ProtoMessage

func (*MsgSignTxResponse) ProtoMessage()

func (*MsgSignTxResponse) Reset

func (m *MsgSignTxResponse) Reset()

func (*MsgSignTxResponse) Size

func (m *MsgSignTxResponse) Size() (n int)

func (*MsgSignTxResponse) String

func (m *MsgSignTxResponse) String() string

func (*MsgSignTxResponse) Unmarshal

func (m *MsgSignTxResponse) Unmarshal(dAtA []byte) error

func (*MsgSignTxResponse) XXX_DiscardUnknown

func (m *MsgSignTxResponse) XXX_DiscardUnknown()

func (*MsgSignTxResponse) XXX_Marshal

func (m *MsgSignTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSignTxResponse) XXX_Merge

func (m *MsgSignTxResponse) XXX_Merge(src proto.Message)

func (*MsgSignTxResponse) XXX_Size

func (m *MsgSignTxResponse) XXX_Size() int

func (*MsgSignTxResponse) XXX_Unmarshal

func (m *MsgSignTxResponse) XXX_Unmarshal(b []byte) error

type PacketAcknowledgementIBCSignTx

type PacketAcknowledgementIBCSignTx struct {
	Status IBCSignTxStatus `protobuf:"varint,1,opt,name=status,proto3,enum=cross.core.auth.IBCSignTxStatus" json:"status,omitempty"`
}

func (*PacketAcknowledgementIBCSignTx) Descriptor

func (*PacketAcknowledgementIBCSignTx) Descriptor() ([]byte, []int)

func (*PacketAcknowledgementIBCSignTx) Marshal

func (m *PacketAcknowledgementIBCSignTx) Marshal() (dAtA []byte, err error)

func (*PacketAcknowledgementIBCSignTx) MarshalTo

func (m *PacketAcknowledgementIBCSignTx) MarshalTo(dAtA []byte) (int, error)

func (*PacketAcknowledgementIBCSignTx) MarshalToSizedBuffer

func (m *PacketAcknowledgementIBCSignTx) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PacketAcknowledgementIBCSignTx) ProtoMessage

func (*PacketAcknowledgementIBCSignTx) ProtoMessage()

func (*PacketAcknowledgementIBCSignTx) Reset

func (m *PacketAcknowledgementIBCSignTx) Reset()

func (*PacketAcknowledgementIBCSignTx) Size

func (m *PacketAcknowledgementIBCSignTx) Size() (n int)

func (*PacketAcknowledgementIBCSignTx) String

func (PacketAcknowledgementIBCSignTx) Type

func (*PacketAcknowledgementIBCSignTx) Unmarshal

func (m *PacketAcknowledgementIBCSignTx) Unmarshal(dAtA []byte) error

func (PacketAcknowledgementIBCSignTx) ValidateBasic

func (p PacketAcknowledgementIBCSignTx) ValidateBasic() error

func (*PacketAcknowledgementIBCSignTx) XXX_DiscardUnknown

func (m *PacketAcknowledgementIBCSignTx) XXX_DiscardUnknown()

func (*PacketAcknowledgementIBCSignTx) XXX_Marshal

func (m *PacketAcknowledgementIBCSignTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PacketAcknowledgementIBCSignTx) XXX_Merge

func (m *PacketAcknowledgementIBCSignTx) XXX_Merge(src proto.Message)

func (*PacketAcknowledgementIBCSignTx) XXX_Size

func (m *PacketAcknowledgementIBCSignTx) XXX_Size() int

func (*PacketAcknowledgementIBCSignTx) XXX_Unmarshal

func (m *PacketAcknowledgementIBCSignTx) XXX_Unmarshal(b []byte) error

type PacketDataIBCSignTx

type PacketDataIBCSignTx struct {
	TxID    github_com_datachainlab_cross_x_core_types.TxID `protobuf:"bytes,1,opt,name=txID,proto3,casttype=github.com/datachainlab/cross/x/core/types.TxID" json:"txID,omitempty"`
	Signers []AccountID                                     `protobuf:"bytes,2,rep,name=signers,proto3,casttype=AccountID" json:"signers,omitempty"`
	// Timeout height relative to the current block height.
	// The timeout is disabled when set to 0.
	TimeoutHeight types.Height `protobuf:"bytes,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"`
	// Timeout timestamp (in nanoseconds) relative to the current block timestamp.
	// The timeout is disabled when set to 0.
	TimeoutTimestamp uint64 `` /* 135-byte string literal not displayed */
}

func NewPacketDataIBCSignTx

func NewPacketDataIBCSignTx(
	txID crosstypes.TxID,
	signers []AccountID,
	timeoutHeight clienttypes.Height,
	timeoutTimestamp uint64,
) PacketDataIBCSignTx

NewPacketDataIBCSignTx creates a new instance of PacketDataIBCSignTx

func (*PacketDataIBCSignTx) Descriptor

func (*PacketDataIBCSignTx) Descriptor() ([]byte, []int)

func (*PacketDataIBCSignTx) Marshal

func (m *PacketDataIBCSignTx) Marshal() (dAtA []byte, err error)

func (*PacketDataIBCSignTx) MarshalTo

func (m *PacketDataIBCSignTx) MarshalTo(dAtA []byte) (int, error)

func (*PacketDataIBCSignTx) MarshalToSizedBuffer

func (m *PacketDataIBCSignTx) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PacketDataIBCSignTx) ProtoMessage

func (*PacketDataIBCSignTx) ProtoMessage()

func (*PacketDataIBCSignTx) Reset

func (m *PacketDataIBCSignTx) Reset()

func (*PacketDataIBCSignTx) Size

func (m *PacketDataIBCSignTx) Size() (n int)

func (*PacketDataIBCSignTx) String

func (m *PacketDataIBCSignTx) String() string

func (PacketDataIBCSignTx) Type

func (PacketDataIBCSignTx) Type() string

func (*PacketDataIBCSignTx) Unmarshal

func (m *PacketDataIBCSignTx) Unmarshal(dAtA []byte) error

func (PacketDataIBCSignTx) ValidateBasic

func (p PacketDataIBCSignTx) ValidateBasic() error

func (*PacketDataIBCSignTx) XXX_DiscardUnknown

func (m *PacketDataIBCSignTx) XXX_DiscardUnknown()

func (*PacketDataIBCSignTx) XXX_Marshal

func (m *PacketDataIBCSignTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PacketDataIBCSignTx) XXX_Merge

func (m *PacketDataIBCSignTx) XXX_Merge(src proto.Message)

func (*PacketDataIBCSignTx) XXX_Size

func (m *PacketDataIBCSignTx) XXX_Size() int

func (*PacketDataIBCSignTx) XXX_Unmarshal

func (m *PacketDataIBCSignTx) XXX_Unmarshal(b []byte) error

type PortKeeper

type PortKeeper interface {
	BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability
}

PortKeeper defines the expected IBC port keeper

type QueryClient

type QueryClient interface {
	TxAuthState(ctx context.Context, in *QueryTxAuthStateRequest, opts ...grpc.CallOption) (*QueryTxAuthStateResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryServer

type QueryServer interface {
	TxAuthState(context.Context, *QueryTxAuthStateRequest) (*QueryTxAuthStateResponse, error)
}

QueryServer is the server API for Query service.

type QueryTxAuthStateRequest

type QueryTxAuthStateRequest struct {
	TxID github_com_datachainlab_cross_x_core_types.TxID `protobuf:"bytes,1,opt,name=txID,proto3,casttype=github.com/datachainlab/cross/x/core/types.TxID" json:"txID,omitempty"`
}

func (*QueryTxAuthStateRequest) Descriptor

func (*QueryTxAuthStateRequest) Descriptor() ([]byte, []int)

func (*QueryTxAuthStateRequest) Marshal

func (m *QueryTxAuthStateRequest) Marshal() (dAtA []byte, err error)

func (*QueryTxAuthStateRequest) MarshalTo

func (m *QueryTxAuthStateRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryTxAuthStateRequest) MarshalToSizedBuffer

func (m *QueryTxAuthStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryTxAuthStateRequest) ProtoMessage

func (*QueryTxAuthStateRequest) ProtoMessage()

func (*QueryTxAuthStateRequest) Reset

func (m *QueryTxAuthStateRequest) Reset()

func (*QueryTxAuthStateRequest) Size

func (m *QueryTxAuthStateRequest) Size() (n int)

func (*QueryTxAuthStateRequest) String

func (m *QueryTxAuthStateRequest) String() string

func (*QueryTxAuthStateRequest) Unmarshal

func (m *QueryTxAuthStateRequest) Unmarshal(dAtA []byte) error

func (*QueryTxAuthStateRequest) XXX_DiscardUnknown

func (m *QueryTxAuthStateRequest) XXX_DiscardUnknown()

func (*QueryTxAuthStateRequest) XXX_Marshal

func (m *QueryTxAuthStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryTxAuthStateRequest) XXX_Merge

func (m *QueryTxAuthStateRequest) XXX_Merge(src proto.Message)

func (*QueryTxAuthStateRequest) XXX_Size

func (m *QueryTxAuthStateRequest) XXX_Size() int

func (*QueryTxAuthStateRequest) XXX_Unmarshal

func (m *QueryTxAuthStateRequest) XXX_Unmarshal(b []byte) error

type QueryTxAuthStateResponse

type QueryTxAuthStateResponse struct {
	TxAuthState *TxAuthState `protobuf:"bytes,1,opt,name=tx_auth_state,json=txAuthState,proto3" json:"tx_auth_state,omitempty"`
}

func (*QueryTxAuthStateResponse) Descriptor

func (*QueryTxAuthStateResponse) Descriptor() ([]byte, []int)

func (*QueryTxAuthStateResponse) Marshal

func (m *QueryTxAuthStateResponse) Marshal() (dAtA []byte, err error)

func (*QueryTxAuthStateResponse) MarshalTo

func (m *QueryTxAuthStateResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryTxAuthStateResponse) MarshalToSizedBuffer

func (m *QueryTxAuthStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryTxAuthStateResponse) ProtoMessage

func (*QueryTxAuthStateResponse) ProtoMessage()

func (*QueryTxAuthStateResponse) Reset

func (m *QueryTxAuthStateResponse) Reset()

func (*QueryTxAuthStateResponse) Size

func (m *QueryTxAuthStateResponse) Size() (n int)

func (*QueryTxAuthStateResponse) String

func (m *QueryTxAuthStateResponse) String() string

func (*QueryTxAuthStateResponse) Unmarshal

func (m *QueryTxAuthStateResponse) Unmarshal(dAtA []byte) error

func (*QueryTxAuthStateResponse) XXX_DiscardUnknown

func (m *QueryTxAuthStateResponse) XXX_DiscardUnknown()

func (*QueryTxAuthStateResponse) XXX_Marshal

func (m *QueryTxAuthStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryTxAuthStateResponse) XXX_Merge

func (m *QueryTxAuthStateResponse) XXX_Merge(src proto.Message)

func (*QueryTxAuthStateResponse) XXX_Size

func (m *QueryTxAuthStateResponse) XXX_Size() int

func (*QueryTxAuthStateResponse) XXX_Unmarshal

func (m *QueryTxAuthStateResponse) XXX_Unmarshal(b []byte) error

type TxAuthState

type TxAuthState struct {
	RemainingSigners []Account `protobuf:"bytes,1,rep,name=remaining_signers,json=remainingSigners,proto3" json:"remaining_signers"`
}

func (*TxAuthState) ConsumeSigners

func (s *TxAuthState) ConsumeSigners(signers []Account) (isConsumed bool)

ConsumeSigners removes the signers from required signers

func (*TxAuthState) Descriptor

func (*TxAuthState) Descriptor() ([]byte, []int)

func (TxAuthState) IsCompleted

func (s TxAuthState) IsCompleted() bool

IsCompleted returns a boolean whether the required authentication is completed

func (*TxAuthState) Marshal

func (m *TxAuthState) Marshal() (dAtA []byte, err error)

func (*TxAuthState) MarshalTo

func (m *TxAuthState) MarshalTo(dAtA []byte) (int, error)

func (*TxAuthState) MarshalToSizedBuffer

func (m *TxAuthState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxAuthState) ProtoMessage

func (*TxAuthState) ProtoMessage()

func (*TxAuthState) Reset

func (m *TxAuthState) Reset()

func (*TxAuthState) Size

func (m *TxAuthState) Size() (n int)

func (*TxAuthState) String

func (m *TxAuthState) String() string

func (*TxAuthState) Unmarshal

func (m *TxAuthState) Unmarshal(dAtA []byte) error

func (*TxAuthState) XXX_DiscardUnknown

func (m *TxAuthState) XXX_DiscardUnknown()

func (*TxAuthState) XXX_Marshal

func (m *TxAuthState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxAuthState) XXX_Merge

func (m *TxAuthState) XXX_Merge(src proto.Message)

func (*TxAuthState) XXX_Size

func (m *TxAuthState) XXX_Size() int

func (*TxAuthState) XXX_Unmarshal

func (m *TxAuthState) XXX_Unmarshal(b []byte) error

type TxAuthenticator

type TxAuthenticator interface {
	// InitAuthState initializes the state of the tx corresponding to a given txID
	InitAuthState(ctx sdk.Context, txID crosstypes.TxID, signers []Account) error
	// IsCompletedAuth returns a boolean whether the tx corresponding a given txID is completed
	IsCompletedAuth(ctx sdk.Context, txID crosstypes.TxID) (bool, error)
	// Sign executes
	Sign(ctx sdk.Context, txID crosstypes.TxID, signers []Account) (bool, error)
}

TxAuthenticator defines the expected interface of cross-chain authenticator

type TxManager

type TxManager interface {
	// IsActive returns a boolean whether the tx corresponding to a given txID is still active
	IsActive(ctx sdk.Context, txID crosstypes.TxID) (bool, error)
	// OnPostAuth represents a callback function is called at post authentication
	OnPostAuth(ctx sdk.Context, txID crosstypes.TxID) error
}

TxManager defines the expected interface of transaction manager

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) ExtSignTx added in v0.2.0

func (*UnimplementedMsgServer) IBCSignTx

func (*UnimplementedMsgServer) SignTx

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) TxAuthState

Jump to

Keyboard shortcuts

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