-
Notifications
You must be signed in to change notification settings - Fork 9
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
GREEN-42 add gasUsed and transaction root for returned block data #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove ^ in version.
Address other issue with misspelled parameter.
Retest
package.json
Outdated
@@ -36,6 +36,7 @@ | |||
"got": "11.8.6", | |||
"jayson": "3.6.5", | |||
"jsonwebtoken": "9.0.0", | |||
"merkle-patricia-tree": "^4.2.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove carat in version.
src/external/Collector.ts
Outdated
// Now we have the block gas used then return it to the RPC method | ||
resultBlock.gasUsed = blockGasUsed | ||
// Start to calculate the transaction root fot this block | ||
resultBlock.transactionsRoot = await this.calculateTransactionRoot(readableBlock.tranactions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be misspelled. Am not sure how this could have worked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build does not compile
~/shardus/npm-release/json-rpc-server$ npm run compile
[email protected] compile
tsc -p .
src/external/Collector.ts:20:27 - error TS2307: Cannot find module 'ethers' or its corresponding type declarations.
20 import { BigNumber } from 'ethers'
~~~~~~~~
Found 1 error.
src/external/Collector.ts
Outdated
|
||
import { BaseTrie } from 'merkle-patricia-tree' | ||
import RLP from 'rlp' | ||
import { BigNumber } from 'ethers' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the import lib has to be @ethersproject/bignumber
src/external/Collector.ts
Outdated
@@ -245,6 +247,19 @@ class Collector extends BaseExternal { | |||
return await this.inner_getBlock(blockSearchValue, blockSearchType, details) | |||
} | |||
|
|||
async calculateTransactionRoot(txns: String[]): Promise<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the correct type has to be string
By changing the command npm ci to npm i in both smoke tests 10+10 and 25+5, these two tests were passed 25+5: https://devs-work.shardeum.org/job/Testing/job/Smoke/job/work_in_progress/job/wip_green_25_plus_5/2/ |
e003c85
to
f220900
Compare
Add block gasUsed and transaction root to the returned block data