Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

return eth tx hash to client #202

Merged
merged 2 commits into from
Jun 30, 2021
Merged

return eth tx hash to client #202

merged 2 commits into from
Jun 30, 2021

Conversation

yihuang
Copy link
Contributor

@yihuang yihuang commented Jun 29, 2021

Closes #67

Description

  • SendTransaction return eth tx hash to client
  • GetTransaction convert eth hash to tm hash by calling /tx_search.
  • Use eth tx hash internally

Verified in external integration test:

    signed = eth_account.Account.sign_transaction(tx, VALIDATOR_PRIV_KEY)
    txhash = w3.eth.sendRawTransaction(signed.rawTransaction)
    assert txhash == signed.hash, 'invalid tx hash'
    time.sleep(5)
    tx = w3.eth.getTransactionReceipt(txhash)
    print("tx receipt", tx)

For contributor use:

  • 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

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@yihuang yihuang marked this pull request as draft June 29, 2021 09:16
@yihuang yihuang marked this pull request as ready for review June 29, 2021 09:20
Copy link
Contributor

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

Looks good. Minor suggestions only. Can you add a changelog entry and create an issue to write a test for this?

ethereum/rpc/namespaces/eth/api.go Outdated Show resolved Hide resolved
ethereum/rpc/namespaces/eth/api.go Outdated Show resolved Hide resolved
ethereum/rpc/namespaces/eth/api.go Outdated Show resolved Hide resolved
Copy link
Contributor

@leejw51crypto leejw51crypto left a comment

Choose a reason for hiding this comment

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

lgtm

@yihuang
Copy link
Contributor Author

yihuang commented Jun 30, 2021

Looks good. Minor suggestions only. Can you add a changelog entry and create an issue to write a test for this?

done
#209

@codecov
Copy link

codecov bot commented Jun 30, 2021

Codecov Report

Merging #202 (64c674d) into main (036ffb7) will increase coverage by 20.67%.
The diff coverage is 100.00%.

❗ Current head 64c674d differs from pull request most recent head e87b642. Consider uploading reports for the commit e87b642 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##             main     #202       +/-   ##
===========================================
+ Coverage   46.90%   67.57%   +20.67%     
===========================================
  Files          43        9       -34     
  Lines        2889      808     -2081     
===========================================
- Hits         1355      546      -809     
+ Misses       1463      238     -1225     
+ Partials       71       24       -47     
Impacted Files Coverage Δ
app/app.go 86.40% <100.00%> (-0.06%) ⬇️
types/codec.go
x/evm/types/query.pb.gw.go
types/int.go
x/evm/types/codec.go
x/evm/module.go
x/evm/types/params.go
types/config.go
types/validation.go
x/evm/keeper/abci.go
... and 21 more

@yihuang yihuang force-pushed the convert-tx-hash branch 3 times, most recently from 0c4e6b4 to 1f29322 Compare June 30, 2021 06:38
@fedekunze
Copy link
Contributor

fedekunze commented Jun 30, 2021

@yihuang can you fix the build errors? 🙏

Closes #67

Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

change GetTxByEthHash to method

add entry to changelog
@yihuang
Copy link
Contributor Author

yihuang commented Jun 30, 2021

@yihuang can you fix the build errors? 🙏

fixed and rebased.

@fedekunze fedekunze merged commit 0113b4d into evmos:main Jun 30, 2021
@yihuang yihuang deleted the convert-tx-hash branch July 5, 2021 01:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent transaction hashing with Tendermint
3 participants