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

REST tx endpoint backwards compatibility #6801

Merged
merged 15 commits into from
Jul 30, 2020
Merged

Conversation

sahith-narahari
Copy link
Contributor

@sahith-narahari sahith-narahari commented Jul 20, 2020

Description

Migrates x/auth encode, decode and broadcast REST endpoints, as well as REST tx endpoints in general.

This does conversion to the native tx format (protobuf or amino) behind the scenes allowing existing clients to still submit amino JSON StdTx transactions to protobuf blockchains.

ref: #6213


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@sahith-narahari sahith-narahari changed the title update rest endpoints Update auth rest endpoints Jul 20, 2020
@codecov
Copy link

codecov bot commented Jul 20, 2020

Codecov Report

Merging #6801 into master will decrease coverage by 0.16%.
The diff coverage is 18.33%.

@@            Coverage Diff             @@
##           master    #6801      +/-   ##
==========================================
- Coverage   61.56%   61.40%   -0.17%     
==========================================
  Files         511      517       +6     
  Lines       31879    32050     +171     
==========================================
+ Hits        19626    19679      +53     
- Misses      10701    10802     +101     
- Partials     1552     1569      +17     

aaronc
aaronc previously requested changes Jul 29, 2020
x/auth/client/rest/broadcast.go Outdated Show resolved Hide resolved
x/auth/client/rest/decode.go Outdated Show resolved Hide resolved
@aaronc aaronc changed the title Update auth rest endpoints REST tx endpoint backwards compatibility Jul 30, 2020
@aaronc aaronc marked this pull request as ready for review July 30, 2020 02:29
@aaronc aaronc dismissed their stale review July 30, 2020 02:38

I picked up the PR

@aaronc aaronc requested review from aaronc, anilcse and atheeshp and removed request for aaronc, alessio, clevinson, anilcse, jgimeno and alexanderbez July 30, 2020 02:46
@aaronc
Copy link
Member

aaronc commented Jul 30, 2020

Sorry about the review request chatter. There's a bug on github mobile

client/tx/legacy.go Outdated Show resolved Hide resolved
client/tx/legacy.go Show resolved Hide resolved
x/auth/client/rest/encode.go Outdated Show resolved Hide resolved
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

reviewed:

  • client/tx/legacy.go and tests
  • x/auth/client/rest/{decode,encode} and tests

they lgtm, though I'm not super familiar with the code either.

x/auth/client/rest.go Show resolved Hide resolved
@aaronc
Copy link
Member

aaronc commented Jul 30, 2020

@fedekunze I have did what I could to increase test coverage including:

  • covering both amino and proto cases with unit tests in the same build where possible
  • adding an integration test for broadcast (previously encode, decode and broadcast were all missing integration tests)

There are likely still some cases that are hard to trigger with a test (such as passing in a Tx which doesn't implement SigFeeMemoTx because there isn't one), but my sense is that most things are now better covered.

Let me know what you think.

@aaronc aaronc requested a review from fedekunze July 30, 2020 14:17
@fedekunze fedekunze merged commit c7ad21d into master Jul 30, 2020
@fedekunze fedekunze deleted the sahith/mig-auth-rest branch July 30, 2020 14:45
@aaronc aaronc mentioned this pull request Jul 30, 2020
27 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants