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

feat: API for EthGetMessageCidByTransactionHash #10055

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

geoff-vball
Copy link
Contributor

Related Issues

Proposed Changes

Implements an API endpoint for getting a message CID from an Ethereum Transaction Hash.

Fixes a bug in EthGetTransactionHashByCid where it would return a transaction hash even if the message didn't exist.

EthGetTransactionHashByCid will now return a transaction hash iff the message for the given cid is found in the node's store.

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@geoff-vball geoff-vball requested a review from a team as a code owner January 18, 2023 21:53
@geoff-vball geoff-vball force-pushed the gstuart/tx-hash-to-msg-cid branch 3 times, most recently from f87d4d4 to b919bb5 Compare January 18, 2023 22:05
@geoff-vball geoff-vball force-pushed the gstuart/tx-hash-to-msg-cid branch from b919bb5 to 5133b9d Compare January 18, 2023 22:48
Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

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

Logic LGTM, but looks like we're missing a positive test?

@@ -299,8 +300,53 @@ func (a *EthModule) EthGetTransactionByHash(ctx context.Context, txHash *ethtype
return nil, nil
}

func (a *EthModule) EthGetMessageCidByTransactionHash(ctx context.Context, txHash *ethtypes.EthHash) (*cid.Cid, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we're missing a positive test for this?

@jennijuju jennijuju merged commit a7374a9 into release/v1.20.0 Jan 19, 2023
@jennijuju jennijuju deleted the gstuart/tx-hash-to-msg-cid branch January 19, 2023 01:00
jennijuju added a commit that referenced this pull request Jan 19, 2023
@jennijuju jennijuju added this to the Network v18 milestone Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants