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

Added getBlockdDetails method [AKI-351] #974

Merged
merged 2 commits into from
Sep 11, 2019
Merged

Conversation

dev-dennis-guye
Copy link

@dev-dennis-guye dev-dennis-guye commented Sep 3, 2019

Description

This change adds a new ops_getBlockDetails method which returns a blockdetails similar to the blockdetails found in the Java API.

Fixes Issue # AKI-351

Type of change

  • Bug fix.
  • New feature.
  • Enhancement.
  • Unit test.
  • Breaking change (a fix or feature that causes existing functionality to not work as expected).
  • Requires documentation update.

Testing

  • deployed the build and synced to mainnet
  • executed requests using blocks that contained no transaction, one transaction and more than one transaction. Requests made:
curl localhost:8545 -H 'Content-Type: application/json' -s -d '{"json-Mc":"2.0","method":"ops_getBlockDetails","params": [1]}'
curl localhost:8545 -H 'Content-Type: application/json' -s -d '{"json-Mc":"2.0","method":"ops_getBlockDetails","params": {"block":6753}}'
curl 192.168.1.67:8545 -H 'Content-Type: application/json' -s -d '{"json-Mc":"2.0","method":"ops_getBlockDetails","params": [1174759]}'
  • added functional test cases to the dashboard ETL

@dev-dennis-guye dev-dennis-guye changed the title Added getTransactionDetailsEndpoint [AKI-351] Added getBlockdDetails method [AKI-351] Sep 5, 2019
Copy link
Contributor

@aion-kelvin aion-kelvin left a comment

Choose a reason for hiding this comment

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

Hey, looks pretty good overall, but have a few questions/suggestions. Also, would it be possible to add some tests around this?

@aion-kelvin
Copy link
Contributor

Looks good. One last thing -- can you also check that the following all give the same result? Looking at the code, I think they do, but just want to see it work in real life ... if these are all equivalent, then let's merge it:

curl localhost:8545 -H 'Content-Type: application/json' -s -d '{"jsonrpc":"2.0","method":"ops_getBlockDetails","params": [11]}'

curl localhost:8545 -H 'Content-Type: application/json' -s -d '{"jsonrpc":"2.0","method":"ops_getBlockDetails","params": ["11"]}'

curl localhost:8545 -H 'Content-Type: application/json' -s -d '{"jsonrpc":"2.0","method":"ops_getBlockDetails","params": ["0xb"]}'

@dev-dennis-guye
Copy link
Author

The change was re-tested using the following requests and re-running the tests in the dashboard ETL code.

curl localhost:8545 -H 'Content-Type: application/json' -s -d '{"json-Mc":"2.0","method":"ops_getBlockDetailsByNumber","params": {"block":"0x1"}}' | jq  -M
curl localhost:8545 -H 'Content-Type: application/json' -s -d '{"json-Mc":"2.0","method":"ops_getBlockDetailsByNumber","params": {"block": 1}}' | jq  -M
curl localhost:8545 -H 'Content-Type: application/json' -s -d '{"json-Mc":"2.0","method":"ops_getBlockDetailsByNumber","params": [1]}' | jq  -M
curl localhost:8545 -H 'Content-Type: application/json' -s -d '{"json-Mc":"2.0","method":"ops_getBlockDetailsByNumber","params": ["0x1"]}' | jq  -M
curl localhost:8545 -H 'Content-Type: application/json' -s -d '{"json-Mc":"2.0","method":"ops_getBlockDetailsByHash","params": [0x28375cc29c3ba1b76f36de5a486eac814b566f488c6c98a30dfea854f7f2671a]}' | jq  -M
curl localhost:8545 -H 'Content-Type: application/json' -s -d '{"json-Mc":"2.0","method":"ops_getBlockDetailsByHash","params": {"block":0x28375cc29c3ba1b76f36de5a486eac814b566f488c6c98a30dfea854f7f2671a}}' | jq  -M

@dev-dennis-guye dev-dennis-guye merged commit 1290b5d into master Sep 11, 2019
@AionJayT AionJayT deleted the txdetails-rpc branch October 1, 2019 15:50
@AionJayT AionJayT added this to the 0.4.2 milestone Oct 7, 2019
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