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

R4R: Gaia Lite Generate Only Support (w/o Keybase) #3396

Merged
merged 28 commits into from
Jan 29, 2019

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Jan 25, 2019

  • Minor CLI context and utils cleanup
  • REST now allows using an address OR key name (just like the CLI ⚡️)
    • This does cause a breaking change (name => from, again just like the CLI ⚡️)
  • Update CompleteAndBroadcastTxREST
    • Remove generate only logic (this now should be handled in each respective REST handler)
    • Use prepareTxBuilder which will allow account number and nonce to be derived from state
  • Update swagger
    • Remove any notion generate_only and simulate as query params (these were deprecated long agooooo)
    • Update name to from
    • Formatting fixes from @faboweb

closes: #3284


  • 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.

  • Wrote tests

  • Updated relevant documentation (docs/)

  • Added entries in PENDING.md with issue #

  • rereviewed Files changed in the github PR explorer


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Aleksandr Bezobchuk added 2 commits January 25, 2019 11:21
- remove gen only logic
- update base req to use from instead of name
- use context to get the from address and name
@alexanderbez alexanderbez added the T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). label Jan 25, 2019
client/utils/rest.go Outdated Show resolved Hide resolved
@alessio alessio removed the prelaunch label Jan 27, 2019
@codecov
Copy link

codecov bot commented Jan 28, 2019

Codecov Report

Merging #3396 into develop will increase coverage by 0.07%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #3396      +/-   ##
===========================================
+ Coverage    59.35%   59.42%   +0.07%     
===========================================
  Files          131      131              
  Lines         9868     9891      +23     
===========================================
+ Hits          5857     5878      +21     
- Misses        3639     3641       +2     
  Partials       372      372

@alexanderbez alexanderbez requested a review from zramsay as a code owner January 28, 2019 18:46
@alexanderbez alexanderbez changed the title WIP: Gaia Lite Generate Only Support (w/o Keybase) R4R: Gaia Lite Generate Only Support (w/o Keybase) Jan 28, 2019
Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

Can we add some tests for the Automatic account number and sequence population when fields are omitted and Generate only functionality no longer requires access to a local Keybase on lcd_test.go ?

client/utils/rest.go Outdated Show resolved Hide resolved
@@ -231,7 +233,12 @@ gaiacli tx send \
--generate-only > unsignedSendTx.json
```

You can now sign the transaction file generated through the `--generate-only` flag by providing your key to the following command:
__Note__: Simulation cannot be used in conjunction with tx generation only
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we have a custom container to make the note bigger ? (check https://vuepress.vuejs.org/guide/markdown.html#custom-containers)

Copy link
Contributor

Choose a reason for hiding this comment

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

And why is the simulation not working in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fedekunze yeah sure, updated!

@faboweb not sure what you mean? Is the comment/note not explanatory enough? You can't use simulate and generate_only together because simulate requires a pubkey and generate_only does not use a Keybase (as requested) and thus you cannot attach a pubkey.

Copy link
Contributor

@faboweb faboweb Jan 29, 2019

Choose a reason for hiding this comment

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

Why does the simulation need a real pubkey?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the same issue: #3423 ?

Copy link
Contributor Author

@alexanderbez alexanderbez Jan 29, 2019

Choose a reason for hiding this comment

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

No, I cannot reproduce #3396 -- "auto" works for me. Simulation needs a public key because a large part of gas estimation is signature verification.

Also note: "gas": "auto" =/= "simulate"

Copy link
Contributor

Choose a reason for hiding this comment

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

ah ok, I missed that those are different things. But for signature verification you could use any pubkey, can't you?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not pollute this PR with the discussion and move it over to #3430

@faboweb
Copy link
Contributor

faboweb commented Jan 28, 2019

Use prepareTxBuilder which will allow account number and nonce to be derived from state

so we don't need to set those? that is probably the awesomest change ever!!!

@alexanderbez
Copy link
Contributor Author

so we don't need to set those? that is probably the awesomest change ever!!!

@faboweb yup! And it was just a one-liner :)

fedekunze and others added 2 commits January 28, 2019 14:24
Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>
@alexanderbez
Copy link
Contributor Author

Can we add some tests for the Automatic account number and sequence population when fields are omitted and Generate only functionality no longer requires access to a local Keybase on lcd_test.go ?

@fedekunze yes, sure thing.

Copy link
Member

@jackzampolin jackzampolin left a comment

Choose a reason for hiding this comment

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

Great changes @alexanderbez LGTM

@jackzampolin jackzampolin merged commit 90797f5 into develop Jan 29, 2019
@alessio alessio deleted the bez/3284-gaia-lite-gen-only-tx branch January 29, 2019 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate_only should create txs without requiring a local key nor password
5 participants