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] Transaction ValidateBasic #2863

Merged
merged 10 commits into from
Nov 21, 2018
Merged

[R4R] Transaction ValidateBasic #2863

merged 10 commits into from
Nov 21, 2018

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Nov 19, 2018

  • Add ValidateBasic to the sdk.Tx interface
  • Update auth.StdTx to implement said interface
  • Update ante handler to call ValidateBasic.
    • Note, this check could (maybe should?) live in BaseApp, but having in the ante handler paved the way of least resistance in terms of changing unit tests.

closes: #2779


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

@codecov
Copy link

codecov bot commented Nov 19, 2018

Codecov Report

❗ No coverage uploaded for pull request base (develop@d8bbf85). Click here to learn what that means.
The diff coverage is 97.05%.

@@            Coverage Diff            @@
##             develop   #2863   +/-   ##
=========================================
  Coverage           ?   56.9%           
=========================================
  Files              ?     120           
  Lines              ?    8278           
  Branches           ?       0           
=========================================
  Hits               ?    4711           
  Misses             ?    3249           
  Partials           ?     318

@alexanderbez alexanderbez requested a review from alessio November 19, 2018 20:42
@alexanderbez alexanderbez changed the title [WIP] Transaction ValidateBasic [R4R] Transaction ValidateBasic Nov 20, 2018
@alexanderbez alexanderbez added ready-for-review T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). and removed non-breaking labels Nov 20, 2018
@alexanderbez
Copy link
Contributor Author

CI integration_tests failing due an unrelated regression on develop.

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

I think we should move one check into ValidateBasic - otherwise LGTM.

x/auth/stdtx.go Show resolved Hide resolved
x/auth/stdtx_test.go Show resolved Hide resolved

// ValidateBasic does a simple and lightweight validation check that doesn't
// require access to any other information.
ValidateBasic() Error
Copy link
Contributor

Choose a reason for hiding this comment

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

I know that it's been quite conventional so far to call this ValidateBasic. Though I've never seen any other function being called ValidateAdvanced :)

So why not naming this Validate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lol...touché. Perhaps for another PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah definitely not a blocking issue 👍

@alexanderbez
Copy link
Contributor Author

@cwgoes addressed your review

@cwgoes
Copy link
Contributor

cwgoes commented Nov 20, 2018

ACK, this should see one more review (perhaps @alessio).

@cwgoes cwgoes merged commit 1ea0e4c into develop Nov 21, 2018
@cwgoes cwgoes deleted the bez/2779-tx-basic-validation branch November 21, 2018 10:17
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.

Add ValidateBasic to Tx interface (or just StdTx)
3 participants