-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #309 from m-Peter/eth-get-tx-by-hash-add-chain-id
Add missing fields to the response of `eth_getTransactionByHash`
- Loading branch information
Showing
7 changed files
with
123 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const { assert } = require('chai') | ||
const conf = require('./config') | ||
const helpers = require('./helpers') | ||
const web3 = conf.web3 | ||
|
||
it('returns proper response for eth_getTransactionByHash', async () => { | ||
let deployed = await helpers.deployContract('storage') | ||
let contractAddress = deployed.receipt.contractAddress | ||
|
||
// make sure deploy results are correct | ||
assert.equal(deployed.receipt.status, conf.successStatus) | ||
|
||
let updateData = deployed.contract.methods.store(1337).encodeABI() | ||
let result = await helpers.signAndSend({ | ||
from: conf.eoa.address, | ||
to: contractAddress, | ||
data: updateData, | ||
gas: 25000, | ||
value: 0, | ||
maxFeePerGas: 3000000000, | ||
maxPriorityFeePerGas: 800000000, | ||
}) | ||
assert.equal(result.receipt.status, conf.successStatus) | ||
|
||
let tx = await web3.eth.getTransactionFromBlock(result.receipt.blockNumber, 0) | ||
assert.equal(tx.type, 2n) | ||
assert.deepEqual(tx.accessList, []) | ||
assert.equal(tx.chainId, 646n) | ||
assert.equal(tx.gas, 25000n) | ||
assert.equal(tx.maxFeePerGas, 3000000000n) | ||
assert.equal(tx.maxPriorityFeePerGas, 800000000n) | ||
assert.equal(tx.gasPrice, 3000000000n) | ||
}).timeout(10 * 1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters