Skip to content

Commit

Permalink
Last bit of personal namespace cleanup; newsfragment for ethereum#3350
Browse files Browse the repository at this point in the history
- Clean up some unnecessary changes related to removing personal namespace
- bonus: re-generate fixture for making sure we have all changes in related to ethereum#3350
  • Loading branch information
fselmo committed Apr 17, 2024
1 parent 80a746b commit 055cc3d
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 16 deletions.
1 change: 0 additions & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ These files define all methods callable under
web3.db.\*
web3.eth.\*
web3.net.\*
web3.personal.\*

```
Methods and properties are first defined as a dictionary
Expand Down
1 change: 1 addition & 0 deletions newsfragments/3350.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove the deprecated ``personal`` namespace and all references to it.
5 changes: 4 additions & 1 deletion tests/integration/generate_fixtures/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
KEYFILE_DATA = '{"address":"dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd","crypto":{"cipher":"aes-128-ctr","ciphertext":"52e06bc9397ea9fa2f0dae8de2b3e8116e92a2ecca9ad5ff0061d1c449704e98","cipherparams":{"iv":"aa5d0a5370ef65395c1a6607af857124"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"9fdf0764eb3645ffc184e166537f6fe70516bf0e34dc7311dea21f100f0c9263"},"mac":"4e0b51f42b865c15c485f4faefdd1f01a38637e5247f8c75ffe6a8c0eba856f6"},"id":"5a6124e0-10f1-4c1c-ae3e-d903eacb740a","version":3}' # noqa: E501

KEYFILE_PW = "web3py-test"
KEYFILE_PW_TXT = "keystore_pw.txt"
KEYFILE_PW_TXT = "pw.txt"
KEYFILE_FILENAME = "UTC--2017-08-24T19-42-47.517572178Z--dc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd" # noqa: E501

RAW_TXN_ACCOUNT = "0x39EEed73fb1D3855E90Cbd42f348b3D7b340aAA6"
Expand All @@ -52,6 +52,9 @@
"arrowGlacierBlock": 0,
"grayGlacierBlock": 0,
"shanghaiTime": 0,
# TODO: Remove this once this bug is fixed. We need to set TTD to -1 and
# `difficulty` to `0` to trick geth into using the correct EVM rules for
# `eth_estimateGas`. See: github.com/ethereum/go-ethereum/issues/29404
"terminalTotalDifficulty": -1,
"terminalTotalDifficultyPassed": True,
},
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/generate_fixtures/go_ethereum.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def get_geth_process(geth_binary, datadir, geth_port):
"--port",
geth_port,
"--password",
os.path.join(datadir, "keystore_pw.txt"),
os.path.join(datadir, "keystore", "pw.txt"),
)

popen_proc = subprocess.Popen(
Expand Down Expand Up @@ -139,7 +139,7 @@ def generate_go_ethereum_fixture(destination_dir):
keyfile_path = os.path.join(keystore_dir, common.KEYFILE_FILENAME)
with open(keyfile_path, "w") as keyfile:
keyfile.write(common.KEYFILE_DATA)
keyfile_pw = os.path.join(datadir, common.KEYFILE_PW_TXT)
keyfile_pw = os.path.join(keystore_dir, common.KEYFILE_PW_TXT)
with open(keyfile_pw, "w") as keyfile_pw_file:
keyfile_pw_file.write(common.KEYFILE_PW)
genesis_file_path = os.path.join(datadir, "genesis.json")
Expand Down
Binary file modified tests/integration/geth-1.13.14-fixture.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/integration/go_ethereum/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def base_geth_command_arguments(geth_binary, datadir):
"--dev.period",
"5", # dev.period > 1 for tests which require pending blocks
"--password",
os.path.join(datadir, "keystore_pw.txt"),
os.path.join(datadir, "keystore", "pw.txt"),
)


Expand Down
2 changes: 1 addition & 1 deletion tests/integration/go_ethereum/test_goethereum_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def geth_command_arguments(rpc_port, base_geth_command_arguments, get_geth_versi


@pytest.fixture(scope="module")
def w3(geth_process, endpoint_uri, geth_fixture_data, get_geth_version, datadir):
def w3(geth_process, endpoint_uri):
wait_for_http(endpoint_uri)
return Web3(Web3.HTTPProvider(endpoint_uri))

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/go_ethereum/test_goethereum_ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def geth_ipc_path(datadir):


@pytest.fixture(scope="module")
def w3(geth_process, geth_ipc_path, geth_fixture_data):
def w3(geth_process, geth_ipc_path):
wait_for_socket(geth_ipc_path)
return Web3(Web3.IPCProvider(geth_ipc_path, timeout=30))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


@pytest_asyncio.fixture(scope="module")
async def async_w3(geth_process, endpoint_uri, geth_fixture_data):
async def async_w3(geth_process, endpoint_uri):
await wait_for_aiohttp(endpoint_uri)

# await the persistent connection itself
Expand Down
10 changes: 2 additions & 8 deletions web3/tools/benchmark/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@

GETH_FIXTURE_ZIP = "geth-1.13.14-fixture.zip"

# use same coinbase value as in `web3.py/tests/integration/generate_fixtures/common.py`
COINBASE = "0xdc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd"


class GethBenchmarkFixture:
def __init__(self) -> None:
Expand Down Expand Up @@ -84,19 +81,16 @@ def _geth_command_arguments(self, datadir: str) -> Sequence[str]:
"--dev.period",
"100",
"--datadir",
str(datadir),
datadir,
"--nodiscover",
"--http",
"--http.port",
self.rpc_port,
"--http.api",
"admin,eth,net,web3",
"--ipcdisable",
"--allow-insecure-unlock",
"--miner.etherbase",
COINBASE[2:],
"--password",
os.path.join(datadir, "keystore_pw.txt"),
os.path.join(datadir, "keystore", "pw.txt"),
)

def _geth_process(
Expand Down

0 comments on commit 055cc3d

Please sign in to comment.