Merge branch 'master' into cyrus/docs-0.40.x

This commit is contained in:
Cyrus Goh 2020-11-10 10:15:09 -08:00 committed by GitHub
commit 131a942ef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
66 changed files with 1569 additions and 1836 deletions

View File

@ -15760,7 +15760,7 @@ paths:
}
tags:
- Query
/ibc/channel/v1beta1/channels:
/ibc/core/channel/v1beta1/channels:
get:
summary: Channels queries all the IBC channels of a chain.
operationId: Channels
@ -16146,7 +16146,7 @@ paths:
type: boolean
tags:
- Query
'/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}':
'/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}':
get:
summary: Channel queries an IBC Channel.
operationId: Channel
@ -16471,7 +16471,7 @@ paths:
type: string
tags:
- Query
'/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state':
'/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state':
get:
summary: >-
ChannelClientState queries for the client state for the channel
@ -16909,7 +16909,7 @@ paths:
type: string
tags:
- Query
'/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/version/{version_number}/height/{version_height}':
'/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/version/{version_number}/height/{version_height}':
get:
summary: |-
ChannelConsensusState queries for the consensus state for the channel
@ -17344,7 +17344,7 @@ paths:
format: uint64
tags:
- Query
'/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence':
'/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence':
get:
summary: >-
NextSequenceReceive returns the next receive sequence for a given
@ -17596,7 +17596,7 @@ paths:
type: string
tags:
- Query
'/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements':
'/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements':
get:
summary: >-
PacketAcknowledgements returns all the packet acknowledgements
@ -17945,7 +17945,7 @@ paths:
type: boolean
tags:
- Query
'/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}':
'/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}':
get:
summary: PacketAcknowledgement queries a stored packet acknowledgement hash.
operationId: PacketAcknowledgement
@ -18205,7 +18205,7 @@ paths:
format: uint64
tags:
- Query
'/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments':
'/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments':
get:
summary: |-
PacketCommitments returns all the packet commitments hashes associated
@ -18552,7 +18552,7 @@ paths:
type: boolean
tags:
- Query
'/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks':
'/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks':
get:
summary: >-
UnreceivedAcks returns all the unreceived IBC acknowledgements
@ -18814,7 +18814,7 @@ paths:
minItems: 1
tags:
- Query
'/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets':
'/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets':
get:
summary: >-
UnreceivedPackets returns all the unreceived IBC packets associated with
@ -19076,7 +19076,7 @@ paths:
minItems: 1
tags:
- Query
'/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}':
'/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}':
get:
summary: PacketCommitment queries a stored packet commitment hash.
operationId: PacketCommitment
@ -19337,7 +19337,7 @@ paths:
format: uint64
tags:
- Query
'/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}':
'/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}':
get:
summary: >-
PacketReceipt queries if a given packet sequence has been received on
@ -19599,7 +19599,7 @@ paths:
format: uint64
tags:
- Query
'/ibc/channel/v1beta1/connections/{connection}/channels':
'/ibc/core/channel/v1beta1/connections/{connection}/channels':
get:
summary: |-
ConnectionChannels queries all the channels associated with a connection
@ -19992,7 +19992,7 @@ paths:
type: boolean
tags:
- Query
/ibc/client/v1beta1/client_states:
/ibc/core/client/v1beta1/client_states:
get:
summary: ClientStates queries all the IBC light clients of a chain.
operationId: ClientStates
@ -20465,7 +20465,7 @@ paths:
type: boolean
tags:
- Query
'/ibc/client/v1beta1/client_states/{client_id}':
'/ibc/core/client/v1beta1/client_states/{client_id}':
get:
summary: ClientState queries an IBC light client.
operationId: ClientState
@ -20883,7 +20883,7 @@ paths:
type: string
tags:
- Query
'/ibc/client/v1beta1/consensus_states/{client_id}':
'/ibc/core/client/v1beta1/consensus_states/{client_id}':
get:
summary: |-
ConsensusStates queries all the consensus state associated with a given
@ -21383,7 +21383,7 @@ paths:
type: boolean
tags:
- Query
'/ibc/client/v1beta1/consensus_states/{client_id}/version/{version_number}/height/{version_height}':
'/ibc/core/client/v1beta1/consensus_states/{client_id}/version/{version_number}/height/{version_height}':
get:
summary: >-
ConsensusState queries a consensus state associated with a client state
@ -21825,7 +21825,7 @@ paths:
type: boolean
tags:
- Query
'/ibc/connection/v1beta1/client_connections/{client_id}':
'/ibc/core/connection/v1beta1/client_connections/{client_id}':
get:
summary: |-
ClientConnections queries the connection paths associated with a client
@ -22073,7 +22073,7 @@ paths:
type: string
tags:
- Query
/ibc/connection/v1beta1/connections:
/ibc/core/connection/v1beta1/connections:
get:
summary: Connections queries all the IBC connections of a chain.
operationId: Connections
@ -22457,7 +22457,7 @@ paths:
type: boolean
tags:
- Query
'/ibc/connection/v1beta1/connections/{connection_id}':
'/ibc/core/connection/v1beta1/connections/{connection_id}':
get:
summary: Connection queries an IBC connection end.
operationId: Connection
@ -22777,7 +22777,7 @@ paths:
type: string
tags:
- Query
'/ibc/connection/v1beta1/connections/{connection_id}/client_state':
'/ibc/core/connection/v1beta1/connections/{connection_id}/client_state':
get:
summary: |-
ConnectionClientState queries the client state associated with the
@ -23208,7 +23208,7 @@ paths:
type: string
tags:
- Query
'/ibc/connection/v1beta1/connections/{connection_id}/consensus_state/version/{version_number}/height/{version_height}':
'/ibc/core/connection/v1beta1/connections/{connection_id}/consensus_state/version/{version_number}/height/{version_height}':
get:
summary: |-
ConnectionConsensusState queries the consensus state associated with the
@ -23636,7 +23636,7 @@ paths:
format: uint64
tags:
- Query
/ibc_transfer/v1beta1/denom_traces:
/ibc/applications/transfer/v1beta1/denom_traces:
get:
summary: DenomTraces queries all denomination traces.
operationId: DenomTraces
@ -23761,7 +23761,7 @@ paths:
type: boolean
tags:
- Query
'/ibc_transfer/v1beta1/denom_traces/{hash}':
'/ibc/applications/transfer/v1beta1/denom_traces/{hash}':
get:
summary: DenomTrace queries a denomination trace information.
operationId: DenomTrace
@ -23822,7 +23822,7 @@ paths:
type: string
tags:
- Query
/ibc_transfer/v1beta1/params:
/ibc/applications/transfer/v1beta1/params:
get:
summary: Params queries all parameters of the ibc-transfer module.
operationId: IBCTransferParams

View File

@ -12,17 +12,17 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/ty
service Query {
// DenomTrace queries a denomination trace information.
rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) {
option (google.api.http).get = "/ibc_transfer/v1beta1/denom_traces/{hash}";
option (google.api.http).get = "/ibc/applications/transfer/v1beta1/denom_traces/{hash}";
}
// DenomTraces queries all denomination traces.
rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) {
option (google.api.http).get = "/ibc_transfer/v1beta1/denom_traces";
option (google.api.http).get = "/ibc/applications/transfer/v1beta1/denom_traces";
}
// Params queries all parameters of the ibc-transfer module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/ibc_transfer/v1beta1/params";
option (google.api.http).get = "/ibc/applications/transfer/v1beta1/params";
}
}

View File

@ -14,79 +14,79 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types";
service Query {
// Channel queries an IBC Channel.
rpc Channel(QueryChannelRequest) returns (QueryChannelResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}";
option (google.api.http).get = "/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}";
}
// Channels queries all the IBC channels of a chain.
rpc Channels(QueryChannelsRequest) returns (QueryChannelsResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels";
option (google.api.http).get = "/ibc/core/channel/v1beta1/channels";
}
// ConnectionChannels queries all the channels associated with a connection
// end.
rpc ConnectionChannels(QueryConnectionChannelsRequest) returns (QueryConnectionChannelsResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/connections/{connection}/channels";
option (google.api.http).get = "/ibc/core/channel/v1beta1/connections/{connection}/channels";
}
// ChannelClientState queries for the client state for the channel associated
// with the provided channel identifiers.
rpc ChannelClientState(QueryChannelClientStateRequest) returns (QueryChannelClientStateResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state";
option (google.api.http).get = "/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state";
}
// ChannelConsensusState queries for the consensus state for the channel
// associated with the provided channel identifiers.
rpc ChannelConsensusState(QueryChannelConsensusStateRequest) returns (QueryChannelConsensusStateResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/version/"
option (google.api.http).get = "/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/version/"
"{version_number}/height/{version_height}";
}
// PacketCommitment queries a stored packet commitment hash.
rpc PacketCommitment(QueryPacketCommitmentRequest) returns (QueryPacketCommitmentResponse) {
option (google.api.http).get =
"/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}";
"/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}";
}
// PacketCommitments returns all the packet commitments hashes associated
// with a channel.
rpc PacketCommitments(QueryPacketCommitmentsRequest) returns (QueryPacketCommitmentsResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments";
option (google.api.http).get = "/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments";
}
// PacketReceipt queries if a given packet sequence has been received on the queried chain
rpc PacketReceipt(QueryPacketReceiptRequest) returns (QueryPacketReceiptResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}";
option (google.api.http).get = "/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}";
}
// PacketAcknowledgement queries a stored packet acknowledgement hash.
rpc PacketAcknowledgement(QueryPacketAcknowledgementRequest) returns (QueryPacketAcknowledgementResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}";
option (google.api.http).get = "/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}";
}
// PacketAcknowledgements returns all the packet acknowledgements associated
// with a channel.
rpc PacketAcknowledgements(QueryPacketAcknowledgementsRequest) returns (QueryPacketAcknowledgementsResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements";
option (google.api.http).get = "/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements";
}
// UnreceivedPackets returns all the unreceived IBC packets associated with a
// channel and sequences.
rpc UnreceivedPackets(QueryUnreceivedPacketsRequest) returns (QueryUnreceivedPacketsResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/"
option (google.api.http).get = "/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/"
"{packet_commitment_sequences}/unreceived_packets";
}
// UnreceivedAcks returns all the unreceived IBC acknowledgements associated with a
// channel and sequences.
rpc UnreceivedAcks(QueryUnreceivedAcksRequest) returns (QueryUnreceivedAcksResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/"
option (google.api.http).get = "/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/"
"{packet_ack_sequences}/unreceived_acks";
}
// NextSequenceReceive returns the next receive sequence for a given channel.
rpc NextSequenceReceive(QueryNextSequenceReceiveRequest) returns (QueryNextSequenceReceiveResponse) {
option (google.api.http).get = "/ibc/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence";
option (google.api.http).get = "/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence";
}
}

View File

@ -13,25 +13,25 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types";
service Query {
// ClientState queries an IBC light client.
rpc ClientState(QueryClientStateRequest) returns (QueryClientStateResponse) {
option (google.api.http).get = "/ibc/client/v1beta1/client_states/{client_id}";
option (google.api.http).get = "/ibc/core/client/v1beta1/client_states/{client_id}";
}
// ClientStates queries all the IBC light clients of a chain.
rpc ClientStates(QueryClientStatesRequest) returns (QueryClientStatesResponse) {
option (google.api.http).get = "/ibc/client/v1beta1/client_states";
option (google.api.http).get = "/ibc/core/client/v1beta1/client_states";
}
// ConsensusState queries a consensus state associated with a client state at
// a given height.
rpc ConsensusState(QueryConsensusStateRequest) returns (QueryConsensusStateResponse) {
option (google.api.http).get = "/ibc/client/v1beta1/consensus_states/{client_id}/version/{version_number}/"
option (google.api.http).get = "/ibc/core/client/v1beta1/consensus_states/{client_id}/version/{version_number}/"
"height/{version_height}";
}
// ConsensusStates queries all the consensus state associated with a given
// client.
rpc ConsensusStates(QueryConsensusStatesRequest) returns (QueryConsensusStatesResponse) {
option (google.api.http).get = "/ibc/client/v1beta1/consensus_states/{client_id}";
option (google.api.http).get = "/ibc/core/client/v1beta1/consensus_states/{client_id}";
}
}

View File

@ -4,7 +4,7 @@ package ibc.core.commitment.v1;
option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types";
import "gogoproto/gogo.proto";
import "tendermint/crypto/proof.proto";
import "confio/proofs.proto";
// MerkleRoot defines a merkle root hash.
// In the Cosmos SDK, the AppHash of a block header becomes the root.
@ -23,42 +23,18 @@ message MerklePrefix {
// MerklePath is the path used to verify commitment proofs, which can be an
// arbitrary structured object (defined by a commitment type).
// MerklePath is represented from root-to-leaf
message MerklePath {
option (gogoproto.goproto_stringer) = false;
KeyPath key_path = 1 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"key_path\""];
repeated string key_path = 1 [(gogoproto.moretags) = "yaml:\"key_path\""];
}
// MerkleProof is a wrapper type that contains a merkle proof.
// MerkleProof is a wrapper type over a chain of CommitmentProofs.
// It demonstrates membership or non-membership for an element or set of
// elements, verifiable in conjunction with a known commitment root. Proofs
// should be succinct.
// MerkleProofs are ordered from leaf-to-root
message MerkleProof {
tendermint.crypto.ProofOps proof = 1;
}
// KeyPath defines a slice of keys
message KeyPath {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.goproto_getters) = false;
repeated Key keys = 1;
}
// Key defines a proof Key
message Key {
option (gogoproto.goproto_getters) = false;
bytes name = 1;
KeyEncoding enc = 2;
}
// KeyEncoding defines the encoding format of a key's bytes.
enum KeyEncoding {
option (gogoproto.goproto_enum_prefix) = false;
// URL encoding
KEY_ENCODING_URL_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "URL"];
// Hex encoding
KEY_ENCODING_HEX = 1 [(gogoproto.enumvalue_customname) = "HEX"];
}
repeated ics23.CommitmentProof proofs = 1;
}

View File

@ -14,30 +14,30 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types
service Query {
// Connection queries an IBC connection end.
rpc Connection(QueryConnectionRequest) returns (QueryConnectionResponse) {
option (google.api.http).get = "/ibc/connection/v1beta1/connections/{connection_id}";
option (google.api.http).get = "/ibc/core/connection/v1beta1/connections/{connection_id}";
}
// Connections queries all the IBC connections of a chain.
rpc Connections(QueryConnectionsRequest) returns (QueryConnectionsResponse) {
option (google.api.http).get = "/ibc/connection/v1beta1/connections";
option (google.api.http).get = "/ibc/core/connection/v1beta1/connections";
}
// ClientConnections queries the connection paths associated with a client
// state.
rpc ClientConnections(QueryClientConnectionsRequest) returns (QueryClientConnectionsResponse) {
option (google.api.http).get = "/ibc/connection/v1beta1/client_connections/{client_id}";
option (google.api.http).get = "/ibc/core/connection/v1beta1/client_connections/{client_id}";
}
// ConnectionClientState queries the client state associated with the
// connection.
rpc ConnectionClientState(QueryConnectionClientStateRequest) returns (QueryConnectionClientStateResponse) {
option (google.api.http).get = "/ibc/connection/v1beta1/connections/{connection_id}/client_state";
option (google.api.http).get = "/ibc/core/connection/v1beta1/connections/{connection_id}/client_state";
}
// ConnectionConsensusState queries the consensus state associated with the
// connection.
rpc ConnectionConsensusState(QueryConnectionConsensusStateRequest) returns (QueryConnectionConsensusStateResponse) {
option (google.api.http).get = "/ibc/connection/v1beta1/connections/{connection_id}/consensus_state/"
option (google.api.http).get = "/ibc/core/connection/v1beta1/connections/{connection_id}/consensus_state/"
"version/{version_number}/height/{version_height}";
}
}

View File

