-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add & update IBC queriers for relayer use #5901
Conversation
Codecov Report
@@ Coverage Diff @@
## ibc-alpha #5901 +/- ##
=============================================
- Coverage 59.30% 59.25% -0.06%
=============================================
Files 397 397
Lines 22988 23015 +27
=============================================
+ Hits 13634 13638 +4
- Misses 8434 8457 +23
Partials 920 920 |
x/ibc/03-connection/types/querier.go
Outdated
@@ -15,10 +15,16 @@ const ( | |||
QueryClientConnections = "client_connections" | |||
) | |||
|
|||
// IdentifiedConnectionEnd defines the union of a connection end & an identifier. | |||
type IdentifiedConnectionEnd struct { | |||
ConnectionEnd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think (?) this should use a pointer *ConnectionEnd
. I'd also double-check that the JSON field is "connection_end" instead of "ConnectionEnd"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the idea was to embed the JSON fields - does that not work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working on the relayer fwiw, but would be helpful to add a json tag: json:"connection_end"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[
{
"ConnectionEnd": {
"state": "OPEN",
"client_id": "ibconeclient",
"counterparty": {
"client_id": "ibczeroclient",
"connection_id": "ibczeroconnection",
"prefix": {
"type": "ibc/commitment/MerklePrefix",
"value": {
"key_prefix": "aWJj"
}
}
},
"versions": [
"1.0.0"
]
},
"identifier": "ibconeconnection"
}
]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah my bad - updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
open to suggestion but wouldn't it be cleaner to add the identifier to the IdentifiedConnectionEnd
flattened?
[
{
"identifier": "ibconeconnection",
"state": "OPEN",
"client_id": "ibconeclient",
"counterparty": {
"client_id": "ibczeroclient",
"connection_id": "ibczeroconnection",
"prefix": {
"type": "ibc/commitment/MerklePrefix",
"value": {
"key_prefix": "aWJj"
}
}
},
"versions": [
"1.0.0"
]
}
]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was what I originally tried to do - how does one do that in Go (is that what the pointer is for)?
This is ready to go! |
Closes #5829
Closes #5617
Note that for #5617 all channels are still iterated over, since we don't store a reverse mapping from connection identifiers to a set of channels. I think this is fine for now - we don't really want to store that in Merklized state since there is no reason to use it in the state machine.