Skip to content
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

Merged
merged 11 commits into from
Jan 17, 2022
Merged

Conversation

jcs47
Copy link
Contributor

@jcs47 jcs47 commented Jan 16, 2022

Description

Todos

  • Unit tests
  • Manual tests
  • Documentation
  • Connect epics/issues
  • Tag type of change

Steps to Test

Expected Behaviour

Other Notes

@jcs47 jcs47 added the enhancement New feature or request label Jan 16, 2022
@sdaveas sdaveas force-pushed the nexus_query_transfers branch 2 times, most recently from 2b5f74b to d074559 Compare January 16, 2022 18:09

message TransfersForChainResponse {
repeated Transfer transfers = 1 [ (gogoproto.nullable) = false ];
int32 count = 2;
Copy link
Contributor

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

proto/nexus/v1beta1/query.proto Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Copy link
Contributor

@haiyizxx haiyizxx left a 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;
Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

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 🙂

Copy link
Contributor

@cgorenflo cgorenflo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocking until fix

@cgorenflo cgorenflo merged commit 976ea95 into main Jan 17, 2022
@cgorenflo cgorenflo deleted the nexus_query_transfers branch January 17, 2022 01:53
fish-sammy added a commit that referenced this pull request Jan 18, 2022
Co-authored-by: jcs47 <joao@axelar.network>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants