-
Notifications
You must be signed in to change notification settings - Fork 105
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
feat(nexus): query to retrieve transfers #1221
Conversation
2b5f74b
to
d074559
Compare
proto/nexus/v1beta1/query.proto
Outdated
|
||
message TransfersForChainResponse { | ||
repeated Transfer transfers = 1 [ (gogoproto.nullable) = false ]; | ||
int32 count = 2; |
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.
do we really need an extra field @jack0son? You already get the count implicitly with the array
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.
lgtm, one minor note. It allow us to query all archived transfers. we should add limitation or pagination in the future.
// transfers for the specified chain | ||
message TransfersForChainRequest { | ||
string chain = 1; | ||
exported.v1beta1.TransferState state = 2; |
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.
The reason why I originally used a string instead of the actual type was because of the rest RPC endpoint. If we go about it like this, we will need to pass an integer value as a parameter instead of a string. I don't think that is very user friendly.
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.
we don't if we don't translate the request into path parameters (which doesn't make sense with the pagination anymore anyway)
} | ||
|
||
message TransfersForChainResponse { | ||
repeated exported.v1beta1.CrossChainTransfer transfers = 1 |
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 also originally used a custom protobuf to return the transfers because most of the fields of the exported.v1beta1.CrossChainTransfer
type would look weird and some would be redundant, like the Transfer Type field. Unless the microservice does need the full exported.v1beta1.CrossChainTransfer
type?
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.
the response values were literally the same values, just as strings as in CrossChainTransfer
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.
Not quite, because the response now will contain the entire nexus.Chain
struct. I am not sure we need that much information.
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.
ok fair point, I didn't realize it was such a big structure
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.
@jcs47 I don't think for now the chain object is a big issue and we need this in, so if you feel strongly about it, please open another issue/PR to create a leaner response struct 🙂
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.
blocking until fix
Description
Todos
Steps to Test
Expected Behaviour
Other Notes