This repository was archived by the owner on Mar 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
eth_createAccessList - Closes #4081 #4332
Merged
Merged
Changes from 9 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
70c4560
Init web3.eth.createAccessList
Spacesai1or e0f7d3e
Init e2e test for createAccessList
Spacesai1or fa89144
Add createAccessList method to method wrappers for contracts
Spacesai1or fcc0a3f
Update failing tests to use dynamic address
Spacesai1or 8cbb6e9
Add check to not run tests if ENV not Geth
Spacesai1or d4ac577
Add createAccessList to docs
Spacesai1or 3328be5
Update CHANGELOG.md
Spacesai1or 90cf5c9
Update docs/web3-eth-contract.rst
ccd31b6
Update docs/web3-eth-contract.rst
e461aa5
Update docs/web3-eth-contract.rst
7b9f8b1
Update docs/web3-eth-contract.rst
ac0cce2
Update docs/web3-eth-contract.rst
f57f64f
Update docs/web3-eth.rst
acca9d1
Merge branch '1.x' into wyatt/1.x/4081-createAccessList
78c466f
Remove duplicate line in CHANGELOG
ce2cdfb
Merge branch '1.x' into wyatt/1.x/4081-createAccessList
Spacesai1or 6972183
Merge branch '1.x' into wyatt/1.x/4081-createAccessList
Spacesai1or f95d35a
Merge branch '1.x' into wyatt/1.x/4081-createAccessList
Spacesai1or 73b81d7
Move CHANGELOG addition to 1.6.1
Spacesai1or b954447
Merge branch '1.x' into wyatt/1.x/4081-createAccessList
Spacesai1or 33de56d
Merge branch '1.x' into wyatt/1.x/4081-createAccessList
Spacesai1or File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,76 @@ | ||
| var assert = require('assert'); | ||
| var Basic = require('./sources/Basic'); | ||
| var Misc = require('./sources/Misc'); | ||
| var utils = require('./helpers/test.utils'); | ||
| var Web3 = utils.getWeb3(); | ||
|
|
||
| describe('method.call [ @E2E ]', function () { | ||
| var web3; | ||
| var accounts; | ||
| var basic; | ||
| var instance; | ||
| var options; | ||
|
|
||
| var basicOptions = { | ||
| data: Basic.bytecode, | ||
| gasPrice: 1000000000, // Default gasPrice set by Geth | ||
| gas: 4000000 | ||
| }; | ||
|
|
||
| var miscOptions = { | ||
| data: Misc.bytecode, | ||
| gasPrice: 1000000000, // Default gasPrice set by Geth | ||
| gas: 4000000 | ||
| }; | ||
|
|
||
| describe('http', function () { | ||
| before(async function () { | ||
| web3 = new Web3('http://localhost:8545'); | ||
| accounts = await web3.eth.getAccounts(); | ||
|
|
||
| basic = new web3.eth.Contract(Basic.abi, basicOptions); | ||
| instance = await basic.deploy().send({from: accounts[0]}); | ||
| }) | ||
|
|
||
| it('returns expected access list for getValue', async function () { | ||
| // Currently only Geth supports eth_createAccessList | ||
| if (process.env.GANACHE || global.window ) return | ||
|
|
||
| var expected = { | ||
| accessList: [ | ||
| { | ||
| address: instance.options.address.toLowerCase(), | ||
| storageKeys: ["0x0000000000000000000000000000000000000000000000000000000000000000"] | ||
| } | ||
| ], | ||
| gasUsed: '0x644e' | ||
| }; | ||
|
|
||
| assert.deepEqual( | ||
| await instance.methods.getValue().createAccessList({from: accounts[0]}), | ||
| expected | ||
| ); | ||
| }); | ||
|
|
||
| it('returns expected access list for setValue', async function () { | ||
| // Currently only Geth supports eth_createAccessList | ||
| if (process.env.GANACHE || global.window ) return | ||
|
|
||
| var expected = { | ||
| accessList: [ | ||
| { | ||
| address: instance.options.address.toLowerCase(), | ||
| storageKeys: ["0x0000000000000000000000000000000000000000000000000000000000000000"] | ||
| } | ||
| ], | ||
| gasUsed: '0xb2f5' | ||
| } | ||
|
|
||
|
|
||
| assert.deepEqual( | ||
| await instance.methods.setValue(1).createAccessList({from: accounts[0]}), | ||
| expected | ||
| ); | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or 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,49 @@ | ||
| var testMethod = require('./helpers/test.method.js'); | ||
|
|
||
| var method = 'createAccessList'; | ||
|
|
||
| var tests = [{ | ||
| args: [{ | ||
| from: '0x3bc5885c2941c5cda454bdb4a8c88aa7f248e312', | ||
| data: '0x20965255', | ||
| gasPrice: '0x3b9aca00', | ||
| gas: '0x3d0900', | ||
| to: '0x00f5f5f3a25f142fafd0af24a754fafa340f32c7' | ||
| }], | ||
| formattedArgs: [ | ||
| { | ||
| from: '0x3bc5885c2941c5cda454bdb4a8c88aa7f248e312', | ||
| data: '0x20965255', | ||
| gasPrice: '0x3b9aca00', | ||
| gas: '0x3d0900', | ||
| to: '0x00f5f5f3a25f142fafd0af24a754fafa340f32c7' | ||
| }, | ||
| 'latest' | ||
| ], | ||
| result: { | ||
| "accessList": [ | ||
| { | ||
| "address": "0x00f5f5f3a25f142fafd0af24a754fafa340f32c7", | ||
| "storageKeys": [ | ||
| "0x0000000000000000000000000000000000000000000000000000000000000000" | ||
| ] | ||
| } | ||
| ], | ||
| "gasUsed": "0x644e" | ||
| }, | ||
| formattedResult: { | ||
| "accessList": [ | ||
| { | ||
| "address": "0x00f5f5f3a25f142fafd0af24a754fafa340f32c7", | ||
| "storageKeys": [ | ||
| "0x0000000000000000000000000000000000000000000000000000000000000000" | ||
| ] | ||
| } | ||
| ], | ||
| "gasUsed": "0x644e" | ||
| }, | ||
| call: 'eth_'+ method | ||
| }]; | ||
|
|
||
| testMethod.runTests('eth', method, tests); | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.