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

[ETCM-126] getRawTransactionBy* #720

Merged
merged 20 commits into from
Oct 9, 2020
Merged

Conversation

lemastero
Copy link
Contributor

@lemastero lemastero commented Oct 2, 2020

Description

Add support for:

Proposed Solution

Important Changes Introduced

  • HTTP model:
    GetRawTransactionByHashRequest
    GetRawTransactionByHashResponse
  • add getRawTransactionByHash in EthService, that reuse logic from existing: getTransactionByHash, extracted common logic to getTransactionDataByHash that returns TransactionData
  • handle eth_getRawTransactionByHash route JsonRpcController
  • simplify SignedTransactionEnc
  • getRawTransactionByBlockHashAndIndexRequest has different implementation than getTransactionByBlockHashAndIndexRequest, I needed signed transaction, please double check this logic

Testing

It looks like it is not possible to write it rpcTest in RpcApiTests there is no getRawTransactionByHash in web3j Ethereum

@lemastero lemastero force-pushed the ETCM-126-get-raw-transaction branch from e4a4c4c to 79e3d9b Compare October 5, 2020 10:07
@lemastero lemastero changed the title [ETCM-126] get raw transaction WIP [ETCM-126] get raw transaction Oct 5, 2020
@lemastero lemastero changed the title WIP [ETCM-126] get raw transaction [ETCM-126] getRawTransactionBy* Oct 5, 2020
@lemastero lemastero marked this pull request as ready for review October 5, 2020 17:18
@lemastero lemastero requested review from mmrozek and kapke October 5, 2020 17:19
Copy link
Contributor

@mmrozek mmrozek left a comment

Choose a reason for hiding this comment

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

Looks ok. Please add some examples to the insomnia workspace

@lemastero
Copy link
Contributor Author

Please add some examples to the insomnia workspace

@mmrozek insomnia JSON is updated. Nice catch thank you :)

Copy link
Contributor

@mmrozek mmrozek left a comment

Choose a reason for hiding this comment

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

lgtm!

@lemastero
Copy link
Contributor Author

@kapke @mmrozek please rereview.

Copy link
Contributor

@kapke kapke left a comment

Choose a reason for hiding this comment

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

Minor things only. Overall looks good to me!
Please note though, that commit messages are usually prefixed with jira ticket, so they should be like [ETCM-126] <the message>

Some(JInt(1))
)

val response = jsonRpcController.handleRequest(request).futureValue
Copy link
Contributor

Choose a reason for hiding this comment

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

there is set of additional matchers for rpc responses in io.iohk.ethereum.jsonrpc.JRCMatchers, it allows to compare result only, so less boilerplate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Custom marchers from JRCMatchers were used to simplify tests: 7bb0d21

lemastero added 17 commits October 9, 2020 13:25
…o ByteString to EthJsonMethodsImplicits from EthService
@lemastero lemastero force-pushed the ETCM-126-get-raw-transaction branch from 8f1bcd9 to 6912d15 Compare October 9, 2020 11:27
@lemastero
Copy link
Contributor Author

commit messages are usually prefixed with jira ticket, so they should be like [ETCM-126] <the message>

I like that convention 👍 All commit were reworded to have [ETCM-126] prefix: https://github.com/input-output-hk/mantis/pull/720/commits

@mmrozek
Copy link
Contributor

mmrozek commented Oct 9, 2020

If you renamed all commits you could squash all commit to one as well ;)

Signed-off-by: lemastero <piotr.paradzinski@iohk.io>
@lemastero
Copy link
Contributor Author

lemastero commented Oct 9, 2020

If you renamed all commits you could squash all commit to one as well

@mmrozek How about making a squash on merge into develop branch?

Pros:

  • PR's have a nice history of changes.
  • PR can be easily reverted from develop if needed
  • it is easier to make release notes etc

Cons:

  • if you have PR's depending on other PR's it is a bit harder to update them (but the same problem exists when one do rebase)

@mmrozek
Copy link
Contributor

mmrozek commented Oct 9, 2020

I prefer to use squash commits to merge. Especially in cases like this one, when you have a linear history

@lemastero lemastero merged commit 8a18c76 into develop Oct 9, 2020
@lemastero lemastero deleted the ETCM-126-get-raw-transaction branch October 16, 2020 19:07
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