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

Block Time in Txs Response #4007

Merged
merged 10 commits into from
Apr 3, 2019
Merged

Block Time in Txs Response #4007

merged 10 commits into from
Apr 3, 2019

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Mar 29, 2019

  • Add timestamp to TxResponse when querying for tx(s)
  • Cleanup tx querying
    • Move into a single file query.go
    • Move auxiliary logic into utils.go
    • Remove dead code

closes: #3238

/cc @faboweb @dogemos


  • 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 a relevant changelog entry: sdkch add [section] [stanza] [message]

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

@alexanderbez alexanderbez added WIP Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity. labels Mar 29, 2019
@codecov
Copy link

codecov bot commented Mar 29, 2019

Codecov Report

Merging #4007 into develop will decrease coverage by 0.01%.
The diff coverage is 0%.

@@             Coverage Diff             @@
##           develop    #4007      +/-   ##
===========================================
- Coverage    59.76%   59.75%   -0.02%     
===========================================
  Files          211      211              
  Lines        15055    15058       +3     
===========================================
  Hits          8998     8998              
- Misses        5435     5438       +3     
  Partials       622      622

@alexanderbez alexanderbez mentioned this pull request Mar 29, 2019
4 tasks
client/tx/utils.go Outdated Show resolved Hide resolved
}

// NewResponseResultTx returns a TxResponse given a ResultTx from tendermint
func NewResponseResultTx(res *ctypes.ResultTx, tx Tx) TxResponse {
func NewResponseResultTx(res *ctypes.ResultTx, tx Tx, timestamp string) TxResponse {
Copy link
Member

Choose a reason for hiding this comment

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

++

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we get a test case for this? It would give a tiny boost to our coverage report

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A test case for the constructor?

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, it sounds dumb but it'd be easy and we would reduce the impact on the coverage report

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.

Good improvement and nice cleanup of that package.

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.

some minor comments, otherwise LGTM

client/tx/query.go Outdated Show resolved Hide resolved
client/tx/query.go Outdated Show resolved Hide resolved
client/tx/utils.go Show resolved Hide resolved
client/tx/utils.go Show resolved Hide resolved
res, err := node.TxSearch(query, prove, page, perPage)
if err != nil {
return nil, err
func queryTxs(cliCtx context.CLIContext, cdc *codec.Codec, tag string, delegatorAddr string) ([]sdk.TxResponse, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

actually I think we can delete the staking query tx endpoint. It's a dup from regular tx query, the main difference is that you don't need to specify tags, which is silly

Copy link
Collaborator

Choose a reason for hiding this comment

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

^^ would be api-breaking

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, but let's save that for another issue/PR -- would like to avoid as much scope creep as possible. Mind opening an issue?

fedekunze and others added 2 commits April 2, 2019 20:47
Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>
Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com>
@alexanderbez alexanderbez merged commit e2928d5 into develop Apr 3, 2019
@alexanderbez alexanderbez deleted the bez/3238-txs-block-time branch April 3, 2019 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add transaction time in gaia lite
5 participants