@ -252,12 +252,20 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App
}
ctx.Logger.Debug("Initialization: tmNode started")
// Add the tx service to the gRPC router.
app.RegisterTxService(clientCtx)
config := config.GetConfig(ctx.Viper)
// Add the tx service to the gRPC router. We only need to register this
// service if API or gRPC is enabled, and avoid doing so in the general
// case, because it spawns a new local tendermint RPC client.
if config.API.Enable || config.GRPC.Enable {
clientCtx = clientCtx.
WithClient(local.New(tmNode))
app.RegisterTxService(clientCtx)
}
var apiSrv *api.Server
config := config.GetConfig(ctx.Viper)
if config.API.Enable {
genDoc, err := genDocProvider()
if err != nil {
@ -266,8 +274,7 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App
clientCtx := clientCtx.
WithHomeDir(home).
WithChainID(genDoc.ChainID).
WithClient(local.New(tmNode))
WithChainID(genDoc.ChainID)
apiSrv = api.New(clientCtx, ctx.Logger.With("module", "api-server"))
app.RegisterAPIRoutes(apiSrv, config.API)

View File

@ -109,7 +109,7 @@ func (suite *KeeperTestSuite) TestSendTransfer() {
packet := channeltypes.NewPacket(fungibleTokenPacket.GetBytes(), 1, channelB.PortID, channelB.ID, channelA.PortID, channelA.ID, clienttypes.NewHeight(0, 110), 0)
// get proof of packet commitment from chainB
packetKey := host.KeyPacketCommitment(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
packetKey := host.PacketCommitmentKey(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
proof, proofHeight := suite.chainB.QueryProof(packetKey)
recvMsg := channeltypes.NewMsgRecvPacket(packet, proof, proofHeight, suite.chainA.SenderAccount.GetAddress())

View File

@ -324,41 +324,40 @@ func init() {
}
var fileDescriptor_a638e2800a01538c = []byte{
// 532 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x4f, 0x6f, 0xd3, 0x30,
0x14, 0xaf, 0x37, 0xa8, 0xc4, 0x2b, 0xe2, 0x60, 0x26, 0xa8, 0xa2, 0x2a, 0x9b, 0xa2, 0x0a, 0xca,
0x06, 0x36, 0x19, 0x7f, 0x4e, 0x88, 0xc3, 0x84, 0x40, 0xdc, 0x46, 0xe1, 0x80, 0xe0, 0x30, 0x39,
0xa9, 0x49, 0x23, 0xd6, 0x38, 0x8b, 0xdd, 0x8a, 0x09, 0x71, 0xe1, 0x13, 0x20, 0xed, 0x4b, 0x20,
0xc4, 0x87, 0xe0, 0xb8, 0xe3, 0x24, 0x2e, 0x9c, 0x00, 0xb5, 0x7c, 0x07, 0xae, 0x28, 0xb6, 0xb3,
0xa6, 0xea, 0xe8, 0x96, 0x53, 0x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, 0xd6, 0xe6, 0xe2, 0xd6, 0xc9, 0xda, 0xcc, 0xe6, 0xb7,
0x5e, 0x1e, 0x8e, 0x5d, 0x74, 0x34, 0x76, 0xd1, 0xef, 0xb1, 0x8b, 0x3e, 0x4d, 0xdc, 0xda, 0xd1,
0xc4, 0xad, 0xfd, 0x98, 0xb8, 0xb5, 0x57, 0x0f, 0xa3, 0x58, 0xf5, 0x87, 0x01, 0x09, 0xc5, 0x80,
0xda, 0xa7, 0xcb, 0xfc, 0xdc, 0x92, 0xbd, 0xb7, 0xf4, 0x1d, 0xfd, 0xff, 0x13, 0xa5, 0xf6, 0x53,
0x2e, 0x83, 0xba, 0x7e, 0x7f, 0xee, 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x19, 0x46, 0xdf, 0x94,
0x56, 0x05, 0x00, 0x00,
// 528 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x3f, 0x6f, 0xd3, 0x40,
0x14, 0xcf, 0x95, 0x12, 0x89, 0x17, 0xc4, 0x70, 0x54, 0x10, 0x59, 0x95, 0x5b, 0x59, 0x08, 0x02,
0x85, 0x3b, 0x5c, 0xa0, 0x30, 0xa0, 0x0e, 0x15, 0x02, 0xb1, 0x95, 0xc0, 0x80, 0x60, 0x40, 0x67,
0xe7, 0x70, 0x2c, 0x1a, 0x9f, 0xeb, 0xbb, 0x44, 0x54, 0x88, 0x85, 0x4f, 0x80, 0xc4, 0x8e, 0x98,
0xd9, 0x19, 0xd8, 0x18, 0x3b, 0x56, 0x62, 0x61, 0x02, 0x94, 0xf0, 0x41, 0x90, 0xef, 0xce, 0x8d,
0xa3, 0x20, 0x13, 0x4f, 0x39, 0x5d, 0xde, 0xef, 0xfd, 0xfe, 0xbc, 0xe7, 0x83, 0x4e, 0x1c, 0x84,
0x94, 0xa5, 0xe9, 0x5e, 0x1c, 0x32, 0x15, 0x8b, 0x44, 0x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0x4f, 0xdc, 0xc6, 0xd1, 0xc4, 0x6d,
0xfc, 0x98, 0xb8, 0x8d, 0x67, 0xdb, 0x51, 0xac, 0xfa, 0xc3, 0x80, 0x84, 0x62, 0x40, 0xed, 0x0b,
0x67, 0x7e, 0xae, 0xc9, 0xde, 0x2b, 0xfa, 0xba, 0x82, 0x42, 0x1d, 0xa4, 0x5c, 0x06, 0x4d, 0xfd,
0x4c, 0xdd, 0xf8, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x7f, 0xfe, 0xbd, 0x7d, 0x05, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

View File

@ -310,11 +310,11 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
var (
pattern_Query_DenomTrace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ibc_transfer", "v1beta1", "denom_traces", "hash"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_DenomTrace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"ibc", "applications", "transfer", "v1beta1", "denom_traces", "hash"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_DenomTraces_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ibc_transfer", "v1beta1", "denom_traces"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_DenomTraces_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"ibc", "applications", "transfer", "v1beta1", "denom_traces"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ibc_transfer", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"ibc", "applications", "transfer", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (

View File

@ -38,7 +38,7 @@ func QueryClientState(
func QueryClientStateABCI(
clientCtx client.Context, clientID string,
) (*types.QueryClientStateResponse, error) {
key := host.FullKeyClientPath(clientID, host.KeyClientState())
key := host.FullClientStateKey(clientID)
value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key)
if err != nil {
@ -91,7 +91,7 @@ func QueryConsensusState(
func QueryConsensusStateABCI(
clientCtx client.Context, clientID string, height exported.Height,
) (*types.QueryConsensusStateResponse, error) {
key := host.FullKeyClientPath(clientID, host.KeyConsensusState(height))
key := host.FullConsensusStateKey(clientID, height)
value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key)
if err != nil {

View File

@ -152,7 +152,7 @@ func (q Keeper) ConsensusStates(c context.Context, req *types.QueryConsensusStat
ctx := sdk.UnwrapSDKContext(c)
consensusStates := []types.ConsensusStateWithHeight{}
store := prefix.NewStore(ctx.KVStore(q.storeKey), host.FullKeyClientPath(req.ClientId, []byte(fmt.Sprintf("%s/", host.KeyConsensusStatesPrefix))))
store := prefix.NewStore(ctx.KVStore(q.storeKey), host.FullClientKey(req.ClientId, []byte(fmt.Sprintf("%s/", host.KeyConsensusStatePrefix))))
pageRes, err := query.Paginate(store, req.Pagination, func(key, value []byte) error {
height, err := types.ParseHeight(string(key))

View File

@ -46,7 +46,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger {
// GetClientState gets a particular client from the store
func (k Keeper) GetClientState(ctx sdk.Context, clientID string) (exported.ClientState, bool) {
store := k.ClientStore(ctx, clientID)
bz := store.Get(host.KeyClientState())
bz := store.Get(host.ClientStateKey())
if bz == nil {
return nil, false
}
@ -58,13 +58,13 @@ func (k Keeper) GetClientState(ctx sdk.Context, clientID string) (exported.Clien
// SetClientState sets a particular Client to the store
func (k Keeper) SetClientState(ctx sdk.Context, clientID string, clientState exported.ClientState) {
store := k.ClientStore(ctx, clientID)
store.Set(host.KeyClientState(), k.MustMarshalClientState(clientState))
store.Set(host.ClientStateKey(), k.MustMarshalClientState(clientState))
}
// GetClientConsensusState gets the stored consensus state from a client at a given height.
func (k Keeper) GetClientConsensusState(ctx sdk.Context, clientID string, height exported.Height) (exported.ConsensusState, bool) {
store := k.ClientStore(ctx, clientID)
bz := store.Get(host.KeyConsensusState(height))
bz := store.Get(host.ConsensusStateKey(height))
if bz == nil {
return nil, false
}
@ -77,7 +77,7 @@ func (k Keeper) GetClientConsensusState(ctx sdk.Context, clientID string, height
// height
func (k Keeper) SetClientConsensusState(ctx sdk.Context, clientID string, height exported.Height, consensusState exported.ConsensusState) {
store := k.ClientStore(ctx, clientID)
store.Set(host.KeyConsensusState(height), k.MustMarshalConsensusState(consensusState))
store.Set(host.ConsensusStateKey(height), k.MustMarshalConsensusState(consensusState))
}
// IterateConsensusStates provides an iterator over all stored consensus states.
@ -91,7 +91,7 @@ func (k Keeper) IterateConsensusStates(ctx sdk.Context, cb func(clientID string,
for ; iterator.Valid(); iterator.Next() {
keySplit := strings.Split(string(iterator.Key()), "/")
// consensus key is in the format "clients/<clientID>/consensusStates/<height>"
if len(keySplit) != 4 || keySplit[2] != string(host.KeyConsensusStatesPrefix) {
if len(keySplit) != 4 || keySplit[2] != string(host.KeyConsensusStatePrefix) {
continue
}
clientID := keySplit[1]
@ -144,7 +144,7 @@ func (k Keeper) GetAllConsensusStates(ctx sdk.Context) types.ClientsConsensusSta
// client at the given height
func (k Keeper) HasClientConsensusState(ctx sdk.Context, clientID string, height exported.Height) bool {
store := k.ClientStore(ctx, clientID)
return store.Has(host.KeyConsensusState(height))
return store.Has(host.ConsensusStateKey(height))
}
// GetLatestClientConsensusState gets the latest ConsensusState stored for a given client
@ -266,7 +266,7 @@ func (k Keeper) IterateClients(ctx sdk.Context, cb func(clientID string, cs expo
defer iterator.Close()
for ; iterator.Valid(); iterator.Next() {
keySplit := strings.Split(string(iterator.Key()), "/")
if keySplit[len(keySplit)-1] != "clientState" {
if keySplit[len(keySplit)-1] != host.KeyClientState {
continue
}
clientState := k.MustUnmarshalClientState(iterator.Value())
@ -291,8 +291,6 @@ func (k Keeper) GetAllClients(ctx sdk.Context) (states []exported.ClientState) {
// ClientStore returns isolated prefix store for each client so they can read/write in separate
// namespace without being able to read/write other client's data
func (k Keeper) ClientStore(ctx sdk.Context, clientID string) sdk.KVStore {
// append here is safe, appends within a function won't cause
// weird side effects when its singlethreaded
clientPrefix := append([]byte("clients/"+clientID), '/')
clientPrefix := []byte(fmt.Sprintf("%s/%s/", host.KeyClientStorePrefix, clientID))
return prefix.NewStore(ctx.KVStore(k.storeKey), clientPrefix)
}

View File

@ -22,12 +22,12 @@ type ClientUnmarshaler interface {
// Value to the corresponding client type.
func NewDecodeStore(cdc ClientUnmarshaler, kvA, kvB kv.Pair) (string, bool) {
switch {
case bytes.HasPrefix(kvA.Key, host.KeyClientStorePrefix) && bytes.HasSuffix(kvA.Key, host.KeyClientState()):
case bytes.HasPrefix(kvA.Key, host.KeyClientStorePrefix) && bytes.HasSuffix(kvA.Key, []byte(host.KeyClientState)):
clientStateA := cdc.MustUnmarshalClientState(kvA.Value)
clientStateB := cdc.MustUnmarshalClientState(kvB.Value)
return fmt.Sprintf("ClientState A: %v\nClientState B: %v", clientStateA, clientStateB), true
case bytes.HasPrefix(kvA.Key, host.KeyClientStorePrefix) && bytes.Contains(kvA.Key, []byte("consensusState")):
case bytes.HasPrefix(kvA.Key, host.KeyClientStorePrefix) && bytes.Contains(kvA.Key, []byte(host.KeyConsensusStatePrefix)):
consensusStateA := cdc.MustUnmarshalConsensusState(kvA.Value)
consensusStateB := cdc.MustUnmarshalConsensusState(kvB.Value)
return fmt.Sprintf("ConsensusState A: %v\nConsensusState B: %v", consensusStateA, consensusStateB), true

View File

@ -32,11 +32,11 @@ func TestDecodeStore(t *testing.T) {
kvPairs := kv.Pairs{
Pairs: []kv.Pair{
{
Key: host.FullKeyClientPath(clientID, host.KeyClientState()),
Key: host.FullClientStateKey(clientID),
Value: app.IBCKeeper.ClientKeeper.MustMarshalClientState(clientState),
},
{
Key: host.FullKeyClientPath(clientID, host.KeyConsensusState(height)),
Key: host.FullConsensusStateKey(clientID, height),
Value: app.IBCKeeper.ClientKeeper.MustMarshalConsensusState(consState),
},
{

View File

@ -514,54 +514,54 @@ func init() {
func init() { proto.RegisterFile("ibc/core/client/v1/query.proto", fileDescriptor_dc42cdfd1d52d76e) }
var fileDescriptor_dc42cdfd1d52d76e = []byte{
// 747 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x4f, 0x13, 0x41,
0x14, 0xef, 0xf0, 0xc7, 0xc0, 0xb4, 0x80, 0x99, 0x90, 0x58, 0x16, 0x52, 0x6a, 0x89, 0x5a, 0x94,
0xce, 0xd0, 0x1a, 0xc5, 0x8b, 0x07, 0x21, 0x41, 0xb9, 0x10, 0x59, 0x0f, 0x26, 0x26, 0x86, 0xec,
0x6e, 0x87, 0xed, 0x44, 0xd8, 0x29, 0x9d, 0x69, 0x23, 0x21, 0x5c, 0xf8, 0x04, 0x26, 0x26, 0x5e,
0xfd, 0x02, 0x86, 0x93, 0x89, 0xdf, 0xc0, 0x70, 0x24, 0x7a, 0xf1, 0x60, 0x8c, 0x01, 0x3f, 0x88,
0xe9, 0xcc, 0x2c, 0xdd, 0x85, 0x25, 0xac, 0x46, 0x4f, 0x3b, 0xf3, 0xfe, 0xfe, 0xde, 0xef, 0xbd,
0x79, 0x59, 0x58, 0x60, 0xae, 0x47, 0x3c, 0xde, 0xa2, 0xc4, 0xdb, 0x64, 0x34, 0x90, 0xa4, 0x53,
0x25, 0xdb, 0x6d, 0xda, 0xda, 0xc1, 0xcd, 0x16, 0x97, 0x1c, 0x21, 0xe6, 0x7a, 0xb8, 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, 0x78, 0x73, 0x52, 0xc8,
0x1c, 0x9d, 0x14, 0x32, 0xdf, 0x4e, 0x0a, 0x99, 0x17, 0x0b, 0x3e, 0x93, 0x8d, 0xb6, 0x8b, 0x3d,
0xbe, 0x45, 0xcc, 0x0f, 0x85, 0xfe, 0x54, 0x44, 0xfd, 0x15, 0x79, 0x4d, 0x4e, 0x7f, 0x1c, 0xe6,
0x6b, 0x15, 0x93, 0x51, 0xee, 0x34, 0xa9, 0x70, 0xaf, 0xa8, 0x75, 0x77, 0xf7, 0x77, 0x00, 0x00,
0x00, 0xff, 0xff, 0x09, 0x8e, 0x83, 0x3d, 0xbb, 0x08, 0x00, 0x00,
// 746 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6b, 0x13, 0x4f,
0x18, 0xcf, 0xf4, 0xe5, 0x4f, 0x3b, 0x49, 0xdb, 0x3f, 0x43, 0xc1, 0x74, 0x5b, 0xb6, 0x21, 0x62,
0x8d, 0xda, 0xce, 0x34, 0xf1, 0xa5, 0x20, 0xf4, 0x60, 0x0b, 0xd5, 0x5e, 0x8a, 0x5d, 0x0f, 0x82,
0x20, 0x65, 0x77, 0x33, 0xd9, 0x2c, 0xb6, 0x3b, 0x69, 0x66, 0x12, 0x2c, 0xa5, 0x97, 0x7e, 0x02,
0xc1, 0xa3, 0x57, 0x8f, 0xe2, 0x45, 0xc1, 0x6f, 0x20, 0x3d, 0x16, 0xbc, 0x78, 0x12, 0x6d, 0xc5,
0xcf, 0x21, 0x3b, 0x33, 0xdb, 0xec, 0x36, 0x5b, 0x5c, 0x8a, 0x9e, 0xb2, 0xfb, 0xbc, 0xfe, 0x9e,
0xdf, 0xef, 0xd9, 0x87, 0x40, 0xd3, 0x77, 0x5c, 0xe2, 0xb2, 0x36, 0x25, 0xee, 0xb6, 0x4f, 0x03,
0x41, 0xba, 0x55, 0xb2, 0xdb, 0xa1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0x79, 0x74, 0x62, 0x82, 0xe3, 0x13, 0x13, 0x7c, 0x3f, 0x31, 0xc1, 0xab, 0x53, 0x33,
0x77, 0x7c, 0x6a, 0xe6, 0xbe, 0x9e, 0x9a, 0xb9, 0x67, 0x4b, 0x9e, 0x2f, 0x9a, 0x1d, 0x07, 0xbb,
0x6c, 0x87, 0xe8, 0x3f, 0x19, 0xea, 0x67, 0x81, 0xd7, 0x5f, 0x90, 0x97, 0xbd, 0x76, 0x8b, 0xb5,
0x05, 0xdd, 0x51, 0xec, 0xb5, 0x28, 0x77, 0xfe, 0x93, 0x27, 0xf0, 0xf6, 0xef, 0x00, 0x00, 0x00,
0xff, 0xff, 0x71, 0x1f, 0x83, 0xc2, 0xcf, 0x08, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

View File

@ -520,13 +520,13 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
var (
pattern_Query_ClientState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ibc", "client", "v1beta1", "client_states", "client_id"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ClientState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"ibc", "core", "client", "v1beta1", "client_states", "client_id"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ClientStates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ibc", "client", "v1beta1", "client_states"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ClientStates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"ibc", "core", "client", "v1beta1", "client_states"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ConsensusState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"ibc", "client", "v1beta1", "consensus_states", "client_id", "version", "version_number", "height", "version_height"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ConsensusState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8, 1, 0, 4, 1, 5, 9}, []string{"ibc", "core", "client", "v1beta1", "consensus_states", "client_id", "version", "version_number", "height", "version_height"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ConsensusStates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ibc", "client", "v1beta1", "consensus_states", "client_id"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ConsensusStates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"ibc", "core", "client", "v1beta1", "consensus_states", "client_id"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (

View File

@ -38,7 +38,7 @@ func QueryConnection(
}
func queryConnectionABCI(clientCtx client.Context, connectionID string) (*types.QueryConnectionResponse, error) {
key := host.KeyConnection(connectionID)
key := host.ConnectionKey(connectionID)
value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key)
if err != nil {
@ -79,7 +79,7 @@ func QueryClientConnections(
}
func queryClientConnectionsABCI(clientCtx client.Context, clientID string) (*types.QueryClientConnectionsResponse, error) {
key := host.KeyClientConnections(clientID)
key := host.ClientConnectionsKey(clientID)
value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key)
if err != nil {

View File

@ -51,7 +51,7 @@ func (q Keeper) Connections(c context.Context, req *types.QueryConnectionsReques
ctx := sdk.UnwrapSDKContext(c)
connections := []*types.IdentifiedConnection{}
store := prefix.NewStore(ctx.KVStore(q.storeKey), host.KeyConnectionPrefix)
store := prefix.NewStore(ctx.KVStore(q.storeKey), []byte(host.KeyConnectionPrefix))
pageRes, err := query.Paginate(store, req.Pagination, func(key, value []byte) error {
var result types.ConnectionEnd

View File

@ -306,18 +306,18 @@ func (suite *KeeperTestSuite) TestConnOpenTry() {
counterpartyChosenConnectionID = connection.Counterparty.ConnectionId
}
connectionKey := host.KeyConnection(connA.ID)
connectionKey := host.ConnectionKey(connA.ID)
proofInit, proofHeight := suite.chainA.QueryProof(connectionKey)
if consensusHeight.IsZero() {
// retrieve consensus state height to provide proof for
consensusHeight = counterpartyClient.GetLatestHeight()
}
consensusKey := host.FullKeyClientPath(clientA, host.KeyConsensusState(consensusHeight))
consensusKey := host.FullConsensusStateKey(clientA, consensusHeight)
proofConsensus, _ := suite.chainA.QueryProof(consensusKey)
// retrieve proof of counterparty clientstate on chainA
clientKey := host.FullKeyClientPath(clientA, host.KeyClientState())
clientKey := host.FullClientStateKey(clientA)
proofClient, _ := suite.chainA.QueryProof(clientKey)
err := suite.chainB.App.IBCKeeper.ConnectionKeeper.ConnOpenTry(
@ -661,10 +661,10 @@ func (suite *KeeperTestSuite) TestConnOpenAck() {
for _, tc := range testCases {
tc := tc
suite.Run(tc.msg, func() {
suite.SetupTest() // reset
suite.SetupTest() // reset
version = types.ExportedVersionsToProto(types.GetCompatibleVersions())[0] // must be explicitly changed in malleate
consensusHeight = clienttypes.ZeroHeight() // must be explicitly changed in malleate
counterpartyConnectionID = "" // must be explicitly changed in malleate
consensusHeight = clienttypes.ZeroHeight() // must be explicitly changed in malleate
counterpartyConnectionID = "" // must be explicitly changed in malleate
tc.malleate()
@ -675,7 +675,7 @@ func (suite *KeeperTestSuite) TestConnOpenAck() {
counterpartyConnectionID = connB.ID
}
connectionKey := host.KeyConnection(connB.ID)
connectionKey := host.ConnectionKey(connB.ID)
proofTry, proofHeight := suite.chainB.QueryProof(connectionKey)
if consensusHeight.IsZero() {
@ -683,11 +683,11 @@ func (suite *KeeperTestSuite) TestConnOpenAck() {
clientState := suite.chainB.GetClientState(clientB)
consensusHeight = clientState.GetLatestHeight()
}
consensusKey := host.FullKeyClientPath(clientB, host.KeyConsensusState(consensusHeight))
consensusKey := host.FullConsensusStateKey(clientB, consensusHeight)
proofConsensus, _ := suite.chainB.QueryProof(consensusKey)
// retrieve proof of counterparty clientstate on chainA
clientKey := host.FullKeyClientPath(clientB, host.KeyClientState())
clientKey := host.FullClientStateKey(clientB)
proofClient, _ := suite.chainB.QueryProof(clientKey)
err := suite.chainA.App.IBCKeeper.ConnectionKeeper.ConnOpenAck(
@ -757,7 +757,7 @@ func (suite *KeeperTestSuite) TestConnOpenConfirm() {
connA := suite.chainA.GetFirstTestConnection(clientA, clientB)
connB := suite.chainB.GetFirstTestConnection(clientB, clientA)
connectionKey := host.KeyConnection(connA.ID)
connectionKey := host.ConnectionKey(connA.ID)
proofAck, proofHeight := suite.chainA.QueryProof(connectionKey)
err := suite.chainB.App.IBCKeeper.ConnectionKeeper.ConnOpenConfirm(

View File

@ -48,7 +48,7 @@ func (k Keeper) GetCommitmentPrefix() exported.Prefix {
// GetConnection returns a connection with a particular identifier
func (k Keeper) GetConnection(ctx sdk.Context, connectionID string) (types.ConnectionEnd, bool) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(host.KeyConnection(connectionID))
bz := store.Get(host.ConnectionKey(connectionID))
if bz == nil {
return types.ConnectionEnd{}, false
}
@ -63,7 +63,7 @@ func (k Keeper) GetConnection(ctx sdk.Context, connectionID string) (types.Conne
func (k Keeper) SetConnection(ctx sdk.Context, connectionID string, connection types.ConnectionEnd) {
store := ctx.KVStore(k.storeKey)
bz := k.cdc.MustMarshalBinaryBare(&connection)
store.Set(host.KeyConnection(connectionID), bz)
store.Set(host.ConnectionKey(connectionID), bz)
}
// GetTimestampAtHeight returns the timestamp in nanoseconds of the consensus state at the
@ -87,7 +87,7 @@ func (k Keeper) GetTimestampAtHeight(ctx sdk.Context, connection types.Connectio
// particular client
func (k Keeper) GetClientConnectionPaths(ctx sdk.Context, clientID string) ([]string, bool) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(host.KeyClientConnections(clientID))
bz := store.Get(host.ClientConnectionsKey(clientID))
if bz == nil {
return nil, false
}
@ -102,7 +102,7 @@ func (k Keeper) SetClientConnectionPaths(ctx sdk.Context, clientID string, paths
store := ctx.KVStore(k.storeKey)
clientPaths := types.ClientPaths{Paths: paths}
bz := k.cdc.MustMarshalBinaryBare(&clientPaths)
store.Set(host.KeyClientConnections(clientID), bz)
store.Set(host.ClientConnectionsKey(clientID), bz)
}
// GetAllClientConnectionPaths returns all stored clients connection id paths. It
@ -129,7 +129,7 @@ func (k Keeper) GetAllClientConnectionPaths(ctx sdk.Context) []types.ConnectionP
// iterator will close and stop.
func (k Keeper) IterateConnections(ctx sdk.Context, cb func(types.IdentifiedConnection) bool) {
store := ctx.KVStore(k.storeKey)
iterator := sdk.KVStorePrefixIterator(store, host.KeyConnectionPrefix)
iterator := sdk.KVStorePrefixIterator(store, []byte(host.KeyConnectionPrefix))
defer iterator.Close()
for ; iterator.Valid(); iterator.Next() {

View File

@ -178,7 +178,7 @@ func (suite *KeeperTestSuite) TestVerifyConnectionState() {
}
expectedConnection := suite.chainB.GetConnection(connB)
connectionKey := host.KeyConnection(connB.ID)
connectionKey := host.ConnectionKey(connB.ID)
proof, proofHeight := suite.chainB.QueryProof(connectionKey)
if tc.changeConnectionState {
@ -227,7 +227,7 @@ func (suite *KeeperTestSuite) TestVerifyChannelState() {
connection.ClientId = ibctesting.InvalidID
}
channelKey := host.KeyChannel(channelB.PortID, channelB.ID)
channelKey := host.ChannelKey(channelB.PortID, channelB.ID)
proof, proofHeight := suite.chainB.QueryProof(channelKey)
channel := suite.chainB.GetChannel(channelB)
@ -282,7 +282,7 @@ func (suite *KeeperTestSuite) TestVerifyPacketCommitment() {
err := suite.coordinator.SendPacket(suite.chainA, suite.chainB, packet, clientB)
suite.Require().NoError(err)
commitmentKey := host.KeyPacketCommitment(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
commitmentKey := host.PacketCommitmentKey(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
proof, proofHeight := suite.chainA.QueryProof(commitmentKey)
if tc.changePacketCommitmentState {
@ -340,7 +340,7 @@ func (suite *KeeperTestSuite) TestVerifyPacketAcknowledgement() {
err = suite.coordinator.RecvPacket(suite.chainA, suite.chainB, clientA, packet)
suite.Require().NoError(err)
packetAckKey := host.KeyPacketAcknowledgement(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
packetAckKey := host.PacketAcknowledgementKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
proof, proofHeight := suite.chainB.QueryProof(packetAckKey)
ack := ibcmock.MockAcknowledgement
@ -405,7 +405,7 @@ func (suite *KeeperTestSuite) TestVerifyPacketReceiptAbsence() {
suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint)
}
packetReceiptKey := host.KeyPacketReceipt(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
packetReceiptKey := host.PacketReceiptKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
proof, proofHeight := suite.chainB.QueryProof(packetReceiptKey)
err = suite.chainA.App.IBCKeeper.ConnectionKeeper.VerifyPacketReceiptAbsence(
@ -459,7 +459,7 @@ func (suite *KeeperTestSuite) TestVerifyNextSequenceRecv() {
err = suite.coordinator.RecvPacket(suite.chainA, suite.chainB, clientA, packet)
suite.Require().NoError(err)
nextSeqRecvKey := host.KeyNextSequenceRecv(packet.GetDestPort(), packet.GetDestChannel())
nextSeqRecvKey := host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel())
proof, proofHeight := suite.chainB.QueryProof(nextSeqRecvKey)
err = suite.chainA.App.IBCKeeper.ConnectionKeeper.VerifyNextSequenceRecv(

View File

@ -14,13 +14,13 @@ import (
// Value to the corresponding connection type.
func NewDecodeStore(cdc codec.BinaryMarshaler, kvA, kvB kv.Pair) (string, bool) {
switch {
case bytes.HasPrefix(kvA.Key, host.KeyClientStorePrefix) && bytes.HasSuffix(kvA.Key, host.KeyConnectionPrefix):
case bytes.HasPrefix(kvA.Key, host.KeyClientStorePrefix) && bytes.HasSuffix(kvA.Key, []byte(host.KeyConnectionPrefix)):
var clientConnectionsA, clientConnectionsB types.ClientPaths
cdc.MustUnmarshalBinaryBare(kvA.Value, &clientConnectionsA)
cdc.MustUnmarshalBinaryBare(kvB.Value, &clientConnectionsB)
return fmt.Sprintf("ClientPaths A: %v\nClientPaths B: %v", clientConnectionsA, clientConnectionsB), true
case bytes.HasPrefix(kvA.Key, host.KeyConnectionPrefix):
case bytes.HasPrefix(kvA.Key, []byte(host.KeyConnectionPrefix)):
var connectionA, connectionB types.ConnectionEnd
cdc.MustUnmarshalBinaryBare(kvA.Value, &connectionA)
cdc.MustUnmarshalBinaryBare(kvB.Value, &connectionB)

View File

@ -31,11 +31,11 @@ func TestDecodeStore(t *testing.T) {
kvPairs := kv.Pairs{
Pairs: []kv.Pair{
{
Key: host.KeyClientConnections(connection.ClientId),
Key: host.ClientConnectionsKey(connection.ClientId),
Value: cdc.MustMarshalBinaryBare(&paths),
},
{
Key: host.KeyConnection(connectionID),
Key: host.ConnectionKey(connectionID),
Value: cdc.MustMarshalBinaryBare(&connection),
},
{

View File

@ -62,9 +62,10 @@ func (suite *MsgTestSuite) SetupTest() {
Prove: true,
})
merkleProof := commitmenttypes.MerkleProof{Proof: res.ProofOps}
merkleProof, err := commitmenttypes.ConvertProofs(res.ProofOps)
suite.Require().NoError(err)
proof, err := app.AppCodec().MarshalBinaryBare(&merkleProof)
suite.NoError(err)
suite.Require().NoError(err)
suite.proof = proof

View File

@ -635,63 +635,63 @@ func init() {
}
var fileDescriptor_cd8d529f8c7cd06b = []byte{
// 891 bytes of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0b, 0xdd, 0x9b, 0xc2, 0x0e, 0xba, 0x04, 0xf0, 0x65, 0xa2, 0x25, 0xa1, 0x0f, 0x87, 0x54, 0xaf,
0xdf, 0x2b, 0xb5, 0xcd, 0x51, 0x4a, 0x25, 0xa1, 0x3d, 0x4e, 0xa8, 0x8c, 0x3e, 0x1e, 0x61, 0x64,
0x88, 0x6a, 0x98, 0xe8, 0xa7, 0x34, 0xcc, 0x0d, 0xba, 0xd2, 0x68, 0x7b, 0x58, 0x88, 0x49, 0xfe,
0xa5, 0x95, 0x46, 0xac, 0x96, 0x1c, 0xbf, 0xe5, 0x1c, 0x5b, 0x28, 0x18, 0x89, 0x63, 0xdc, 0x81,
0x88, 0x34, 0x33, 0x72, 0x16, 0xb7, 0xc4, 0x0e, 0x11, 0x96, 0x11, 0xc5, 0xc5, 0x7b, 0xa7, 0xfc,
0xe5, 0x79, 0x37, 0x0f, 0x2e, 0xba, 0x79, 0xf0, 0x57, 0x37, 0x0f, 0x7e, 0xb8, 0xce, 0xa7, 0x2e,
0xae, 0xf3, 0xa9, 0xcb, 0xeb, 0x7c, 0xea, 0xab, 0x2d, 0xc7, 0x0d, 0xaa, 0x4d, 0x0b, 0xdb, 0xac,
0x46, 0xe4, 0x3f, 0x5f, 0xf1, 0xb3, 0xe4, 0x57, 0xbe, 0x26, 0xdf, 0x90, 0x9b, 0x3f, 0xb0, 0xcb,
0xab, 0x4b, 0x0a, 0xea, 0xa0, 0x5d, 0xa7, 0xbe, 0xf5, 0x94, 0x7b, 0xdf, 0xea, 0x7f, 0x01, 0x00,
0x00, 0xff, 0xff, 0x3b, 0x66, 0x6e, 0x99, 0x86, 0x0b, 0x00, 0x00,
// 887 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x41, 0x4f, 0x33, 0x45,
0x18, 0xee, 0x14, 0xbe, 0x2f, 0x1f, 0x53, 0x40, 0x9d, 0x14,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0xed, 0x8f, 0x3a, 0x41, 0x44, 0x35, 0x51,
0xf4, 0x53, 0x1a, 0xe6, 0xfa, 0x5d, 0x73, 0xb4, 0x33, 0x2c, 0xce, 0x24, 0x4f, 0xd3, 0x4a, 0x23,
0x56, 0x4b, 0xa2, 0xdf, 0x01, 0xce, 0xf4, 0x02, 0xb5, 0x46, 0x67, 0x1a, 0xf7, 0x26, 0x22, 0x6d,
0x8e, 0x5c, 0xc4, 0xcd, 0xb2, 0x4d, 0x84, 0x99, 0x44, 0x71, 0xf1, 0xde, 0xde, 0xfd, 0xea, 0xaa,
0x93, 0x07, 0xd7, 0x9d, 0x3c, 0xf8, 0xbb, 0x93, 0x07, 0x3f, 0xdc, 0xe6, 0x53, 0xd7, 0xb7, 0xf9,
0xd4, 0x9f, 0xb7, 0xf9, 0xd4, 0xd7, 0xdb, 0x8e, 0x1b, 0x54, 0x1a, 0x16, 0xb6, 0x59, 0x95, 0xc8,
0xff, 0xc4, 0xe2, 0x67, 0xd5, 0x2f, 0x7f, 0x43, 0xbe, 0x8d, 0x20, 0xaf, 0x6d, 0xac, 0x2a, 0xa8,
0x83, 0x56, 0x8d, 0xfa, 0xd6, 0x73, 0xee, 0x8a, 0x1b, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x91,
0x3b, 0x2c, 0x79, 0xa0, 0x0b, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

View File

@ -578,15 +578,15 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
var (
pattern_Query_Connection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ibc", "connection", "v1beta1", "connections", "connection_id"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Connection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"ibc", "core", "connection", "v1beta1", "connections", "connection_id"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Connections_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ibc", "connection", "v1beta1", "connections"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Connections_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"ibc", "core", "connection", "v1beta1", "connections"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ClientConnections_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ibc", "connection", "v1beta1", "client_connections", "client_id"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ClientConnections_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"ibc", "core", "connection", "v1beta1", "client_connections", "client_id"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ConnectionClientState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"ibc", "connection", "v1beta1", "connections", "connection_id", "client_state"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ConnectionClientState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"ibc", "core", "connection", "v1beta1", "connections", "connection_id", "client_state"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ConnectionConsensusState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8, 1, 0, 4, 1, 5, 9}, []string{"ibc", "connection", "v1beta1", "connections", "connection_id", "consensus_state", "version", "version_number", "height", "version_height"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ConnectionConsensusState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9, 1, 0, 4, 1, 5, 10}, []string{"ibc", "core", "connection", "v1beta1", "connections", "connection_id", "consensus_state", "version", "version_number", "height", "version_height"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (

View File

@ -35,7 +35,7 @@ func QueryChannel(
}
func queryChannelABCI(clientCtx client.Context, portID, channelID string) (*types.QueryChannelResponse, error) {
key := host.KeyChannel(portID, channelID)
key := host.ChannelKey(portID, channelID)
value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key)
if err != nil {
@ -176,7 +176,7 @@ func QueryNextSequenceReceive(
}
func queryNextSequenceRecvABCI(clientCtx client.Context, portID, channelID string) (*types.QueryNextSequenceReceiveResponse, error) {
key := host.KeyNextSequenceRecv(portID, channelID)
key := host.NextSequenceRecvKey(portID, channelID)
value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key)
if err != nil {
@ -217,7 +217,7 @@ func QueryPacketCommitment(
func queryPacketCommitmentABCI(
clientCtx client.Context, portID, channelID string, sequence uint64,
) (*types.QueryPacketCommitmentResponse, error) {
key := host.KeyPacketCommitment(portID, channelID, sequence)
key := host.PacketCommitmentKey(portID, channelID, sequence)
value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key)
if err != nil {
@ -256,7 +256,7 @@ func QueryPacketReceipt(
func queryPacketReceiptABCI(
clientCtx client.Context, portID, channelID string, sequence uint64,
) (*types.QueryPacketReceiptResponse, error) {
key := host.KeyPacketReceipt(portID, channelID, sequence)
key := host.PacketReceiptKey(portID, channelID, sequence)
value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key)
if err != nil {
@ -285,7 +285,7 @@ func QueryPacketAcknowledgement(clientCtx client.Context, portID, channelID stri
}
func queryPacketAcknowledgementABCI(clientCtx client.Context, portID, channelID string, sequence uint64) (*types.QueryPacketAcknowledgementResponse, error) {
key := host.KeyPacketAcknowledgement(portID, channelID, sequence)
key := host.PacketAcknowledgementKey(portID, channelID, sequence)
value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key)
if err != nil {

View File

@ -52,7 +52,7 @@ func (q Keeper) Channels(c context.Context, req *types.QueryChannelsRequest) (*t
ctx := sdk.UnwrapSDKContext(c)
channels := []*types.IdentifiedChannel{}
store := prefix.NewStore(ctx.KVStore(q.storeKey), []byte(host.KeyChannelPrefix))
store := prefix.NewStore(ctx.KVStore(q.storeKey), []byte(host.KeyChannelEndPrefix))
pageRes, err := query.Paginate(store, req.Pagination, func(key, value []byte) error {
var result types.Channel
@ -95,7 +95,7 @@ func (q Keeper) ConnectionChannels(c context.Context, req *types.QueryConnection
ctx := sdk.UnwrapSDKContext(c)
channels := []*types.IdentifiedChannel{}
store := prefix.NewStore(ctx.KVStore(q.storeKey), []byte(host.KeyChannelPrefix))
store := prefix.NewStore(ctx.KVStore(q.storeKey), []byte(host.KeyChannelEndPrefix))
pageRes, err := query.Paginate(store, req.Pagination, func(key, value []byte) error {
var result types.Channel

View File

@ -289,7 +289,7 @@ func (suite *KeeperTestSuite) TestChanOpenTry() {
counterpartyChosenChannelID = channel.Counterparty.ChannelId
}
channelKey := host.KeyChannel(counterparty.PortId, counterparty.ChannelId)
channelKey := host.ChannelKey(counterparty.PortId, counterparty.ChannelId)
proof, proofHeight := suite.chainA.QueryProof(channelKey)
cap, err := suite.chainB.App.IBCKeeper.ChannelKeeper.ChanOpenTry(
@ -455,7 +455,7 @@ func (suite *KeeperTestSuite) TestChanOpenAck() {
counterpartyChannelID = channelB.ID
}
channelKey := host.KeyChannel(channelB.PortID, channelB.ID)
channelKey := host.ChannelKey(channelB.PortID, channelB.ID)
proof, proofHeight := suite.chainB.QueryProof(channelKey)
err := suite.chainA.App.IBCKeeper.ChannelKeeper.ChanOpenAck(
@ -583,7 +583,7 @@ func (suite *KeeperTestSuite) TestChanOpenConfirm() {
channelA := connA.FirstOrNextTestChannel(ibctesting.MockPort)
channelB := connB.FirstOrNextTestChannel(ibctesting.MockPort)
channelKey := host.KeyChannel(channelA.PortID, channelA.ID)
channelKey := host.ChannelKey(channelA.PortID, channelA.ID)
proof, proofHeight := suite.chainA.QueryProof(channelKey)
err := suite.chainB.App.IBCKeeper.ChannelKeeper.ChanOpenConfirm(
@ -784,7 +784,7 @@ func (suite *KeeperTestSuite) TestChanCloseConfirm() {
channelA = connA.FirstOrNextTestChannel(ibctesting.MockPort)
channelB = connB.FirstOrNextTestChannel(ibctesting.MockPort)
channelKey := host.KeyChannel(channelA.PortID, channelA.ID)
channelKey := host.ChannelKey(channelA.PortID, channelA.ID)
proof, proofHeight := suite.chainA.QueryProof(channelKey)
err := suite.chainB.App.IBCKeeper.ChannelKeeper.ChanCloseConfirm(

View File

@ -58,7 +58,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger {
// GetChannel returns a channel with a particular identifier binded to a specific port
func (k Keeper) GetChannel(ctx sdk.Context, portID, channelID string) (types.Channel, bool) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(host.KeyChannel(portID, channelID))
bz := store.Get(host.ChannelKey(portID, channelID))
if bz == nil {
return types.Channel{}, false
}
@ -72,13 +72,13 @@ func (k Keeper) GetChannel(ctx sdk.Context, portID, channelID string) (types.Cha
func (k Keeper) SetChannel(ctx sdk.Context, portID, channelID string, channel types.Channel) {
store := ctx.KVStore(k.storeKey)
bz := k.cdc.MustMarshalBinaryBare(&channel)
store.Set(host.KeyChannel(portID, channelID), bz)
store.Set(host.ChannelKey(portID, channelID), bz)
}
// GetNextSequenceSend gets a channel's next send sequence from the store
func (k Keeper) GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(host.KeyNextSequenceSend(portID, channelID))
bz := store.Get(host.NextSequenceSendKey(portID, channelID))
if bz == nil {
return 0, false
}
@ -90,13 +90,13 @@ func (k Keeper) GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (
func (k Keeper) SetNextSequenceSend(ctx sdk.Context, portID, channelID string, sequence uint64) {
store := ctx.KVStore(k.storeKey)
bz := sdk.Uint64ToBigEndian(sequence)
store.Set(host.KeyNextSequenceSend(portID, channelID), bz)
store.Set(host.NextSequenceSendKey(portID, channelID), bz)
}
// GetNextSequenceRecv gets a channel's next receive sequence from the store
func (k Keeper) GetNextSequenceRecv(ctx sdk.Context, portID, channelID string) (uint64, bool) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(host.KeyNextSequenceRecv(portID, channelID))
bz := store.Get(host.NextSequenceRecvKey(portID, channelID))
if bz == nil {
return 0, false
}
@ -108,13 +108,13 @@ func (k Keeper) GetNextSequenceRecv(ctx sdk.Context, portID, channelID string) (
func (k Keeper) SetNextSequenceRecv(ctx sdk.Context, portID, channelID string, sequence uint64) {
store := ctx.KVStore(k.storeKey)
bz := sdk.Uint64ToBigEndian(sequence)
store.Set(host.KeyNextSequenceRecv(portID, channelID), bz)
store.Set(host.NextSequenceRecvKey(portID, channelID), bz)
}
// GetNextSequenceAck gets a channel's next ack sequence from the store
func (k Keeper) GetNextSequenceAck(ctx sdk.Context, portID, channelID string) (uint64, bool) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(host.KeyNextSequenceAck(portID, channelID))
bz := store.Get(host.NextSequenceAckKey(portID, channelID))
if bz == nil {
return 0, false
}
@ -126,13 +126,13 @@ func (k Keeper) GetNextSequenceAck(ctx sdk.Context, portID, channelID string) (u
func (k Keeper) SetNextSequenceAck(ctx sdk.Context, portID, channelID string, sequence uint64) {
store := ctx.KVStore(k.storeKey)
bz := sdk.Uint64ToBigEndian(sequence)
store.Set(host.KeyNextSequenceAck(portID, channelID), bz)
store.Set(host.NextSequenceAckKey(portID, channelID), bz)
}
// GetPacketReceipt gets a packet receipt from the store
func (k Keeper) GetPacketReceipt(ctx sdk.Context, portID, channelID string, sequence uint64) (string, bool) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(host.KeyPacketReceipt(portID, channelID, sequence))
bz := store.Get(host.PacketReceiptKey(portID, channelID, sequence))
if bz == nil {
return "", false
}
@ -143,43 +143,43 @@ func (k Keeper) GetPacketReceipt(ctx sdk.Context, portID, channelID string, sequ
// SetPacketReceipt sets an empty packet receipt to the store
func (k Keeper) SetPacketReceipt(ctx sdk.Context, portID, channelID string, sequence uint64) {
store := ctx.KVStore(k.storeKey)
store.Set(host.KeyPacketReceipt(portID, channelID, sequence), []byte(""))
store.Set(host.PacketReceiptKey(portID, channelID, sequence), []byte(""))
}
// GetPacketCommitment gets the packet commitment hash from the store
func (k Keeper) GetPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64) []byte {
store := ctx.KVStore(k.storeKey)
bz := store.Get(host.KeyPacketCommitment(portID, channelID, sequence))
bz := store.Get(host.PacketCommitmentKey(portID, channelID, sequence))
return bz
}
// HasPacketCommitment returns true if the packet commitment exists
func (k Keeper) HasPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64) bool {
store := ctx.KVStore(k.storeKey)
return store.Has(host.KeyPacketCommitment(portID, channelID, sequence))
return store.Has(host.PacketCommitmentKey(portID, channelID, sequence))
}
// SetPacketCommitment sets the packet commitment hash to the store
func (k Keeper) SetPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64, commitmentHash []byte) {
store := ctx.KVStore(k.storeKey)
store.Set(host.KeyPacketCommitment(portID, channelID, sequence), commitmentHash)
store.Set(host.PacketCommitmentKey(portID, channelID, sequence), commitmentHash)
}
func (k Keeper) deletePacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64) {
store := ctx.KVStore(k.storeKey)
store.Delete(host.KeyPacketCommitment(portID, channelID, sequence))
store.Delete(host.PacketCommitmentKey(portID, channelID, sequence))
}
// SetPacketAcknowledgement sets the packet ack hash to the store
func (k Keeper) SetPacketAcknowledgement(ctx sdk.Context, portID, channelID string, sequence uint64, ackHash []byte) {
store := ctx.KVStore(k.storeKey)
store.Set(host.KeyPacketAcknowledgement(portID, channelID, sequence), ackHash)
store.Set(host.PacketAcknowledgementKey(portID, channelID, sequence), ackHash)
}
// GetPacketAcknowledgement gets the packet ack hash from the store
func (k Keeper) GetPacketAcknowledgement(ctx sdk.Context, portID, channelID string, sequence uint64) ([]byte, bool) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(host.KeyPacketAcknowledgement(portID, channelID, sequence))
bz := store.Get(host.PacketAcknowledgementKey(portID, channelID, sequence))
if bz == nil {
return nil, false
}
@ -189,7 +189,7 @@ func (k Keeper) GetPacketAcknowledgement(ctx sdk.Context, portID, channelID stri
// HasPacketAcknowledgement check if the packet ack hash is already on the store
func (k Keeper) HasPacketAcknowledgement(ctx sdk.Context, portID, channelID string, sequence uint64) bool {
store := ctx.KVStore(k.storeKey)
return store.Has(host.KeyPacketAcknowledgement(portID, channelID, sequence))
return store.Has(host.PacketAcknowledgementKey(portID, channelID, sequence))
}
// IteratePacketSequence provides an iterator over all send, receive or ack sequences.
@ -330,7 +330,7 @@ func (k Keeper) GetAllPacketAcks(ctx sdk.Context) (acks []types.PacketState) {
// and stop.
func (k Keeper) IterateChannels(ctx sdk.Context, cb func(types.IdentifiedChannel) bool) {
store := ctx.KVStore(k.storeKey)
iterator := sdk.KVStorePrefixIterator(store, []byte(host.KeyChannelPrefix))
iterator := sdk.KVStorePrefixIterator(store, []byte(host.KeyChannelEndPrefix))
defer iterator.Close()
for ; iterator.Valid(); iterator.Next() {

View File

@ -30,6 +30,9 @@ func (suite *KeeperTestSuite) SetupTest() {
suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2)
suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0))
suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1))
// commit some blocks so that QueryProof returns valid proof (cannot return valid query if height <= 1)
suite.coordinator.CommitNBlocks(suite.chainA, 2)
suite.coordinator.CommitNBlocks(suite.chainB, 2)
}
// TestSetChannel create clients and connections on both chains. It tests for the non-existence

View File

@ -345,7 +345,7 @@ func (suite *KeeperTestSuite) TestRecvPacket() {
tc.malleate()
// get proof of packet commitment from chainA
packetKey := host.KeyPacketCommitment(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
packetKey := host.PacketCommitmentKey(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
proof, proofHeight := suite.chainA.QueryProof(packetKey)
err := suite.chainB.App.IBCKeeper.ChannelKeeper.RecvPacket(suite.chainB.GetContext(), channelCap, packet, proof, proofHeight)
@ -622,7 +622,7 @@ func (suite *KeeperTestSuite) TestAcknowledgePacket() {
suite.SetupTest() // reset
tc.malleate()
packetKey := host.KeyPacketAcknowledgement(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
packetKey := host.PacketAcknowledgementKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
proof, proofHeight := suite.chainB.QueryProof(packetKey)
err := suite.chainA.App.IBCKeeper.ChannelKeeper.AcknowledgePacket(suite.chainA.GetContext(), channelCap, packet, ack, proof, proofHeight)

View File

@ -125,8 +125,8 @@ func (suite *KeeperTestSuite) TestTimeoutPacket() {
nextSeqRecv = 1 // must be explicitly changed
tc.malleate()
orderedPacketKey := host.KeyNextSequenceRecv(packet.GetDestPort(), packet.GetDestChannel())
unorderedPacketKey := host.KeyPacketReceipt(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
orderedPacketKey := host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel())
unorderedPacketKey := host.PacketReceiptKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
if ordered {
proof, proofHeight = suite.chainB.QueryProof(orderedPacketKey)
@ -326,9 +326,9 @@ func (suite *KeeperTestSuite) TestTimeoutOnClose() {
nextSeqRecv = 1 // must be explicitly changed
tc.malleate()
channelKey := host.KeyChannel(packet.GetDestPort(), packet.GetDestChannel())
unorderedPacketKey := host.KeyPacketReceipt(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
orderedPacketKey := host.KeyNextSequenceRecv(packet.GetDestPort(), packet.GetDestChannel())
channelKey := host.ChannelKey(packet.GetDestPort(), packet.GetDestChannel())
unorderedPacketKey := host.PacketReceiptKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
orderedPacketKey := host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel())
proofClosed, proofHeight := suite.chainB.QueryProof(channelKey)

View File

@ -15,7 +15,7 @@ import (
// Value to the corresponding channel type.
func NewDecodeStore(cdc codec.BinaryMarshaler, kvA, kvB kv.Pair) (string, bool) {
switch {
case bytes.HasPrefix(kvA.Key, []byte(host.KeyChannelPrefix)):
case bytes.HasPrefix(kvA.Key, []byte(host.KeyChannelEndPrefix)):
var channelA, channelB types.Channel
cdc.MustUnmarshalBinaryBare(kvA.Value, &channelA)
cdc.MustUnmarshalBinaryBare(kvB.Value, &channelB)

View File

@ -31,27 +31,27 @@ func TestDecodeStore(t *testing.T) {
kvPairs := kv.Pairs{
Pairs: []kv.Pair{
{
Key: host.KeyChannel(portID, channelID),
Key: host.ChannelKey(portID, channelID),
Value: cdc.MustMarshalBinaryBare(&channel),
},
{
Key: host.KeyNextSequenceSend(portID, channelID),
Key: host.NextSequenceSendKey(portID, channelID),
Value: sdk.Uint64ToBigEndian(1),
},
{
Key: host.KeyNextSequenceRecv(portID, channelID),
Key: host.NextSequenceRecvKey(portID, channelID),
Value: sdk.Uint64ToBigEndian(1),
},
{
Key: host.KeyNextSequenceAck(portID, channelID),
Key: host.NextSequenceAckKey(portID, channelID),
Value: sdk.Uint64ToBigEndian(1),
},
{
Key: host.KeyPacketCommitment(portID, channelID, 1),
Key: host.PacketCommitmentKey(portID, channelID, 1),
Value: bz,
},
{
Key: host.KeyPacketAcknowledgement(portID, channelID, 1),
Key: host.PacketAcknowledgementKey(portID, channelID, 1),
Value: bz,
},
{

View File

@ -93,9 +93,10 @@ func (suite *TypesTestSuite) SetupTest() {
Prove: true,
})
merkleProof := commitmenttypes.MerkleProof{Proof: res.ProofOps}
merkleProof, err := commitmenttypes.ConvertProofs(res.ProofOps)
suite.Require().NoError(err)
proof, err := app.AppCodec().MarshalBinaryBare(&merkleProof)
suite.NoError(err)
suite.Require().NoError(err)
suite.proof = proof
}

View File

@ -1699,100 +1699,100 @@ func init() {
func init() { proto.RegisterFile("ibc/core/channel/v1/query.proto", fileDescriptor_1034a1e9abc4cca1) }
var fileDescriptor_1034a1e9abc4cca1 = []byte{
// 1488 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcf, 0x6f, 0x13, 0xc7,
0x17, 0xcf, 0x38, 0x01, 0x92, 0xc7, 0xef, 0x49, 0x02, 0x61, 0x09, 0x4e, 0xf0, 0x57, 0x7c, 0x1b,
0x90, 0xd8, 0x21, 0x81, 0xd2, 0xa8, 0x6a, 0x91, 0x48, 0xa4, 0x42, 0xaa, 0xf2, 0x6b, 0x29, 0x2a,
0x20, 0xb5, 0xee, 0x7a, 0x3d, 0x38, 0xab, 0x24, 0xbb, 0xc6, 0xbb, 0x36, 0x41, 0xa9, 0xab, 0xaa,
0x95, 0x80, 0x53, 0x55, 0x89, 0x43, 0xa5, 0x5e, 0x2a, 0x55, 0xbd, 0x70, 0xec, 0x5f, 0xd0, 0x2b,
0xb7, 0x22, 0xd1, 0x43, 0x25, 0x24, 0x5a, 0x91, 0x4a, 0xf4, 0xda, 0x4b, 0xcf, 0xd5, 0xce, 0xbc,
0x5d, 0xef, 0xda, 0xbb, 0x9b, 0x38, 0x8e, 0xa5, 0xa8, 0xa7, 0x78, 0x67, 0xe7, 0xbd, 0xf9, 0x7c,
0x3e, 0x6f, 0xde, 0xf3, 0x7b, 0x0e, 0x8c, 0x99, 0x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9b, 0x5e, 0x28, 0xc4, 0x25, 0xa1, 0xc3, 0x3b, 0xf4, 0x6c, 0xa7, 0x3a, 0xc4, 0x2e,
0xf3, 0xa7, 0xb4, 0xfb, 0x4f, 0xf2, 0xe4, 0xc1, 0x93, 0x3c, 0x79, 0xfc, 0x24, 0x4f, 0xbe, 0x78,
0x9a, 0xef, 0x79, 0xf0, 0x34, 0xdf, 0xf3, 0xf0, 0x69, 0xbe, 0xe7, 0xea, 0x89, 0x8a, 0xe9, 0xce,
0xd6, 0x4b, 0xaa, 0x61, 0x2f, 0x30, 0xfc, 0xaf, 0xa0, 0xfc, 0x73, 0xd8, 0x29, 0xcf, 0xb1, 0xa5,
0x10, 0xc6, 0x91, 0x63, 0x87, 0x7d, 0x24, 0xee, 0x72, 0x95, 0x3b, 0xa5, 0x8d, 0xe2, 0x47, 0xdc,
0xa3, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x48, 0x61, 0x15, 0x26, 0xa4, 0x1c, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

View File

@ -1736,31 +1736,31 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
var (
pattern_Query_Channel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"ibc", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Channel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"ibc", "core", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Channels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ibc", "channel", "v1beta1", "channels"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Channels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"ibc", "core", "channel", "v1beta1", "channels"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ConnectionChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"ibc", "channel", "v1beta1", "connections", "connection", "channels"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ConnectionChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"ibc", "core", "channel", "v1beta1", "connections", "connection", "channels"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ChannelClientState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"ibc", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "client_state"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ChannelClientState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8}, []string{"ibc", "core", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "client_state"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ChannelConsensusState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 2, 8, 1, 0, 4, 1, 5, 9, 2, 10, 1, 0, 4, 1, 5, 11}, []string{"ibc", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "consensus_state", "version", "version_number", "height", "version_height"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_ChannelConsensusState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8, 2, 9, 1, 0, 4, 1, 5, 10, 2, 11, 1, 0, 4, 1, 5, 12}, []string{"ibc", "core", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "consensus_state", "version", "version_number", "height", "version_height"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_PacketCommitment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"ibc", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_commitments", "sequence"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_PacketCommitment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8, 1, 0, 4, 1, 5, 9}, []string{"ibc", "core", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_commitments", "sequence"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_PacketCommitments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"ibc", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_commitments"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_PacketCommitments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8}, []string{"ibc", "core", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_commitments"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_PacketReceipt_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"ibc", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_receipts", "sequence"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_PacketReceipt_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8, 1, 0, 4, 1, 5, 9}, []string{"ibc", "core", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_receipts", "sequence"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_PacketAcknowledgement_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"ibc", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_acks", "sequence"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_PacketAcknowledgement_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8, 1, 0, 4, 1, 5, 9}, []string{"ibc", "core", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_acks", "sequence"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_PacketAcknowledgements_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"ibc", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_acknowledgements"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_PacketAcknowledgements_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8}, []string{"ibc", "core", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_acknowledgements"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_UnreceivedPackets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9}, []string{"ibc", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_commitments", "packet_commitment_sequences", "unreceived_packets"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_UnreceivedPackets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8, 1, 0, 4, 1, 5, 9, 2, 10}, []string{"ibc", "core", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_commitments", "packet_commitment_sequences", "unreceived_packets"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_UnreceivedAcks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9}, []string{"ibc", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_commitments", "packet_ack_sequences", "unreceived_acks"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_UnreceivedAcks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8, 1, 0, 4, 1, 5, 9, 2, 10}, []string{"ibc", "core", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "packet_commitments", "packet_ack_sequences", "unreceived_acks"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_NextSequenceReceive_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"ibc", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "next_sequence"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_NextSequenceReceive_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 2, 8}, []string{"ibc", "core", "channel", "v1beta1", "channels", "channel_id", "ports", "port_id", "next_sequence"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (

View File

@ -5,9 +5,9 @@ package types
import (
fmt "fmt"
_go "github.com/confio/ics23/go"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
crypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
io "io"
math "math"
math_bits "math/bits"
@ -24,34 +24,6 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// KeyEncoding defines the encoding format of a key's bytes.
type KeyEncoding int32
const (
// URL encoding
URL KeyEncoding = 0
// Hex encoding
HEX KeyEncoding = 1
)
var KeyEncoding_name = map[int32]string{
0: "KEY_ENCODING_URL_UNSPECIFIED",
1: "KEY_ENCODING_HEX",
}
var KeyEncoding_value = map[string]int32{
"KEY_ENCODING_URL_UNSPECIFIED": 0,
"KEY_ENCODING_HEX": 1,
}
func (x KeyEncoding) String() string {
return proto.EnumName(KeyEncoding_name, int32(x))
}
func (KeyEncoding) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_7921d88972a41469, []int{0}
}
// MerkleRoot defines a merkle root hash.
// In the Cosmos SDK, the AppHash of a block header becomes the root.
type MerkleRoot struct {
@ -140,8 +112,9 @@ func (m *MerklePrefix) GetKeyPrefix() []byte {
// MerklePath is the path used to verify commitment proofs, which can be an
// arbitrary structured object (defined by a commitment type).
// MerklePath is represented from root-to-leaf
type MerklePath struct {
KeyPath KeyPath `protobuf:"bytes,1,opt,name=key_path,json=keyPath,proto3" json:"key_path" yaml:"key_path"`
KeyPath []string `protobuf:"bytes,1,rep,name=key_path,json=keyPath,proto3" json:"key_path,omitempty" yaml:"key_path"`
}
func (m *MerklePath) Reset() { *m = MerklePath{} }
@ -176,19 +149,20 @@ func (m *MerklePath) XXX_DiscardUnknown() {
var xxx_messageInfo_MerklePath proto.InternalMessageInfo
func (m *MerklePath) GetKeyPath() KeyPath {
func (m *MerklePath) GetKeyPath() []string {
if m != nil {
return m.KeyPath
}
return KeyPath{}
return nil
}
// MerkleProof is a wrapper type that contains a merkle proof.
// MerkleProof is a wrapper type over a chain of CommitmentProofs.
// It demonstrates membership or non-membership for an element or set of
// elements, verifiable in conjunction with a known commitment root. Proofs
// should be succinct.
// MerkleProofs are ordered from leaf-to-root
type MerkleProof struct {
Proof *crypto.ProofOps `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"`
Proofs []*_go.CommitmentProof `protobuf:"bytes,1,rep,name=proofs,proto3" json:"proofs,omitempty"`
}
func (m *MerkleProof) Reset() { *m = MerkleProof{} }
@ -224,97 +198,18 @@ func (m *MerkleProof) XXX_DiscardUnknown() {
var xxx_messageInfo_MerkleProof proto.InternalMessageInfo
func (m *MerkleProof) GetProof() *crypto.ProofOps {
func (m *MerkleProof) GetProofs() []*_go.CommitmentProof {
if m != nil {
return m.Proof
return m.Proofs
}
return nil
}
// KeyPath defines a slice of keys
type KeyPath struct {
Keys []*Key `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
}
func (m *KeyPath) Reset() { *m = KeyPath{} }
func (*KeyPath) ProtoMessage() {}
func (*KeyPath) Descriptor() ([]byte, []int) {
return fileDescriptor_7921d88972a41469, []int{4}
}
func (m *KeyPath) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *KeyPath) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_KeyPath.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *KeyPath) XXX_Merge(src proto.Message) {
xxx_messageInfo_KeyPath.Merge(m, src)
}
func (m *KeyPath) XXX_Size() int {
return m.Size()
}
func (m *KeyPath) XXX_DiscardUnknown() {
xxx_messageInfo_KeyPath.DiscardUnknown(m)
}
var xxx_messageInfo_KeyPath proto.InternalMessageInfo
// Key defines a proof Key
type Key struct {
Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Enc KeyEncoding `protobuf:"varint,2,opt,name=enc,proto3,enum=ibc.core.commitment.v1.KeyEncoding" json:"enc,omitempty"`
}
func (m *Key) Reset() { *m = Key{} }
func (m *Key) String() string { return proto.CompactTextString(m) }
func (*Key) ProtoMessage() {}
func (*Key) Descriptor() ([]byte, []int) {
return fileDescriptor_7921d88972a41469, []int{5}
}
func (m *Key) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Key) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Key.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Key) XXX_Merge(src proto.Message) {
xxx_messageInfo_Key.Merge(m, src)
}
func (m *Key) XXX_Size() int {
return m.Size()
}
func (m *Key) XXX_DiscardUnknown() {
xxx_messageInfo_Key.DiscardUnknown(m)
}
var xxx_messageInfo_Key proto.InternalMessageInfo
func init() {
proto.RegisterEnum("ibc.core.commitment.v1.KeyEncoding", KeyEncoding_name, KeyEncoding_value)
proto.RegisterType((*MerkleRoot)(nil), "ibc.core.commitment.v1.MerkleRoot")
proto.RegisterType((*MerklePrefix)(nil), "ibc.core.commitment.v1.MerklePrefix")
proto.RegisterType((*MerklePath)(nil), "ibc.core.commitment.v1.MerklePath")
proto.RegisterType((*MerkleProof)(nil), "ibc.core.commitment.v1.MerkleProof")
proto.RegisterType((*KeyPath)(nil), "ibc.core.commitment.v1.KeyPath")
proto.RegisterType((*Key)(nil), "ibc.core.commitment.v1.Key")
}
func init() {
@ -322,39 +217,28 @@ func init() {
}
var fileDescriptor_7921d88972a41469 = []byte{
// 499 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x4f, 0x6f, 0xd3, 0x30,
0x18, 0xc6, 0x13, 0x5a, 0xe8, 0x70, 0x27, 0x28, 0x16, 0x7f, 0xaa, 0xc2, 0x92, 0x2a, 0x48, 0x30,
0x90, 0x16, 0xab, 0x1d, 0x5c, 0xca, 0x05, 0x75, 0x0d, 0xac, 0xea, 0xe8, 0x2a, 0x4f, 0x45, 0x03,
0x09, 0x55, 0x69, 0xea, 0x26, 0x51, 0x96, 0x38, 0x4a, 0xcc, 0xb4, 0x7c, 0x83, 0x89, 0x13, 0x47,
0x2e, 0x48, 0x48, 0x7c, 0x99, 0x1d, 0x77, 0xe4, 0x54, 0xa1, 0xf6, 0x1b, 0xec, 0x13, 0x20, 0xdb,
0x2d, 0x0b, 0x12, 0x70, 0xca, 0x6b, 0xbd, 0xbf, 0x37, 0xcf, 0xe3, 0xc7, 0x2f, 0x78, 0xec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, 0x95,
0x4e, 0x02, 0x74, 0x82, 0x7e, 0x2f, 0x71, 0x73, 0x7b, 0x2b, 0xb7, 0xc7, 0x2c, 0x8b, 0x49, 0x3a,
0xbe, 0x26, 0x76, 0x6e, 0xfb, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x78, 0x4b, 0x97, 0xeb,
0x02, 0x00, 0x00,
// 334 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x91, 0xcf, 0x4e, 0xfa, 0x40,
0x10, 0xc7, 0xdb, 0xfc, 0x08, 0x3f, 0x59, 0x48, 0x8c, 0x45, 0x89, 0xe1, 0x50, 0x4c, 0x0f, 0xca,
0x85, 0xdd, 0x00, 0x9e, 0x30, 0x5e, 0xaa, 0x57, 0x13, 0xd2, 0xc4, 0x8b, 0x17, 0xd3, 0xae, 0x5b,
0xba, 0x29, 0x65, 0x9a, 0xee, 0x4a, 0xe8, 0x1b, 0x78, 0xf4, 0xe8, 0xd1, 0xc7, 0xf1, 0xc8, 0xd1,
0x13, 0x31, 0xf0, 0x06, 0x3c, 0x81, 0xe9, 0x2e, 0x60, 0x4f, 0x3b, 0xb3, 0xf3, 0x99, 0x7f, 0xdf,
0x41, 0x57, 0x3c, 0xa0, 0x84, 0x42, 0xc6, 0x08, 0x85, 0x24, 0xe1, 0x32, 0x61, 0x33, 0x49, 0xe6,
0xfd, 0x92, 0x87, 0xd3, 0x0c, 0x24, 0x58, 0x2d, 0x1e, 0x50, 0x5c, 0x80, 0xb8, 0x14, 0x9a, 0xf7,
0xdb, 0xa7, 0x13, 0x98, 0x80, 0x42, 0x48, 0x61, 0x69, 0xba, 0xdd, 0xa4, 0x30, 0x0b, 0x39, 0x90,
0x34, 0x03, 0x08, 0x85, 0xfe, 0x74, 0x2e, 0x11, 0x7a, 0x60, 0x59, 0x3c, 0x65, 0x1e, 0x80, 0xb4,
0x2c, 0x54, 0x89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 0x01, 0x00, 0x00,
}
func (m *MerkleRoot) Marshal() (dAtA []byte, err error) {
@ -437,16 +321,15 @@ func (m *MerklePath) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
{
size, err := m.KeyPath.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
if len(m.KeyPath) > 0 {
for iNdEx := len(m.KeyPath) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.KeyPath[iNdEx])
copy(dAtA[i:], m.KeyPath[iNdEx])
i = encodeVarintCommitment(dAtA, i, uint64(len(m.KeyPath[iNdEx])))
i--
dAtA[i] = 0xa
}
i -= size
i = encodeVarintCommitment(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
@ -470,45 +353,10 @@ func (m *MerkleProof) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.Proof != nil {
{
size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintCommitment(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *KeyPath) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *KeyPath) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *KeyPath) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Keys) > 0 {
for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- {
if len(m.Proofs) > 0 {
for iNdEx := len(m.Proofs) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Keys[iNdEx].MarshalToSizedBuffer(dAtA[:i])
size, err := m.Proofs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@ -522,41 +370,6 @@ func (m *KeyPath) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *Key) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Key) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Key) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Enc != 0 {
i = encodeVarintCommitment(dAtA, i, uint64(m.Enc))
i--
dAtA[i] = 0x10
}
if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintCommitment(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintCommitment(dAtA []byte, offset int, v uint64) int {
offset -= sovCommitment(v)
base := offset
@ -600,8 +413,12 @@ func (m *MerklePath) Size() (n int) {
}
var l int
_ = l
l = m.KeyPath.Size()
n += 1 + l + sovCommitment(uint64(l))
if len(m.KeyPath) > 0 {
for _, s := range m.KeyPath {
l = len(s)
n += 1 + l + sovCommitment(uint64(l))
}
}
return n
}
@ -611,21 +428,8 @@ func (m *MerkleProof) Size() (n int) {
}
var l int
_ = l
if m.Proof != nil {
l = m.Proof.Size()
n += 1 + l + sovCommitment(uint64(l))
}
return n
}
func (m *KeyPath) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Keys) > 0 {
for _, e := range m.Keys {
if len(m.Proofs) > 0 {
for _, e := range m.Proofs {
l = e.Size()
n += 1 + l + sovCommitment(uint64(l))
}
@ -633,22 +437,6 @@ func (m *KeyPath) Size() (n int) {
return n
}
func (m *Key) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Name)
if l > 0 {
n += 1 + l + sovCommitment(uint64(l))
}
if m.Enc != 0 {
n += 1 + sovCommitment(uint64(m.Enc))
}
return n
}
func sovCommitment(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@ -862,7 +650,7 @@ func (m *MerklePath) Unmarshal(dAtA []byte) error {
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field KeyPath", wireType)
}
var msglen int
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCommitment
@ -872,24 +660,23 @@ func (m *MerklePath) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthCommitment
}
postIndex := iNdEx + msglen
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthCommitment
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.KeyPath.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
m.KeyPath = append(m.KeyPath, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
@ -946,7 +733,7 @@ func (m *MerkleProof) Unmarshal(dAtA []byte) error {
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field Proofs", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@ -973,10 +760,8 @@ func (m *MerkleProof) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Proof == nil {
m.Proof = &crypto.ProofOps{}
}
if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
m.Proofs = append(m.Proofs, &_go.CommitmentProof{})
if err := m.Proofs[len(m.Proofs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@ -1004,199 +789,6 @@ func (m *MerkleProof) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *KeyPath) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCommitment
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: KeyPath: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: KeyPath: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCommitment
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthCommitment
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthCommitment
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Keys = append(m.Keys, &Key{})
if err := m.Keys[len(m.Keys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipCommitment(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthCommitment
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthCommitment
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Key) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCommitment
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Key: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Key: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCommitment
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthCommitment
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthCommitment
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...)
if m.Name == nil {
m.Name = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Enc", wireType)
}
m.Enc = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCommitment
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Enc |= KeyEncoding(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipCommitment(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthCommitment
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthCommitment
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipCommitment(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0

View File

@ -1,40 +0,0 @@
package types
import (
fmt "fmt"
"net/url"
)
// AppendKey appends a new key to a KeyPath
func (pth KeyPath) AppendKey(key []byte, enc KeyEncoding) KeyPath {
pth.Keys = append(pth.Keys, &Key{Name: key, Enc: enc})
return pth
}
// String implements the fmt.Stringer interface
func (pth *KeyPath) String() string {
res := ""
for _, key := range pth.Keys {
switch key.Enc {
case URL:
res += "/" + url.PathEscape(string(key.Name))
case HEX:
res += "/x:" + fmt.Sprintf("%X", key.Name)
default:
panic("unexpected key encoding type")
}
}
return res
}
// GetKey returns the bytes representation of key at given index
// Passing in a positive index return the key at index in forward order
// from the highest key to the lowest key
// Passing in a negative index will return the key at index in reverse order
// from the lowest key to the highest key. This is the order for proof verification,
// since we prove lowest key first before moving to key of higher subtrees
func (pth *KeyPath) GetKey(i int) []byte {
total := len(pth.Keys)
index := (total + i) % total
return pth.Keys[index].Name
}

View File

@ -2,6 +2,7 @@ package types
import (
"bytes"
"fmt"
"net/url"
ics23 "github.com/confio/ics23/go"
@ -9,7 +10,6 @@ import (
tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
host "github.com/cosmos/cosmos-sdk/x/ibc/core/24-host"
"github.com/cosmos/cosmos-sdk/x/ibc/core/exported"
)
@ -68,51 +68,62 @@ func (mp MerklePrefix) Empty() bool {
var _ exported.Path = (*MerklePath)(nil)
// NewMerklePath creates a new MerklePath instance
func NewMerklePath(keyPathStr []string) MerklePath {
merkleKeyPath := KeyPath{}
for _, keyStr := range keyPathStr {
merkleKeyPath = merkleKeyPath.AppendKey([]byte(keyStr), URL)
}
// The keys must be passed in from root-to-leaf order
func NewMerklePath(keyPath ...string) MerklePath {
return MerklePath{
KeyPath: merkleKeyPath,
KeyPath: keyPath,
}
}
// String implements fmt.Stringer.
// This represents the path in the same way the tendermint KeyPath will
// represent a key path. The backslashes partition the key path into
// the respective stores they belong to.
func (mp MerklePath) String() string {
return mp.KeyPath.String()
pathStr := ""
for _, k := range mp.KeyPath {
pathStr += "/" + url.PathEscape(k)
}
return pathStr
}
// Pretty returns the unescaped path of the URL string.
// This function will unescape any backslash within a particular store key.
// This makes the keypath more human-readable while removing information
// about the exact partitions in the key path.
func (mp MerklePath) Pretty() string {
path, err := url.PathUnescape(mp.KeyPath.String())
path, err := url.PathUnescape(mp.String())
if err != nil {
panic(err)
}
return path
}
// Empty returns true if the path is empty
func (mp MerklePath) Empty() bool {
return len(mp.KeyPath.Keys) == 0
// GetKey will return a byte representation of the key
// after URL escaping the key element
func (mp MerklePath) GetKey(i uint64) ([]byte, error) {
if i >= uint64(len(mp.KeyPath)) {
return nil, fmt.Errorf("index out of range. %d (index) >= %d (len)", i, len(mp.KeyPath))
}
key, err := url.PathUnescape(mp.KeyPath[i])
if err != nil {
return nil, err
}
return []byte(key), nil
}
// ApplyPrefix constructs a new commitment path from the arguments. It interprets
// the path argument in the context of the prefix argument.
//
// CONTRACT: provided path string MUST be a well formated path. See ICS24 for
// reference.
func ApplyPrefix(prefix exported.Prefix, path string) (MerklePath, error) {
err := host.PathValidator(path)
if err != nil {
return MerklePath{}, err
}
// Empty returns true if the path is empty
func (mp MerklePath) Empty() bool {
return len(mp.KeyPath) == 0
}
// ApplyPrefix constructs a new commitment path from the arguments. It prepends the prefix key
// with the given path.
func ApplyPrefix(prefix exported.Prefix, path MerklePath) (MerklePath, error) {
if prefix == nil || prefix.Empty() {
return MerklePath{}, sdkerrors.Wrap(ErrInvalidPrefix, "prefix can't be empty")
}
return NewMerklePath([]string{string(prefix.Bytes()), path}), nil
return NewMerklePath(append([]string{string(prefix.Bytes())}, path.KeyPath...)...), nil
}
var _ exported.Proof = (*MerkleProof)(nil)
@ -128,22 +139,17 @@ func (proof MerkleProof) VerifyMembership(specs []*ics23.ProofSpec, root exporte
if !ok {
return sdkerrors.Wrapf(ErrInvalidProof, "path %v is not of type MerklePath", path)
}
if len(mpath.KeyPath.Keys) != len(specs) {
if len(mpath.KeyPath) != len(specs) {
return sdkerrors.Wrapf(ErrInvalidProof, "path length %d not same as proof %d",
len(mpath.KeyPath.Keys), len(specs))
len(mpath.KeyPath), len(specs))
}
if len(value) == 0 {
return sdkerrors.Wrap(ErrInvalidProof, "empty value in membership proof")
}
// Convert Proof to []CommitmentProof
proofs, err := convertProofs(proof)
if err != nil {
return err
}
// Since every proof in chain is a membership proof we can chain from index 0
if err := verifyChainedMembershipProof(root.GetHash(), specs, proofs, mpath.KeyPath, value, 0); err != nil {
// Since every proof in chain is a membership proof we can use verifyChainedMembershipProof from index 0
// to validate entire proof
if err := verifyChainedMembershipProof(root.GetHash(), specs, proof.Proofs, mpath, value, 0); err != nil {
return err
}
return nil
@ -162,31 +168,37 @@ func (proof MerkleProof) VerifyNonMembership(specs []*ics23.ProofSpec, root expo
if !ok {
return sdkerrors.Wrapf(ErrInvalidProof, "path %v is not of type MerkleProof", path)
}
if len(mpath.KeyPath.Keys) != len(specs) {
if len(mpath.KeyPath) != len(specs) {
return sdkerrors.Wrapf(ErrInvalidProof, "path length %d not same as proof %d",
len(mpath.KeyPath.Keys), len(specs))
len(mpath.KeyPath), len(specs))
}
// Convert Proof to []CommitmentProof
proofs, err := convertProofs(proof)
if err != nil {
return err
}
switch proof.Proofs[0].Proof.(type) {
case *ics23.CommitmentProof_Nonexist:
// VerifyNonMembership will verify the absence of key in lowest subtree, and then chain inclusion proofs
// of all subroots up to final root
subroot, err := proof.Proofs[0].Calculate()
if err != nil {
return sdkerrors.Wrapf(ErrInvalidProof, "could not calculate root for proof index 0, merkle tree is likely empty. %v", err)
}
key, err := mpath.GetKey(uint64(len(mpath.KeyPath) - 1))
if err != nil {
return sdkerrors.Wrapf(ErrInvalidProof, "could not retrieve key bytes for key: %s", mpath.KeyPath[len(mpath.KeyPath)-1])
}
if ok := ics23.VerifyNonMembership(specs[0], subroot, proof.Proofs[0], key); !ok {
return sdkerrors.Wrapf(ErrInvalidProof, "could not verify absence of key %s. Please ensure that the path is correct.", string(key))
}
// VerifyNonMembership will verify the absence of key in lowest subtree, and then chain inclusion proofs
// of all subroots up to final root
subroot, err := proofs[0].Calculate()
if err != nil {
sdkerrors.Wrapf(ErrInvalidProof, "could not calculate root for proof index 0. %v", err)
}
key := mpath.KeyPath.GetKey(-1)
if ok := ics23.VerifyNonMembership(specs[0], subroot, proofs[0], key); !ok {
return sdkerrors.Wrapf(ErrInvalidProof, "could not verify absence of key %s", string(key))
}
// Verify chained membership proof starting from index 1 with value = subroot
if err := verifyChainedMembershipProof(root.GetHash(), specs, proofs, mpath.KeyPath, subroot, 1); err != nil {
return err
// Verify chained membership proof starting from index 1 with value = subroot
if err := verifyChainedMembershipProof(root.GetHash(), specs, proof.Proofs, mpath, subroot, 1); err != nil {
return err
}
case *ics23.CommitmentProof_Exist:
return sdkerrors.Wrapf(ErrInvalidProof,
"got ExistenceProof in VerifyNonMembership. If this is unexpected, please ensure that proof was queried with the correct key.")
default:
return sdkerrors.Wrapf(ErrInvalidProof,
"expected proof type: %T, got: %T", &ics23.CommitmentProof_Exist{}, proof.Proofs[0].Proof)
}
return nil
}
@ -208,7 +220,7 @@ func (proof MerkleProof) BatchVerifyNonMembership(specs []*ics23.ProofSpec, root
// The proofs and specs are passed in from lowest subtree to the highest subtree, but the keys are passed in from highest subtree to lowest.
// The index specifies what index to start chaining the membership proofs, this is useful since the lowest proof may not be a membership proof, thus we
// will want to start the membership proof chaining from index 1 with value being the lowest subroot
func verifyChainedMembershipProof(root []byte, specs []*ics23.ProofSpec, proofs []*ics23.CommitmentProof, keys KeyPath, value []byte, index int) error {
func verifyChainedMembershipProof(root []byte, specs []*ics23.ProofSpec, proofs []*ics23.CommitmentProof, keys MerklePath, value []byte, index int) error {
var (
subroot []byte
err error
@ -218,42 +230,45 @@ func verifyChainedMembershipProof(root []byte, specs []*ics23.ProofSpec, proofs
// In this case, there may be no intermediate proofs to verify and we just check that lowest proof root equals final root
subroot = value
for i := index; i < len(proofs); i++ {
subroot, err = proofs[i].Calculate()
if err != nil {
return sdkerrors.Wrapf(ErrInvalidProof, "could not calculate proof root at index %d. %v", i, err)
switch proofs[i].Proof.(type) {
case *ics23.CommitmentProof_Exist:
subroot, err = proofs[i].Calculate()
if err != nil {
return sdkerrors.Wrapf(ErrInvalidProof, "could not calculate proof root at index %d, merkle tree may be empty. %v", i, err)
}
// Since keys are passed in from highest to lowest, we must grab their indices in reverse order
// from the proofs and specs which are lowest to highest
key, err := keys.GetKey(uint64(len(keys.KeyPath) - 1 - i))
if err != nil {
return sdkerrors.Wrapf(ErrInvalidProof, "could not retrieve key bytes for key %s: %v", keys.KeyPath[len(keys.KeyPath)-1-i], err)
}
// verify membership of the proof at this index with appropriate key and value
if ok := ics23.VerifyMembership(specs[i], subroot, proofs[i], key, value); !ok {
return sdkerrors.Wrapf(ErrInvalidProof,
"chained membership proof failed to verify membership of value: %X in subroot %X at index %d. Please ensure the path and value are both correct.",
value, subroot, i)
}
// Set value to subroot so that we verify next proof in chain commits to this subroot
value = subroot
case *ics23.CommitmentProof_Nonexist:
return sdkerrors.Wrapf(ErrInvalidProof,
"chained membership proof contains nonexistence proof at index %d. If this is unexpected, please ensure that proof was queried from the height that contained the value in store and was queried with the correct key.",
i)
default:
return sdkerrors.Wrapf(ErrInvalidProof,
"expected proof type: %T, got: %T", &ics23.CommitmentProof_Exist{}, proofs[i].Proof)
}
// Since keys are passed in from highest to lowest, we must grab their indices in reverse order
// from the proofs and specs which are lowest to highest
key := keys.GetKey(-1 * (i + 1))
if ok := ics23.VerifyMembership(specs[i], subroot, proofs[i], key, value); !ok {
return sdkerrors.Wrapf(ErrInvalidProof, "chained membership proof failed to verify membership of value: %X in subroot %X at index %d for proof %v",
value, subroot, i, proofs[i])
}
// Set value to subroot so that we verify next proof in chain commits to this subroot
value = subroot
}
// Check that chained proof root equals passed-in root
if !bytes.Equal(root, subroot) {
return sdkerrors.Wrapf(ErrInvalidProof, "proof did not commit to expected root: %X, got: %X", root, subroot)
return sdkerrors.Wrapf(ErrInvalidProof,
"proof did not commit to expected root: %X, got: %X. Please ensure proof was submitted with correct proofHeight and to the correct chain.",
root, subroot)
}
return nil
}
// convertProofs converts a MerkleProof into []*ics23.CommitmentProof
func convertProofs(mproof MerkleProof) ([]*ics23.CommitmentProof, error) {
// Unmarshal all proof ops to CommitmentProof
proofs := make([]*ics23.CommitmentProof, len(mproof.Proof.Ops))
for i, op := range mproof.Proof.Ops {
var p ics23.CommitmentProof
err := p.Unmarshal(op.Data)
if err != nil {
return nil, sdkerrors.Wrapf(ErrInvalidMerkleProof, "could not unmarshal proof op into CommitmentProof at index: %d", i)
}
proofs[i] = &p
}
return proofs, nil
}
// Empty returns true if the root is empty
func (proof MerkleProof) Empty() bool {
return proto.Equal(&proof, nil) || proto.Equal(&proof, &MerkleProof{}) || proto.Equal(&proof, &tmcrypto.ProofOps{})
@ -277,10 +292,10 @@ func (proof MerkleProof) validateVerificationArgs(specs []*ics23.ProofSpec, root
return sdkerrors.Wrap(ErrInvalidMerkleProof, "root cannot be empty")
}
if len(specs) != len(proof.Proof.Ops) {
if len(specs) != len(proof.Proofs) {
return sdkerrors.Wrapf(ErrInvalidMerkleProof,
"length of specs: %d not equal to length of proof: %d",
len(specs), len(proof.Proof.Ops))
len(specs), len(proof.Proofs))
}
for i, spec := range specs {

View File

@ -6,8 +6,6 @@ import (
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
tmmerkle "github.com/tendermint/tendermint/proto/tendermint/crypto"
"github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types"
)
@ -23,9 +21,9 @@ func (suite *MerkleTestSuite) TestVerifyMembership() {
})
require.NotNil(suite.T(), res.ProofOps)
proof := types.MerkleProof{
Proof: res.ProofOps,
}
proof, err := types.ConvertProofs(res.ProofOps)
require.NoError(suite.T(), err)
suite.Require().NoError(proof.ValidateBasic())
suite.Require().Error(types.MerkleProof{}.ValidateBasic())
@ -49,9 +47,7 @@ func (suite *MerkleTestSuite) TestVerifyMembership() {
{"nil root", []byte(nil), []string{suite.storeKey.Name(), "MYKEY"}, []byte("MYVALUE"), func() {}, false}, // invalid proof with nil root
{"proof is wrong length", cid.Hash, []string{suite.storeKey.Name(), "MYKEY"}, []byte("MYVALUE"), func() {
proof = types.MerkleProof{
Proof: &tmmerkle.ProofOps{
Ops: res.ProofOps.Ops[1:],
},
Proofs: proof.Proofs[1:],
}
}, false}, // invalid proof with wrong length
@ -63,7 +59,7 @@ func (suite *MerkleTestSuite) TestVerifyMembership() {
tc.malleate()
root := types.NewMerkleRoot(tc.root)
path := types.NewMerklePath(tc.pathArr)
path := types.NewMerklePath(tc.pathArr...)
err := proof.VerifyMembership(types.GetSDKSpecs(), &root, path, tc.value)
@ -91,9 +87,9 @@ func (suite *MerkleTestSuite) TestVerifyNonMembership() {
})
require.NotNil(suite.T(), res.ProofOps)
proof := types.MerkleProof{
Proof: res.ProofOps,
}
proof, err := types.ConvertProofs(res.ProofOps)
require.NoError(suite.T(), err)
suite.Require().NoError(proof.ValidateBasic())
cases := []struct {
@ -114,9 +110,7 @@ func (suite *MerkleTestSuite) TestVerifyNonMembership() {
{"nil root", []byte(nil), []string{suite.storeKey.Name(), "MYABSENTKEY"}, func() {}, false}, // invalid proof with nil root
{"proof is wrong length", cid.Hash, []string{suite.storeKey.Name(), "MYKEY"}, func() {
proof = types.MerkleProof{
Proof: &tmcrypto.ProofOps{
Ops: res.ProofOps.Ops[1:],
},
Proofs: proof.Proofs[1:],
}
}, false}, // invalid proof with wrong length
@ -129,7 +123,7 @@ func (suite *MerkleTestSuite) TestVerifyNonMembership() {
tc.malleate()
root := types.NewMerkleRoot(tc.root)
path := types.NewMerklePath(tc.pathArr)
path := types.NewMerklePath(tc.pathArr...)
err := proof.VerifyNonMembership(types.GetSDKSpecs(), &root, path)
@ -149,16 +143,30 @@ func TestApplyPrefix(t *testing.T) {
prefix := types.NewMerklePrefix([]byte("storePrefixKey"))
pathStr := "pathone/pathtwo/paththree/key"
path := types.MerklePath{
KeyPath: []string{pathStr},
}
prefixedPath, err := types.ApplyPrefix(prefix, pathStr)
require.Nil(t, err, "valid prefix returns error")
prefixedPath, err := types.ApplyPrefix(prefix, path)
require.NoError(t, err, "valid prefix returns error")
require.Equal(t, "/storePrefixKey/"+pathStr, prefixedPath.Pretty(), "Prefixed path incorrect")
require.Equal(t, "/storePrefixKey/pathone%2Fpathtwo%2Fpaththree%2Fkey", prefixedPath.String(), "Prefixed scaped path incorrect")
// invalid prefix contains non-alphanumeric character
invalidPathStr := "invalid-path/doesitfail?/hopefully"
invalidPath, err := types.ApplyPrefix(prefix, invalidPathStr)
require.NotNil(t, err, "invalid prefix does not returns error")
require.Equal(t, types.MerklePath{}, invalidPath, "invalid prefix returns valid Path on ApplyPrefix")
require.Equal(t, "/storePrefixKey/pathone%2Fpathtwo%2Fpaththree%2Fkey", prefixedPath.String(), "Prefixed escaped path incorrect")
}
func TestString(t *testing.T) {
path := types.NewMerklePath("rootKey", "storeKey", "path/to/leaf")
require.Equal(t, "/rootKey/storeKey/path%2Fto%2Fleaf", path.String(), "path String returns unxpected value")
require.Equal(t, "/rootKey/storeKey/path/to/leaf", path.Pretty(), "path's pretty string representation is incorrect")
onePath := types.NewMerklePath("path/to/leaf")
require.Equal(t, "/path%2Fto%2Fleaf", onePath.String(), "one element path does not have correct string representation")
require.Equal(t, "/path/to/leaf", onePath.Pretty(), "one element path has incorrect pretty string representation")
zeroPath := types.NewMerklePath()
require.Equal(t, "", zeroPath.String(), "zero element path does not have correct string representation")
require.Equal(t, "", zeroPath.Pretty(), "zero element path does not have correct pretty string representation")
}

View File

@ -0,0 +1,27 @@
package types
import (
ics23 "github.com/confio/ics23/go"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
crypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
)
// ConvertProofs converts crypto.ProofOps into MerkleProof
func ConvertProofs(tmProof *crypto.ProofOps) (MerkleProof, error) {
if tmProof == nil {
return MerkleProof{}, sdkerrors.Wrapf(ErrInvalidMerkleProof, "tendermint proof is nil")
}
// Unmarshal all proof ops to CommitmentProof
proofs := make([]*ics23.CommitmentProof, len(tmProof.Ops))
for i, op := range tmProof.Ops {
var p ics23.CommitmentProof
err := p.Unmarshal(op.Data)
if err != nil || p.Proof == nil {
return MerkleProof{}, sdkerrors.Wrapf(ErrInvalidMerkleProof, "could not unmarshal proof op into CommitmentProof at index %d: %v", i, err)
}
proofs[i] = &p
}
return MerkleProof{
Proofs: proofs,
}, nil
}

View File

@ -0,0 +1,97 @@
package types_test
import (
"fmt"
"github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
crypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
)
func (suite *MerkleTestSuite) TestConvertProofs() {
suite.iavlStore.Set([]byte("MYKEY"), []byte("MYVALUE"))
cid := suite.store.Commit()
root := types.NewMerkleRoot(cid.Hash)
existsPath := types.NewMerklePath(suite.storeKey.Name(), "MYKEY")
nonexistPath := types.NewMerklePath(suite.storeKey.Name(), "NOTMYKEY")
value := []byte("MYVALUE")
var proofOps *crypto.ProofOps
testcases := []struct {
name string
malleate func()
keyExists bool
expPass bool
}{
{
"success for ExistenceProof",
func() {
res := suite.store.Query(abci.RequestQuery{
Path: fmt.Sprintf("/%s/key", suite.storeKey.Name()), // required path to get key/value+proof
Data: []byte("MYKEY"),
Prove: true,
})
require.NotNil(suite.T(), res.ProofOps)
proofOps = res.ProofOps
},
true, true,
},
{
"success for NonexistenceProof",
func() {
res := suite.store.Query(abci.RequestQuery{
Path: fmt.Sprintf("/%s/key", suite.storeKey.Name()), // required path to get key/value+proof
Data: []byte("NOTMYKEY"),
Prove: true,
})
require.NotNil(suite.T(), res.ProofOps)
proofOps = res.ProofOps
},
false, true,
},
{
"nil proofOps",
func() {
proofOps = nil
},
true, false,
},
{
"proof op data is nil",
func() {
res := suite.store.Query(abci.RequestQuery{
Path: fmt.Sprintf("/%s/key", suite.storeKey.Name()), // required path to get key/value+proof
Data: []byte("MYKEY"),
Prove: true,
})
require.NotNil(suite.T(), res.ProofOps)
proofOps = res.ProofOps
proofOps.Ops[0].Data = nil
},
true, false,
},
}
for _, tc := range testcases {
tc.malleate()
proof, err := types.ConvertProofs(proofOps)
if tc.expPass {
suite.Require().NoError(err, "ConvertProofs unexpectedly returned error for case: %s", tc.name)
if tc.keyExists {
err := proof.VerifyMembership(types.GetSDKSpecs(), &root, existsPath, value)
suite.Require().NoError(err, "converted proof failed to verify membership for case: %s", tc.name)
} else {
err := proof.VerifyNonMembership(types.GetSDKSpecs(), &root, nonexistPath)
suite.Require().NoError(err, "converted proof failed to verify membership for case: %s", tc.name)
}
} else {
suite.Require().Error(err, "ConvertProofs passed on invalid case for case: %s", tc.name)
}
}
}

View File

@ -9,8 +9,7 @@ const SubModuleName = "host"
// IBC client sentinel errors
var (
ErrInvalidID = sdkerrors.Register(SubModuleName, 2, "invalid identifier")
ErrInvalidPath = sdkerrors.Register(SubModuleName, 3, "invalid path")
ErrInvalidPacket = sdkerrors.Register(SubModuleName, 4, "invalid packet")
ErrInvalidVersion = sdkerrors.Register(SubModuleName, 5, "invalid version")
ErrInvalidID = sdkerrors.Register(SubModuleName, 2, "invalid identifier")
ErrInvalidPath = sdkerrors.Register(SubModuleName, 3, "invalid path")
ErrInvalidPacket = sdkerrors.Register(SubModuleName, 4, "invalid packet")
)

View File

@ -22,14 +22,18 @@ const (
// KVStore key prefixes for IBC
var (
KeyClientStorePrefix = []byte("clients")
KeyConsensusStatesPrefix = []byte("consensusStates")
KeyConnectionPrefix = []byte("connections")
KeyClientStorePrefix = []byte("clients")
)
// KVStore key prefixes for IBC
const (
KeyChannelPrefix = "channelEnds"
KeyClientState = "clientState"
KeyConsensusStatePrefix = "consensusStates"
KeyConnectionPrefix = "connections"
KeyChannelEndPrefix = "channelEnds"
KeyChannelPrefix = "channels"
KeyPortPrefix = "ports"
KeySequencePrefix = "sequences"
KeyChannelCapabilityPrefix = "capabilities"
KeyNextSeqSendPrefix = "nextSequenceSend"
KeyNextSeqRecvPrefix = "nextSequenceRecv"
@ -42,38 +46,57 @@ const (
// FullClientPath returns the full path of a specific client path in the format:
// "clients/{clientID}/{path}" as a string.
func FullClientPath(clientID string, path string) string {
return string(FullKeyClientPath(clientID, []byte(path)))
return fmt.Sprintf("%s/%s/%s", KeyClientStorePrefix, clientID, path)
}
// FullKeyClientPath returns the full path of specific client path in the format:
// FullClientKey returns the full path of specific client path in the format:
// "clients/{clientID}/{path}" as a byte array.
func FullKeyClientPath(clientID string, path []byte) []byte {
return append(KeyClientStorePrefix, append([]byte("/"+clientID+"/"), path...)...)
func FullClientKey(clientID string, path []byte) []byte {
return []byte(FullClientPath(clientID, string(path)))
}
// ICS02
// The following paths are the keys to the store as defined in https://github.com/cosmos/ics/tree/master/spec/ics-002-client-semantics#path-space
// ClientStatePath takes an Identifier and returns a Path under which to store a
// FullClientStatePath takes a client identifier and returns a Path under which to store a
// particular client state
func ClientStatePath() string {
return "clientState"
func FullClientStatePath(clientID string) string {
return FullClientPath(clientID, KeyClientState)
}
// ConsensusStatePath takes an Identifier and returns a Path under which to
// FullClientStateKey takes a client identifier and returns a Key under which to store a
// particular client state.
func FullClientStateKey(clientID string) []byte {
return FullClientKey(clientID, []byte(KeyClientState))
}
// ClientStateKey returns a store key under which a particular client state is stored
// in a client prefixed store
func ClientStateKey() []byte {
return []byte(KeyClientState)
}
// FullConsensusStatePath takes a client identifier and returns a Path under which to
// store the consensus state of a client.
func FullConsensusStatePath(clientID string, height exported.Height) string {
return FullClientPath(clientID, fmt.Sprintf("%s/%s", KeyConsensusStatePrefix, height))
}
// FullConsensusStateKey returns the store key for the consensus state of a particular
// client.
func FullConsensusStateKey(clientID string, height exported.Height) []byte {
return []byte(FullConsensusStatePath(clientID, height))
}
// ConsensusStatePath returns the suffix store key for the consensus state at a
// particular height stored in a client prefixed store.
func ConsensusStatePath(height exported.Height) string {
return fmt.Sprintf("%s/%s", KeyConsensusStatesPrefix, height)
return fmt.Sprintf("%s/%s", KeyConsensusStatePrefix, height)
}
// KeyClientState returns the store key for a particular client state
func KeyClientState() []byte {
return []byte(ClientStatePath())
}
// KeyConsensusState returns the store key for the consensus state of a particular
// client
func KeyConsensusState(height exported.Height) []byte {
// ConsensusStateKey returns the store key for a the consensus state of a particular
// client stored in a client prefixed store.
func ConsensusStateKey(height exported.Height) []byte {
return []byte(ConsensusStatePath(height))
}
@ -82,7 +105,12 @@ func KeyConsensusState(height exported.Height) []byte {
// ClientConnectionsPath defines a reverse mapping from clients to a set of connections
func ClientConnectionsPath(clientID string) string {
return fmt.Sprintf("%s/%s/connections", KeyClientStorePrefix, clientID)
return FullClientPath(clientID, KeyConnectionPrefix)
}
// ClientConnectionsKey returns the store key for the connections of a given client
func ClientConnectionsKey(clientID string) []byte {
return []byte(ClientConnectionsPath(clientID))
}
// ConnectionPath defines the path under which connection paths are stored
@ -90,13 +118,8 @@ func ConnectionPath(connectionID string) string {
return fmt.Sprintf("%s/%s", KeyConnectionPrefix, connectionID)
}
// KeyClientConnections returns the store key for the connections of a given client
func KeyClientConnections(clientID string) []byte {
return []byte(ClientConnectionsPath(clientID))
}
// KeyConnection returns the store key for a particular connection
func KeyConnection(connectionID string) []byte {
// ConnectionKey returns the store key for a particular connection
func ConnectionKey(connectionID string) []byte {
return []byte(ConnectionPath(connectionID))
}
@ -105,98 +128,102 @@ func KeyConnection(connectionID string) []byte {
// ChannelPath defines the path under which channels are stored
func ChannelPath(portID, channelID string) string {
return fmt.Sprintf("%s/", KeyChannelPrefix) + channelPath(portID, channelID)
return fmt.Sprintf("%s/%s", KeyChannelEndPrefix, channelPath(portID, channelID))
}
// ChannelKey returns the store key for a particular channel
func ChannelKey(portID, channelID string) []byte {
return []byte(ChannelPath(portID, channelID))
}
// ChannelCapabilityPath defines the path under which capability keys associated
// with a channel are stored
func ChannelCapabilityPath(portID, channelID string) string {
return fmt.Sprintf("%s/", KeyChannelCapabilityPrefix) + channelPath(portID, channelID) + "/key"
return fmt.Sprintf("%s/%s", KeyChannelCapabilityPrefix, channelPath(portID, channelID))
}
// NextSequenceSendPath defines the next send sequence counter store path
func NextSequenceSendPath(portID, channelID string) string {
return fmt.Sprintf("%s/", KeyNextSeqSendPrefix) + channelPath(portID, channelID)
return fmt.Sprintf("%s/%s", KeyNextSeqSendPrefix, channelPath(portID, channelID))
}
// NextSequenceRecvPath defines the next receive sequence counter store path
// NextSequenceSendKey returns the store key for the send sequence of a particular
// channel binded to a specific port.
func NextSequenceSendKey(portID, channelID string) []byte {
return []byte(NextSequenceSendPath(portID, channelID))
}
// NextSequenceRecvPath defines the next receive sequence counter store path.
func NextSequenceRecvPath(portID, channelID string) string {
return fmt.Sprintf("%s/", KeyNextSeqRecvPrefix) + channelPath(portID, channelID)
return fmt.Sprintf("%s/%s", KeyNextSeqRecvPrefix, channelPath(portID, channelID))
}
// NextSequenceRecvKey returns the store key for the receive sequence of a particular
// channel binded to a specific port
func NextSequenceRecvKey(portID, channelID string) []byte {
return []byte(NextSequenceRecvPath(portID, channelID))
}
// NextSequenceAckPath defines the next acknowledgement sequence counter store path
func NextSequenceAckPath(portID, channelID string) string {
return fmt.Sprintf("%s/", KeyNextSeqAckPrefix) + channelPath(portID, channelID)
return fmt.Sprintf("%s/%s", KeyNextSeqAckPrefix, channelPath(portID, channelID))
}
// NextSequenceAckKey returns the store key for the acknowledgement sequence of
// a particular channel binded to a specific port.
func NextSequenceAckKey(portID, channelID string) []byte {
return []byte(NextSequenceAckPath(portID, channelID))
}
// PacketCommitmentPath defines the commitments to packet data fields store path
func PacketCommitmentPath(portID, channelID string, sequence uint64) string {
return fmt.Sprintf("%s/", KeyPacketCommitmentPrefix) + channelPath(portID, channelID) + fmt.Sprintf("/packets/%d", sequence)
return fmt.Sprintf("%s/%s/%s", KeyPacketCommitmentPrefix, channelPath(portID, channelID), sequencePath(sequence))
}
// PacketCommitmentKey returns the store key of under which a packet commitment
// is stored
func PacketCommitmentKey(portID, channelID string, sequence uint64) []byte {
return []byte(PacketCommitmentPath(portID, channelID, sequence))
}
// PacketCommitmentPrefixPath defines the prefix for commitments to packet data fields store path.
func PacketCommitmentPrefixPath(portID, channelID string) string {
return fmt.Sprintf("%s/", KeyPacketCommitmentPrefix) + channelPath(portID, channelID)
return fmt.Sprintf("%s/%s/%s", KeyPacketCommitmentPrefix, channelPath(portID, channelID), KeySequencePrefix)
}
// PacketAcknowledgementPath defines the packet acknowledgement store path
func PacketAcknowledgementPath(portID, channelID string, sequence uint64) string {
return fmt.Sprintf("%s/", KeyPacketAckPrefix) + channelPath(portID, channelID) + fmt.Sprintf("/acknowledgements/%d", sequence)
return fmt.Sprintf("%s/%s/%s", KeyPacketAckPrefix, channelPath(portID, channelID), sequencePath(sequence))
}
// PacketAcknowledgementKey returns the store key of under which a packet
// acknowledgement is stored
func PacketAcknowledgementKey(portID, channelID string, sequence uint64) []byte {
return []byte(PacketAcknowledgementPath(portID, channelID, sequence))
}
// PacketAcknowledgementPrefixPath defines the prefix for commitments to packet data fields store path.
func PacketAcknowledgementPrefixPath(portID, channelID string) string {
return fmt.Sprintf("%s/", KeyPacketAckPrefix) + channelPath(portID, channelID)
return fmt.Sprintf("%s/%s/%s", KeyPacketAckPrefix, channelPath(portID, channelID), KeySequencePrefix)
}
// PacketReceiptPath defines the packet receipt store path
func PacketReceiptPath(portID, channelID string, sequence uint64) string {
return fmt.Sprintf("%s/", KeyPacketReceiptPrefix) + channelPath(portID, channelID) + fmt.Sprintf("/receipts/%d", sequence)
return fmt.Sprintf("%s/%s/%s", KeyPacketReceiptPrefix, channelPath(portID, channelID), sequencePath(sequence))
}
// KeyChannel returns the store key for a particular channel
func KeyChannel(portID, channelID string) []byte {
return []byte(ChannelPath(portID, channelID))
}
// KeyNextSequenceSend returns the store key for the send sequence of a particular
// channel binded to a specific port
func KeyNextSequenceSend(portID, channelID string) []byte {
return []byte(NextSequenceSendPath(portID, channelID))
}
// KeyNextSequenceRecv returns the store key for the receive sequence of a particular
// channel binded to a specific port
func KeyNextSequenceRecv(portID, channelID string) []byte {
return []byte(NextSequenceRecvPath(portID, channelID))
}
// KeyNextSequenceAck returns the store key for the acknowledgement sequence of
// a particular channel binded to a specific port.
func KeyNextSequenceAck(portID, channelID string) []byte {
return []byte(NextSequenceAckPath(portID, channelID))
}
// KeyPacketCommitment returns the store key of under which a packet commitment
// is stored
func KeyPacketCommitment(portID, channelID string, sequence uint64) []byte {
return []byte(PacketCommitmentPath(portID, channelID, sequence))
}
// KeyPacketAcknowledgement returns the store key of under which a packet
// acknowledgement is stored
func KeyPacketAcknowledgement(portID, channelID string, sequence uint64) []byte {
return []byte(PacketAcknowledgementPath(portID, channelID, sequence))
}
// KeyPacketReceipt returns the store key of under which a packet
// PacketReceiptKey returns the store key of under which a packet
// receipt is stored
func KeyPacketReceipt(portID, channelID string, sequence uint64) []byte {
func PacketReceiptKey(portID, channelID string, sequence uint64) []byte {
return []byte(PacketReceiptPath(portID, channelID, sequence))
}
func channelPath(portID, channelID string) string {
return fmt.Sprintf("ports/%s/channels/%s", portID, channelID)
return fmt.Sprintf("%s/%s/%s/%s", KeyPortPrefix, portID, KeyChannelPrefix, channelID)
}
func sequencePath(sequence uint64) string {
return fmt.Sprintf("%s/%d", KeySequencePrefix, sequence)
}
// ICS05
@ -204,5 +231,5 @@ func channelPath(portID, channelID string) string {
// PortPath defines the path under which ports paths are stored on the capability module
func PortPath(portID string) string {
return fmt.Sprintf("ports/%s", portID)
return fmt.Sprintf("%s/%s", KeyPortPrefix, portID)
}

View File

@ -25,7 +25,7 @@ func ParseChannelPath(path string) (string, string, error) {
return "", "", sdkerrors.Wrapf(ErrInvalidPath, "cannot parse channel path %s", path)
}
if split[1] != "ports" || split[3] != "channels" {
if split[1] != KeyPortPrefix || split[3] != KeyChannelPrefix {
return "", "", sdkerrors.Wrapf(ErrInvalidPath, "cannot parse channel path %s", path)
}

View File

@ -50,8 +50,9 @@ func QueryTendermintProof(clientCtx client.Context, key []byte) ([]byte, []byte,
return nil, nil, clienttypes.Height{}, err
}
merkleProof := commitmenttypes.MerkleProof{
Proof: res.ProofOps,
merkleProof, err := commitmenttypes.ConvertProofs(res.ProofOps)
if err != nil {
return nil, nil, clienttypes.Height{}, err
}
cdc := codec.NewProtoCodec(clientCtx.InterfaceRegistry)

View File

@ -41,6 +41,9 @@ func (suite *KeeperTestSuite) SetupTest() {
suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0))
suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1))
// commit some blocks so that QueryProof returns valid proof (cannot return valid query if height <= 1)
suite.coordinator.CommitNBlocks(suite.chainA, 2)
suite.coordinator.CommitNBlocks(suite.chainB, 2)
}
func TestIBCTestSuite(t *testing.T) {
@ -139,7 +142,7 @@ func (suite *KeeperTestSuite) TestHandleRecvPacket() {
tc.malleate()
// get proof of packet commitment from chainA
packetKey := host.KeyPacketCommitment(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
packetKey := host.PacketCommitmentKey(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
proof, proofHeight := suite.chainA.QueryProof(packetKey)
msg := channeltypes.NewMsgRecvPacket(packet, proof, proofHeight, suite.chainB.SenderAccount.GetAddress())
@ -278,7 +281,7 @@ func (suite *KeeperTestSuite) TestHandleAcknowledgePacket() {
tc.malleate()
packetKey := host.KeyPacketAcknowledgement(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
packetKey := host.PacketAcknowledgementKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
proof, proofHeight := suite.chainB.QueryProof(packetKey)
msg := channeltypes.NewMsgAcknowledgement(packet, ibcmock.MockAcknowledgement, proof, proofHeight, suite.chainA.SenderAccount.GetAddress())
@ -330,7 +333,7 @@ func (suite *KeeperTestSuite) TestHandleTimeoutPacket() {
// need to update chainA client to prove missing ack
suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint)
packetKey = host.KeyNextSequenceRecv(packet.GetDestPort(), packet.GetDestChannel())
packetKey = host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel())
}, true},
{"success: UNORDERED", func() {
clientA, clientB, _, _, channelA, channelB := suite.coordinator.Setup(suite.chainA, suite.chainB, channeltypes.UNORDERED)
@ -343,7 +346,7 @@ func (suite *KeeperTestSuite) TestHandleTimeoutPacket() {
// need to update chainA client to prove missing ack
suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint)
packetKey = host.KeyPacketReceipt(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
packetKey = host.PacketReceiptKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
}, true},
{"success: UNORDERED timeout out of order packet", func() {
// setup uses an UNORDERED channel
@ -360,7 +363,7 @@ func (suite *KeeperTestSuite) TestHandleTimeoutPacket() {
}
suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint)
packetKey = host.KeyPacketReceipt(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
packetKey = host.PacketReceiptKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
}, true},
{"success: ORDERED timeout out of order packet", func() {
clientA, clientB, _, _, channelA, channelB := suite.coordinator.Setup(suite.chainA, suite.chainB, channeltypes.ORDERED)
@ -376,19 +379,19 @@ func (suite *KeeperTestSuite) TestHandleTimeoutPacket() {
}
suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint)
packetKey = host.KeyNextSequenceRecv(packet.GetDestPort(), packet.GetDestChannel())
packetKey = host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel())
}, true},
{"channel does not exist", func() {
// any non-nil value of packet is valid
suite.Require().NotNil(packet)
packetKey = host.KeyNextSequenceRecv(packet.GetDestPort(), packet.GetDestChannel())
packetKey = host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel())
}, false},
{"UNORDERED: packet not sent", func() {
_, _, _, _, channelA, channelB := suite.coordinator.Setup(suite.chainA, suite.chainB, channeltypes.UNORDERED)
packet = channeltypes.NewPacket(ibctesting.MockCommitment, 1, channelA.PortID, channelA.ID, channelB.PortID, channelB.ID, timeoutHeight, 0)
packetKey = host.KeyPacketReceipt(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
packetKey = host.PacketReceiptKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
}, false},
}
@ -457,7 +460,7 @@ func (suite *KeeperTestSuite) TestHandleTimeoutOnClosePacket() {
// need to update chainA client to prove missing ack
suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint)
packetKey = host.KeyNextSequenceRecv(packet.GetDestPort(), packet.GetDestChannel())
packetKey = host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel())
// close counterparty channel
suite.coordinator.SetChannelClosed(suite.chainB, suite.chainA, counterpartyChannel)
@ -478,7 +481,7 @@ func (suite *KeeperTestSuite) TestHandleTimeoutOnClosePacket() {
// need to update chainA client to prove missing ack
suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint)
packetKey = host.KeyPacketReceipt(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
packetKey = host.PacketReceiptKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
// close counterparty channel
suite.coordinator.SetChannelClosed(suite.chainB, suite.chainA, counterpartyChannel)
@ -503,7 +506,7 @@ func (suite *KeeperTestSuite) TestHandleTimeoutOnClosePacket() {
}
suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint)
packetKey = host.KeyPacketReceipt(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
packetKey = host.PacketReceiptKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
// close counterparty channel
suite.coordinator.SetChannelClosed(suite.chainB, suite.chainA, counterpartyChannel)
@ -527,7 +530,7 @@ func (suite *KeeperTestSuite) TestHandleTimeoutOnClosePacket() {
}
suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint)
packetKey = host.KeyNextSequenceRecv(packet.GetDestPort(), packet.GetDestChannel())
packetKey = host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel())
// close counterparty channel
suite.coordinator.SetChannelClosed(suite.chainB, suite.chainA, counterpartyChannel)
@ -536,12 +539,12 @@ func (suite *KeeperTestSuite) TestHandleTimeoutOnClosePacket() {
// any non-nil value of packet is valid
suite.Require().NotNil(packet)
packetKey = host.KeyNextSequenceRecv(packet.GetDestPort(), packet.GetDestChannel())
packetKey = host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel())
}, false},
{"UNORDERED: packet not sent", func() {
clientA, _, _, _, channelA, channelB := suite.coordinator.Setup(suite.chainA, suite.chainB, channeltypes.UNORDERED)
packet = channeltypes.NewPacket(ibctesting.MockCommitment, 1, channelA.PortID, channelA.ID, channelB.PortID, channelB.ID, timeoutHeight, 0)
packetKey = host.KeyPacketAcknowledgement(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
packetKey = host.PacketAcknowledgementKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
counterpartyChannel = ibctesting.TestChannel{
PortID: channelB.PortID,
ID: channelB.ID,
@ -567,7 +570,7 @@ func (suite *KeeperTestSuite) TestHandleTimeoutOnClosePacket() {
// need to update chainA client to prove missing ack
suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint)
packetKey = host.KeyNextSequenceRecv(packet.GetDestPort(), packet.GetDestChannel())
packetKey = host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel())
}, false},
}
@ -581,7 +584,7 @@ func (suite *KeeperTestSuite) TestHandleTimeoutOnClosePacket() {
proof, proofHeight := suite.chainB.QueryProof(packetKey)
channelKey := host.KeyChannel(counterpartyChannel.PortID, counterpartyChannel.ID)
channelKey := host.ChannelKey(counterpartyChannel.PortID, counterpartyChannel.ID)
proofClosed, _ := suite.chainB.QueryProof(channelKey)
msg := channeltypes.NewMsgTimeoutOnClose(packet, 1, proof, proofClosed, proofHeight, suite.chainA.SenderAccount.GetAddress())

View File

@ -40,15 +40,15 @@ func TestDecodeStore(t *testing.T) {
kvPairs := kv.Pairs{
Pairs: []kv.Pair{
{
Key: host.FullKeyClientPath(clientID, host.KeyClientState()),
Key: host.FullClientStateKey(clientID),
Value: app.IBCKeeper.ClientKeeper.MustMarshalClientState(clientState),
},
{
Key: host.KeyConnection(connectionID),
Key: host.ConnectionKey(connectionID),
Value: app.IBCKeeper.Codec().MustMarshalBinaryBare(&connection),
},
{
Key: host.KeyChannel(portID, channelID),
Key: host.ChannelKey(portID, channelID),
Value: app.IBCKeeper.Codec().MustMarshalBinaryBare(&channel),
},
{

View File

@ -16,10 +16,10 @@ The client type is not stored since it can be obtained through the client state.
| "0/" | "connections/{identifier}" | ConnectionEnd |
| "0/" | "ports/{identifier}" | CapabilityKey |
| "0/" | "channelEnds/ports/{identifier}/channels/{identifier}" | ChannelEnd |
| "0/" | "capabilities/ports/{identifier}/channels/{identifier}/key" | CapabilityKey |
| "0/" | "seqSends/ports/{identifier}/channels/{identifier}/nextSequenceSend" | uint64 |
| "0/" | "seqRecvs/ports/{identifier}/channels/{identifier}/nextSequenceRecv" | uint64 |
| "0/" | "seqAcks/ports/{identifier}/channels/{identifier}/nextSequenceAck" | uint64 |
| "0/" | "commitments/ports/{identifier}/channels/{identifier}/packets/{sequence}" | bytes |
| "0/" | "receipts/ports/{identifier}/channels/{identifier}/receipts/{sequence}" | bytes |
| "0/" | "acks/ports/{identifier}/channels/{identifier}/acknowledgements/{sequence}" | bytes |
| "0/" | "capabilities/ports/{identifier}/channels/{identifier}" | CapabilityKey |
| "0/" | "nextSequenceSend/ports/{identifier}/channels/{identifier}" | uint64 |
| "0/" | "nextSequenceRecv/ports/{identifier}/channels/{identifier}" | uint64 |
| "0/" | "nextSequenceAck/ports/{identifier}/channels/{identifier}" | uint64 |
| "0/" | "commitments/ports/{identifier}/channels/{identifier}/sequences/{sequence}" | bytes |
| "0/" | "receipts/ports/{identifier}/channels/{identifier}/sequences/{sequence}" | bytes |
| "0/" | "acks/ports/{identifier}/channels/{identifier}/sequences/{sequence}" | bytes |

View File

@ -100,7 +100,7 @@ func (cs ClientState) VerifyClientState(
return err
}
clientPrefixedPath := "clients/" + counterpartyClientIdentifier + "/" + host.ClientStatePath()
clientPrefixedPath := commitmenttypes.NewMerklePath(host.FullClientStatePath(counterpartyClientIdentifier))
path, err := commitmenttypes.ApplyPrefix(prefix, clientPrefixedPath)
if err != nil {
return err
@ -138,7 +138,7 @@ func (cs ClientState) VerifyClientConsensusState(
return err
}
clientPrefixedPath := "clients/" + counterpartyClientIdentifier + "/" + host.ConsensusStatePath(consensusHeight)
clientPrefixedPath := commitmenttypes.NewMerklePath(host.FullConsensusStatePath(counterpartyClientIdentifier, consensusHeight))
path, err := commitmenttypes.ApplyPrefix(prefix, clientPrefixedPath)
if err != nil {
return err
@ -175,7 +175,8 @@ func (cs ClientState) VerifyConnectionState(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.ConnectionPath(connectionID))
connectionPath := commitmenttypes.NewMerklePath(host.ConnectionPath(connectionID))
path, err := commitmenttypes.ApplyPrefix(prefix, connectionPath)
if err != nil {
return err
}
@ -212,7 +213,8 @@ func (cs ClientState) VerifyChannelState(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.ChannelPath(portID, channelID))
channelPath := commitmenttypes.NewMerklePath(host.ChannelPath(portID, channelID))
path, err := commitmenttypes.ApplyPrefix(prefix, channelPath)
if err != nil {
return err
}
@ -250,7 +252,8 @@ func (cs ClientState) VerifyPacketCommitment(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.PacketCommitmentPath(portID, channelID, packetSequence))
commitmentPath := commitmenttypes.NewMerklePath(host.PacketCommitmentPath(portID, channelID, packetSequence))
path, err := commitmenttypes.ApplyPrefix(prefix, commitmentPath)
if err != nil {
return err
}
@ -288,7 +291,8 @@ func (cs ClientState) VerifyPacketAcknowledgement(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.PacketAcknowledgementPath(portID, channelID, packetSequence))
ackPath := commitmenttypes.NewMerklePath(host.PacketAcknowledgementPath(portID, channelID, packetSequence))
path, err := commitmenttypes.ApplyPrefix(prefix, ackPath)
if err != nil {
return err
}
@ -326,7 +330,8 @@ func (cs ClientState) VerifyPacketReceiptAbsence(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.PacketReceiptPath(portID, channelID, packetSequence))
receiptPath := commitmenttypes.NewMerklePath(host.PacketReceiptPath(portID, channelID, packetSequence))
path, err := commitmenttypes.ApplyPrefix(prefix, receiptPath)
if err != nil {
return err
}
@ -363,7 +368,8 @@ func (cs ClientState) VerifyNextSequenceRecv(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.NextSequenceRecvPath(portID, channelID))
nextSequenceRecvPath := commitmenttypes.NewMerklePath(host.NextSequenceRecvPath(portID, channelID))
path, err := commitmenttypes.ApplyPrefix(prefix, nextSequenceRecvPath)
if err != nil {
return err
}
@ -454,5 +460,5 @@ func produceVerificationArgs(
// sets the client state to the store
func setClientState(store sdk.KVStore, cdc codec.BinaryMarshaler, clientState exported.ClientState) {
bz := clienttypes.MustMarshalClientState(cdc, clientState)
store.Set(host.KeyClientState(), bz)
store.Set([]byte(host.KeyClientState), bz)
}

View File

@ -49,7 +49,7 @@ func TestSoloMachineTestSuite(t *testing.T) {
}
func (suite *SoloMachineTestSuite) GetSequenceFromStore() uint64 {
bz := suite.store.Get(host.KeyClientState())
bz := suite.store.Get(host.ClientStateKey())
suite.Require().NotNil(bz)
var clientState exported.ClientState

View File

@ -180,7 +180,7 @@ func (cs ClientState) VerifyClientState(
return err
}
clientPrefixedPath := "clients/" + counterpartyClientIdentifier + "/" + host.ClientStatePath()
clientPrefixedPath := commitmenttypes.NewMerklePath(host.FullClientStatePath(counterpartyClientIdentifier))
path, err := commitmenttypes.ApplyPrefix(prefix, clientPrefixedPath)
if err != nil {
return err
@ -220,7 +220,7 @@ func (cs ClientState) VerifyClientConsensusState(
return err
}
clientPrefixedPath := "clients/" + counterpartyClientIdentifier + "/" + host.ConsensusStatePath(consensusHeight)
clientPrefixedPath := commitmenttypes.NewMerklePath(host.FullConsensusStatePath(counterpartyClientIdentifier, consensusHeight))
path, err := commitmenttypes.ApplyPrefix(prefix, clientPrefixedPath)
if err != nil {
return err
@ -263,7 +263,8 @@ func (cs ClientState) VerifyConnectionState(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.ConnectionPath(connectionID))
connectionPath := commitmenttypes.NewMerklePath(host.ConnectionPath(connectionID))
path, err := commitmenttypes.ApplyPrefix(prefix, connectionPath)
if err != nil {
return err
}
@ -302,7 +303,8 @@ func (cs ClientState) VerifyChannelState(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.ChannelPath(portID, channelID))
channelPath := commitmenttypes.NewMerklePath(host.ChannelPath(portID, channelID))
path, err := commitmenttypes.ApplyPrefix(prefix, channelPath)
if err != nil {
return err
}
@ -342,7 +344,8 @@ func (cs ClientState) VerifyPacketCommitment(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.PacketCommitmentPath(portID, channelID, sequence))
commitmentPath := commitmenttypes.NewMerklePath(host.PacketCommitmentPath(portID, channelID, sequence))
path, err := commitmenttypes.ApplyPrefix(prefix, commitmentPath)
if err != nil {
return err
}
@ -372,7 +375,8 @@ func (cs ClientState) VerifyPacketAcknowledgement(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.PacketAcknowledgementPath(portID, channelID, sequence))
ackPath := commitmenttypes.NewMerklePath(host.PacketAcknowledgementPath(portID, channelID, sequence))
path, err := commitmenttypes.ApplyPrefix(prefix, ackPath)
if err != nil {
return err
}
@ -402,7 +406,8 @@ func (cs ClientState) VerifyPacketReceiptAbsence(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.PacketReceiptPath(portID, channelID, sequence))
receiptPath := commitmenttypes.NewMerklePath(host.PacketReceiptPath(portID, channelID, sequence))
path, err := commitmenttypes.ApplyPrefix(prefix, receiptPath)
if err != nil {
return err
}
@ -431,7 +436,8 @@ func (cs ClientState) VerifyNextSequenceRecv(
return err
}
path, err := commitmenttypes.ApplyPrefix(prefix, host.NextSequenceRecvPath(portID, channelID))
nextSequenceRecvPath := commitmenttypes.NewMerklePath(host.NextSequenceRecvPath(portID, channelID))
path, err := commitmenttypes.ApplyPrefix(prefix, nextSequenceRecvPath)
if err != nil {
return err
}

View File

@ -230,7 +230,7 @@ func (suite *TendermintTestSuite) TestVerifyConnectionState() {
prefix = suite.chainB.GetPrefix()
// make connection proof
connectionKey := host.KeyConnection(connB.ID)
connectionKey := host.ConnectionKey(connB.ID)
proof, proofHeight = suite.chainB.QueryProof(connectionKey)
tc.malleate() // make changes as necessary
@ -308,7 +308,7 @@ func (suite *TendermintTestSuite) TestVerifyChannelState() {
prefix = suite.chainB.GetPrefix()
// make channel proof
channelKey := host.KeyChannel(channelB.PortID, channelB.ID)
channelKey := host.ChannelKey(channelB.PortID, channelB.ID)
proof, proofHeight = suite.chainB.QueryProof(channelKey)
tc.malleate() // make changes as necessary
@ -389,7 +389,7 @@ func (suite *TendermintTestSuite) TestVerifyPacketCommitment() {
prefix = suite.chainB.GetPrefix()
// make packet commitment proof
packetKey := host.KeyPacketCommitment(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
packetKey := host.PacketCommitmentKey(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
proof, proofHeight = suite.chainB.QueryProof(packetKey)
tc.malleate() // make changes as necessary
@ -477,7 +477,7 @@ func (suite *TendermintTestSuite) TestVerifyPacketAcknowledgement() {
prefix = suite.chainB.GetPrefix()
// make packet acknowledgement proof
acknowledgementKey := host.KeyPacketAcknowledgement(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
acknowledgementKey := host.PacketAcknowledgementKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
proof, proofHeight = suite.chainB.QueryProof(acknowledgementKey)
tc.malleate() // make changes as necessary
@ -564,7 +564,7 @@ func (suite *TendermintTestSuite) TestVerifyPacketReceiptAbsence() {
prefix = suite.chainB.GetPrefix()
// make packet receipt absence proof
receiptKey := host.KeyPacketReceipt(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
receiptKey := host.PacketReceiptKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
proof, proofHeight = suite.chainB.QueryProof(receiptKey)
tc.malleate() // make changes as necessary
@ -655,7 +655,7 @@ func (suite *TendermintTestSuite) TestVerifyNextSeqRecv() {
prefix = suite.chainB.GetPrefix()
// make next seq recv proof
nextSeqRecvKey := host.KeyNextSequenceRecv(packet.GetDestPort(), packet.GetDestChannel())
nextSeqRecvKey := host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel())
proof, proofHeight = suite.chainB.QueryProof(nextSeqRecvKey)
tc.malleate() // make changes as necessary

View File

@ -12,7 +12,7 @@ import (
// GetConsensusState retrieves the consensus state from the client prefixed
// store. An error is returned if the consensus state does not exist.
func GetConsensusState(store sdk.KVStore, cdc codec.BinaryMarshaler, height exported.Height) (*ConsensusState, error) {
bz := store.Get(host.KeyConsensusState(height))
bz := store.Get(host.ConsensusStateKey(height))
if bz == nil {
return nil, sdkerrors.Wrapf(
clienttypes.ErrConsensusStateNotFound,

View File

@ -34,7 +34,7 @@ func (suite *TendermintTestSuite) TestGetConsensusState() {
// marshal an empty client state and set as consensus state
store := suite.chainA.App.IBCKeeper.ClientKeeper.ClientStore(suite.chainA.GetContext(), clientA)
clientStateBz := suite.chainA.App.IBCKeeper.ClientKeeper.MustMarshalClientState(&types.ClientState{})
store.Set(host.KeyConsensusState(height), clientStateBz)
store.Set(host.ConsensusStateKey(height), clientStateBz)
}, false,
},
{
@ -42,7 +42,7 @@ func (suite *TendermintTestSuite) TestGetConsensusState() {
// marshal and set solomachine consensus state
store := suite.chainA.App.IBCKeeper.ClientKeeper.ClientStore(suite.chainA.GetContext(), clientA)
consensusStateBz := suite.chainA.App.IBCKeeper.ClientKeeper.MustMarshalConsensusState(&solomachinetypes.ConsensusState{})
store.Set(host.KeyConsensusState(height), consensusStateBz)
store.Set(host.ConsensusStateKey(height), consensusStateBz)
}, false,
},
}

View File

@ -60,6 +60,9 @@ func (suite *TendermintTestSuite) SetupTest() {
suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2)
suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0))
suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1))
// commit some blocks so that QueryProof returns valid proof (cannot return valid query if height <= 1)
suite.coordinator.CommitNBlocks(suite.chainA, 2)
suite.coordinator.CommitNBlocks(suite.chainB, 2)
// TODO: deprecate usage in favor of testing package
checkTx := false

View File

@ -117,5 +117,5 @@ func constructUpgradeMerklePath(upgradePath string, upgradeHeight exported.Heigh
// append upgradeHeight to last key in merkle path
// this will create the IAVL key that is used to store client in upgrade store
upgradeKeys[len(upgradeKeys)-1] = fmt.Sprintf("%s/%d", lastKey, upgradeHeight.GetVersionHeight())
return commitmenttypes.NewMerklePath(upgradeKeys), nil
return commitmenttypes.NewMerklePath(upgradeKeys...), nil
}

View File

@ -115,8 +115,8 @@ func (cs ClientState) VerifyClientState(
store sdk.KVStore, cdc codec.BinaryMarshaler,
_ exported.Height, _ exported.Prefix, _ string, _ []byte, clientState exported.ClientState,
) error {
path := host.KeyClientState()
bz := store.Get(path)
path := host.KeyClientState
bz := store.Get([]byte(path))
if bz == nil {
return sdkerrors.Wrapf(clienttypes.ErrFailedClientStateVerification,
"not found for path: %s", path)
@ -154,7 +154,7 @@ func (cs ClientState) VerifyConnectionState(
connectionID string,
connectionEnd exported.ConnectionI,
) error {
path := host.KeyConnection(connectionID)
path := host.ConnectionKey(connectionID)
bz := store.Get(path)
if bz == nil {
return sdkerrors.Wrapf(clienttypes.ErrFailedConnectionStateVerification, "not found for path %s", path)
@ -188,7 +188,7 @@ func (cs ClientState) VerifyChannelState(
channelID string,
channel exported.ChannelI,
) error {
path := host.KeyChannel(portID, channelID)
path := host.ChannelKey(portID, channelID)
bz := store.Get(path)
if bz == nil {
return sdkerrors.Wrapf(clienttypes.ErrFailedChannelStateVerification, "not found for path %s", path)
@ -223,7 +223,7 @@ func (cs ClientState) VerifyPacketCommitment(
sequence uint64,
commitmentBytes []byte,
) error {
path := host.KeyPacketCommitment(portID, channelID, sequence)
path := host.PacketCommitmentKey(portID, channelID, sequence)
data := store.Get(path)
if len(data) == 0 {
@ -253,7 +253,7 @@ func (cs ClientState) VerifyPacketAcknowledgement(
sequence uint64,
acknowledgement []byte,
) error {
path := host.KeyPacketAcknowledgement(portID, channelID, sequence)
path := host.PacketAcknowledgementKey(portID, channelID, sequence)
data := store.Get(path)
if len(data) == 0 {
@ -283,7 +283,7 @@ func (cs ClientState) VerifyPacketReceiptAbsence(
channelID string,
sequence uint64,
) error {
path := host.KeyPacketReceipt(portID, channelID, sequence)
path := host.PacketReceiptKey(portID, channelID, sequence)
data := store.Get(path)
if data != nil {
@ -305,7 +305,7 @@ func (cs ClientState) VerifyNextSequenceRecv(
channelID string,
nextSequenceRecv uint64,
) error {
path := host.KeyNextSequenceRecv(portID, channelID)
path := host.NextSequenceRecvKey(portID, channelID)
data := store.Get(path)
if len(data) == 0 {

View File

@ -66,7 +66,7 @@ func (suite *LocalhostTestSuite) TestVerifyClientState() {
clientState: clientState,
malleate: func() {
bz := clienttypes.MustMarshalClientState(suite.cdc, clientState)
suite.store.Set(host.KeyClientState(), bz)
suite.store.Set(host.ClientStateKey(), bz)
},
counterparty: clientState,
expPass: true,
@ -76,7 +76,7 @@ func (suite *LocalhostTestSuite) TestVerifyClientState() {
clientState: clientState,
malleate: func() {
bz := clienttypes.MustMarshalClientState(suite.cdc, clientState)
suite.store.Set(host.KeyClientState(), bz)
suite.store.Set(host.ClientStateKey(), bz)
},
counterparty: invalidClient,
expPass: false,
@ -161,7 +161,7 @@ func (suite *LocalhostTestSuite) TestVerifyConnectionState() {
malleate: func() {
bz, err := suite.cdc.MarshalBinaryBare(&conn1)
suite.Require().NoError(err)
suite.store.Set(host.KeyConnection(testConnectionID), bz)
suite.store.Set(host.ConnectionKey(testConnectionID), bz)
},
connection: conn1,
expPass: true,
@ -177,7 +177,7 @@ func (suite *LocalhostTestSuite) TestVerifyConnectionState() {
name: "proof verification failed: unmarshal error",
clientState: types.NewClientState("chainID", clientHeight),
malleate: func() {
suite.store.Set(host.KeyConnection(testConnectionID), []byte("connection"))
suite.store.Set(host.ConnectionKey(testConnectionID), []byte("connection"))
},
connection: conn1,
expPass: false,
@ -188,7 +188,7 @@ func (suite *LocalhostTestSuite) TestVerifyConnectionState() {
malleate: func() {
bz, err := suite.cdc.MarshalBinaryBare(&conn2)
suite.Require().NoError(err)
suite.store.Set(host.KeyConnection(testConnectionID), bz)
suite.store.Set(host.ConnectionKey(testConnectionID), bz)
},
connection: conn1,
expPass: false,
@ -233,7 +233,7 @@ func (suite *LocalhostTestSuite) TestVerifyChannelState() {
malleate: func() {
bz, err := suite.cdc.MarshalBinaryBare(&ch1)
suite.Require().NoError(err)
suite.store.Set(host.KeyChannel(testPortID, testChannelID), bz)
suite.store.Set(host.ChannelKey(testPortID, testChannelID), bz)
},
channel: ch1,
expPass: true,
@ -249,7 +249,7 @@ func (suite *LocalhostTestSuite) TestVerifyChannelState() {
name: "proof verification failed: unmarshal failed",
clientState: types.NewClientState("chainID", clientHeight),
malleate: func() {
suite.store.Set(host.KeyChannel(testPortID, testChannelID), []byte("channel"))
suite.store.Set(host.ChannelKey(testPortID, testChannelID), []byte("channel"))
},
channel: ch1,
@ -261,7 +261,7 @@ func (suite *LocalhostTestSuite) TestVerifyChannelState() {
malleate: func() {
bz, err := suite.cdc.MarshalBinaryBare(&ch2)
suite.Require().NoError(err)
suite.store.Set(host.KeyChannel(testPortID, testChannelID), bz)
suite.store.Set(host.ChannelKey(testPortID, testChannelID), bz)
},
channel: ch1,
@ -302,7 +302,7 @@ func (suite *LocalhostTestSuite) TestVerifyPacketCommitment() {
clientState: types.NewClientState("chainID", clientHeight),
malleate: func() {
suite.store.Set(
host.KeyPacketCommitment(testPortID, testChannelID, testSequence), []byte("commitment"),
host.PacketCommitmentKey(testPortID, testChannelID, testSequence), []byte("commitment"),
)
},
commitment: []byte("commitment"),
@ -313,7 +313,7 @@ func (suite *LocalhostTestSuite) TestVerifyPacketCommitment() {
clientState: types.NewClientState("chainID", clientHeight),
malleate: func() {
suite.store.Set(
host.KeyPacketCommitment(testPortID, testChannelID, testSequence), []byte("different"),
host.PacketCommitmentKey(testPortID, testChannelID, testSequence), []byte("different"),
)
},
commitment: []byte("commitment"),
@ -361,7 +361,7 @@ func (suite *LocalhostTestSuite) TestVerifyPacketAcknowledgement() {
clientState: types.NewClientState("chainID", clientHeight),
malleate: func() {
suite.store.Set(
host.KeyPacketAcknowledgement(testPortID, testChannelID, testSequence), []byte("acknowledgement"),
host.PacketAcknowledgementKey(testPortID, testChannelID, testSequence), []byte("acknowledgement"),
)
},
ack: []byte("acknowledgement"),
@ -372,7 +372,7 @@ func (suite *LocalhostTestSuite) TestVerifyPacketAcknowledgement() {
clientState: types.NewClientState("chainID", clientHeight),
malleate: func() {
suite.store.Set(
host.KeyPacketAcknowledgement(testPortID, testChannelID, testSequence), []byte("different"),
host.PacketAcknowledgementKey(testPortID, testChannelID, testSequence), []byte("different"),
)
},
ack: []byte("acknowledgement"),
@ -416,7 +416,7 @@ func (suite *LocalhostTestSuite) TestVerifyPacketReceiptAbsence() {
suite.Require().NoError(err, "receipt absence failed")
suite.store.Set(host.KeyPacketReceipt(testPortID, testChannelID, testSequence), []byte("receipt"))
suite.store.Set(host.PacketReceiptKey(testPortID, testChannelID, testSequence), []byte("receipt"))
err = clientState.VerifyPacketReceiptAbsence(
suite.store, suite.cdc, clientHeight, nil, nil, testPortID, testChannelID, testSequence,
@ -439,7 +439,7 @@ func (suite *LocalhostTestSuite) TestVerifyNextSeqRecv() {
clientState: types.NewClientState("chainID", clientHeight),
malleate: func() {
suite.store.Set(
host.KeyNextSequenceRecv(testPortID, testChannelID),
host.NextSequenceRecvKey(testPortID, testChannelID),
sdk.Uint64ToBigEndian(nextSeqRecv),
)
},
@ -451,7 +451,7 @@ func (suite *LocalhostTestSuite) TestVerifyNextSeqRecv() {
clientState: types.NewClientState("chainID", clientHeight),
malleate: func() {
suite.store.Set(
host.KeyNextSequenceRecv(testPortID, testChannelID),
host.NextSequenceRecvKey(testPortID, testChannelID),
sdk.Uint64ToBigEndian(3),
)
},

View File

@ -197,9 +197,8 @@ func (chain *TestChain) QueryProof(key []byte) ([]byte, clienttypes.Height) {
Prove: true,
})
merkleProof := commitmenttypes.MerkleProof{
Proof: res.ProofOps,
}
merkleProof, err := commitmenttypes.ConvertProofs(res.ProofOps)
require.NoError(chain.t, err)
proof, err := chain.App.AppCodec().MarshalBinaryBare(&merkleProof)
require.NoError(chain.t, err)
@ -222,9 +221,8 @@ func (chain *TestChain) QueryUpgradeProof(key []byte, height uint64) ([]byte, cl
Prove: true,
})
merkleProof := commitmenttypes.MerkleProof{
Proof: res.ProofOps,
}
merkleProof, err := commitmenttypes.ConvertProofs(res.ProofOps)
require.NoError(chain.t, err)
proof, err := chain.App.AppCodec().MarshalBinaryBare(&merkleProof)
require.NoError(chain.t, err)
@ -244,7 +242,7 @@ func (chain *TestChain) QueryClientStateProof(clientID string) (exported.ClientS
clientState, found := chain.App.IBCKeeper.ClientKeeper.GetClientState(chain.GetContext(), clientID)
require.True(chain.t, found)
clientKey := host.FullKeyClientPath(clientID, host.KeyClientState())
clientKey := host.FullClientStateKey(clientID)
proofClient, _ := chain.QueryProof(clientKey)
return clientState, proofClient
@ -256,7 +254,7 @@ func (chain *TestChain) QueryConsensusStateProof(clientID string) ([]byte, clien
clientState := chain.GetClientState(clientID)
consensusHeight := clientState.GetLatestHeight().(clienttypes.Height)
consensusKey := host.FullKeyClientPath(clientID, host.KeyConsensusState(consensusHeight))
consensusKey := host.FullConsensusStateKey(clientID, consensusHeight)
proofConsensus, _ := chain.QueryProof(consensusKey)
return proofConsensus, consensusHeight
@ -647,7 +645,7 @@ func (chain *TestChain) ConnectionOpenTry(
) error {
counterpartyClient, proofClient := counterparty.QueryClientStateProof(counterpartyConnection.ClientID)
connectionKey := host.KeyConnection(counterpartyConnection.ID)
connectionKey := host.ConnectionKey(counterpartyConnection.ID)
proofInit, proofHeight := counterparty.QueryProof(connectionKey)
proofConsensus, consensusHeight := counterparty.QueryConsensusStateProof(counterpartyConnection.ClientID)
@ -670,7 +668,7 @@ func (chain *TestChain) ConnectionOpenAck(
) error {
counterpartyClient, proofClient := counterparty.QueryClientStateProof(counterpartyConnection.ClientID)
connectionKey := host.KeyConnection(counterpartyConnection.ID)
connectionKey := host.ConnectionKey(counterpartyConnection.ID)
proofTry, proofHeight := counterparty.QueryProof(connectionKey)
proofConsensus, consensusHeight := counterparty.QueryConsensusStateProof(counterpartyConnection.ClientID)
@ -690,7 +688,7 @@ func (chain *TestChain) ConnectionOpenConfirm(
counterparty *TestChain,
connection, counterpartyConnection *TestConnection,
) error {
connectionKey := host.KeyConnection(counterpartyConnection.ID)
connectionKey := host.ConnectionKey(counterpartyConnection.ID)
proof, height := counterparty.QueryProof(connectionKey)
msg := connectiontypes.NewMsgConnectionOpenConfirm(
@ -790,7 +788,7 @@ func (chain *TestChain) ChanOpenTry(
order channeltypes.Order,
connectionID string,
) error {
proof, height := counterparty.QueryProof(host.KeyChannel(counterpartyCh.PortID, counterpartyCh.ID))
proof, height := counterparty.QueryProof(host.ChannelKey(counterpartyCh.PortID, counterpartyCh.ID))
msg := channeltypes.NewMsgChannelOpenTry(
ch.PortID, ch.ID, ch.ID, // testing doesn't use flexible selection
@ -808,7 +806,7 @@ func (chain *TestChain) ChanOpenAck(
counterparty *TestChain,
ch, counterpartyCh TestChannel,
) error {
proof, height := counterparty.QueryProof(host.KeyChannel(counterpartyCh.PortID, counterpartyCh.ID))
proof, height := counterparty.QueryProof(host.ChannelKey(counterpartyCh.PortID, counterpartyCh.ID))
msg := channeltypes.NewMsgChannelOpenAck(
ch.PortID, ch.ID,
@ -824,7 +822,7 @@ func (chain *TestChain) ChanOpenConfirm(
counterparty *TestChain,
ch, counterpartyCh TestChannel,
) error {
proof, height := counterparty.QueryProof(host.KeyChannel(counterpartyCh.PortID, counterpartyCh.ID))
proof, height := counterparty.QueryProof(host.ChannelKey(counterpartyCh.PortID, counterpartyCh.ID))
msg := channeltypes.NewMsgChannelOpenConfirm(
ch.PortID, ch.ID,

View File

@ -238,7 +238,7 @@ func (coord *Coordinator) RecvPacket(
packet channeltypes.Packet,
) error {
// get proof of packet commitment on source
packetKey := host.KeyPacketCommitment(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
packetKey := host.PacketCommitmentKey(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())
proof, proofHeight := source.QueryProof(packetKey)
recvMsg := channeltypes.NewMsgRecvPacket(packet, proof, proofHeight, counterparty.SenderAccount.GetAddress())
@ -277,7 +277,7 @@ func (coord *Coordinator) AcknowledgePacket(
packet channeltypes.Packet, ack []byte,
) error {
// get proof of acknowledgement on counterparty
packetKey := host.KeyPacketAcknowledgement(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
packetKey := host.PacketAcknowledgementKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
proof, proofHeight := counterparty.QueryProof(packetKey)
ackMsg := channeltypes.NewMsgAcknowledgement(packet, ack, proof, proofHeight, source.SenderAccount.GetAddress())

View File

@ -251,8 +251,7 @@ func (solo *Solomachine) GenerateSignature(signBytes []byte) []byte {
// GetClientStatePath returns the commitment path for the client state.
func (solo *Solomachine) GetClientStatePath(counterpartyClientIdentifier string) commitmenttypes.MerklePath {
clientPrefixedPath := "clients/" + counterpartyClientIdentifier + "/" + host.ClientStatePath()
path, err := commitmenttypes.ApplyPrefix(prefix, clientPrefixedPath)
path, err := commitmenttypes.ApplyPrefix(prefix, commitmenttypes.NewMerklePath(host.FullClientStatePath(counterpartyClientIdentifier)))
require.NoError(solo.t, err)
return path
@ -260,8 +259,7 @@ func (solo *Solomachine) GetClientStatePath(counterpartyClientIdentifier string)
// GetConsensusStatePath returns the commitment path for the consensus state.
func (solo *Solomachine) GetConsensusStatePath(counterpartyClientIdentifier string, consensusHeight exported.Height) commitmenttypes.MerklePath {
clientPrefixedPath := "clients/" + counterpartyClientIdentifier + "/" + host.ConsensusStatePath(consensusHeight)
path, err := commitmenttypes.ApplyPrefix(prefix, clientPrefixedPath)
path, err := commitmenttypes.ApplyPrefix(prefix, commitmenttypes.NewMerklePath(host.FullConsensusStatePath(counterpartyClientIdentifier, consensusHeight)))
require.NoError(solo.t, err)
return path
@ -269,7 +267,8 @@ func (solo *Solomachine) GetConsensusStatePath(counterpartyClientIdentifier stri
// GetConnectionStatePath returns the commitment path for the connection state.
func (solo *Solomachine) GetConnectionStatePath(connID string) commitmenttypes.MerklePath {
path, err := commitmenttypes.ApplyPrefix(prefix, host.ConnectionPath(connID))
connectionPath := commitmenttypes.NewMerklePath(host.ConnectionPath(connID))
path, err := commitmenttypes.ApplyPrefix(prefix, connectionPath)
require.NoError(solo.t, err)
return path
@ -277,7 +276,8 @@ func (solo *Solomachine) GetConnectionStatePath(connID string) commitmenttypes.M
// GetChannelStatePath returns the commitment path for that channel state.
func (solo *Solomachine) GetChannelStatePath(portID, channelID string) commitmenttypes.MerklePath {
path, err := commitmenttypes.ApplyPrefix(prefix, host.ChannelPath(portID, channelID))
channelPath := commitmenttypes.NewMerklePath(host.ChannelPath(portID, channelID))
path, err := commitmenttypes.ApplyPrefix(prefix, channelPath)
require.NoError(solo.t, err)
return path
@ -285,7 +285,8 @@ func (solo *Solomachine) GetChannelStatePath(portID, channelID string) commitmen
// GetPacketCommitmentPath returns the commitment path for a packet commitment.
func (solo *Solomachine) GetPacketCommitmentPath(portID, channelID string) commitmenttypes.MerklePath {
path, err := commitmenttypes.ApplyPrefix(prefix, host.PacketCommitmentPath(portID, channelID, solo.Sequence))
commitmentPath := commitmenttypes.NewMerklePath(host.PacketCommitmentPath(portID, channelID, solo.Sequence))
path, err := commitmenttypes.ApplyPrefix(prefix, commitmentPath)
require.NoError(solo.t, err)
return path
@ -293,7 +294,8 @@ func (solo *Solomachine) GetPacketCommitmentPath(portID, channelID string) commi
// GetPacketAcknowledgementPath returns the commitment path for a packet acknowledgement.
func (solo *Solomachine) GetPacketAcknowledgementPath(portID, channelID string) commitmenttypes.MerklePath {
path, err := commitmenttypes.ApplyPrefix(prefix, host.PacketAcknowledgementPath(portID, channelID, solo.Sequence))
ackPath := commitmenttypes.NewMerklePath(host.PacketAcknowledgementPath(portID, channelID, solo.Sequence))
path, err := commitmenttypes.ApplyPrefix(prefix, ackPath)
require.NoError(solo.t, err)
return path
@ -302,7 +304,8 @@ func (solo *Solomachine) GetPacketAcknowledgementPath(portID, channelID string)
// GetPacketReceiptPath returns the commitment path for a packet receipt
// and an absent receipts.
func (solo *Solomachine) GetPacketReceiptPath(portID, channelID string) commitmenttypes.MerklePath {
path, err := commitmenttypes.ApplyPrefix(prefix, host.PacketReceiptPath(portID, channelID, solo.Sequence))
receiptPath := commitmenttypes.NewMerklePath(host.PacketReceiptPath(portID, channelID, solo.Sequence))
path, err := commitmenttypes.ApplyPrefix(prefix, receiptPath)
require.NoError(solo.t, err)
return path
@ -310,7 +313,8 @@ func (solo *Solomachine) GetPacketReceiptPath(portID, channelID string) commitme
// GetNextSequenceRecvPath returns the commitment path for the next sequence recv counter.
func (solo *Solomachine) GetNextSequenceRecvPath(portID, channelID string) commitmenttypes.MerklePath {
path, err := commitmenttypes.ApplyPrefix(prefix, host.NextSequenceRecvPath(portID, channelID))
nextSequenceRecvPath := commitmenttypes.NewMerklePath(host.NextSequenceRecvPath(portID, channelID))
path, err := commitmenttypes.ApplyPrefix(prefix, nextSequenceRecvPath)
require.NoError(solo.t, err)
return path

File diff suppressed because it is too large Load Diff