Skip to content

Commit c200f94

Browse files
authored
general improvements (#189)
1 parent a968d6f commit c200f94

File tree

12 files changed

+636
-1735
lines changed

12 files changed

+636
-1735
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
go-version: [1.23.x,1.24.x]
20+
go-version: [1.24.x,1.25.x]
2121
os: [ubuntu-latest, macos-latest]
2222

2323
runs-on: ${{ matrix.os }}

Makefile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ install:
5656
# Run baseline tests
5757
test: check-testchain-running go-test
5858

59-
# Run testchain and tests concurrently
60-
test-concurrently:
61-
cd ./tools/testchain && pnpm concurrently -k --success first 'pnpm start:hardhat' 'cd ../.. && make go-test'
62-
6359
# Run tests with reorgme
6460
test-with-reorgme: check-reorgme-running
6561
REORGME=true $(MAKE) go-test
@@ -80,13 +76,13 @@ tools:
8076
cd ./ethtest/testchain && pnpm install
8177
cd ./ethtest/reorgme && pnpm install
8278

83-
bootstrap:
84-
cd ./ethtest/testchain && pnpm install
85-
8679

8780
#
8881
# Testchain
8982
#
83+
init-testchain:
84+
cd ./ethtest/testchain && pnpm install
85+
9086
start-testchain:
9187
cd ./ethtest/testchain && pnpm start:hardhat
9288

@@ -107,7 +103,7 @@ start-testchain-anvil-verbose:
107103

108104
check-testchain-running:
109105
@curl http://localhost:8545 -H"Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' --write-out '%{http_code}' --silent --output /dev/null | grep 200 > /dev/null \
110-
|| { echo "*****"; echo "Oops! testchain is not running. Please run 'make start-testchain' in another terminal or use 'test-concurrently'."; echo "*****"; exit 1; }
106+
|| { echo "*****"; echo "Oops! testchain is not running. Please run 'make start-testchain' in another terminal."; echo "*****"; exit 1; }
111107

112108

113109
#

cmd/ethkit/wallet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func init() {
3232
cmd.Flags().Bool("print-private-key", false, "print wallet private key from keyfile (danger!)")
3333
cmd.Flags().Bool("import-mnemonic", false, "import a secret mnemonic to a new keyfile")
3434
cmd.Flags().Int("entropy", 256, "set entropy bit size for new wallet, options: 128, 256 (default: 256)")
35-
cmd.Flags().String("path", "", fmt.Sprintf("set derivation path, default: %s", ethwallet.DefaultWalletOptions.DerivationPath))
35+
cmd.Flags().String("path", "", fmt.Sprintf("set derivation path, default: %s", ethwallet.DefaultWalletOptions().DerivationPath))
3636

3737
rootCmd.AddCommand(cmd)
3838
}
@@ -185,7 +185,7 @@ func (c *wallet) createNew() error {
185185

186186
derivationPath := c.fPath
187187
if derivationPath == "" {
188-
derivationPath = ethwallet.DefaultWalletOptions.DerivationPath
188+
derivationPath = ethwallet.DefaultWalletOptions().DerivationPath
189189
}
190190

191191
c.wallet, err = getWallet(importMnemonic, derivationPath, c.fEntropy)

ethtest/testchain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (c *Testchain) MustWallet(optAccountIndex ...uint32) *ethwallet.Wallet {
114114
panic(err)
115115
}
116116
if len(optAccountIndex) > 0 {
117-
_, err = wallet.SelfDeriveAccountIndex(optAccountIndex[0])
117+
wallet, _, err = wallet.DeriveFromAccountIndex(optAccountIndex[0])
118118
if err != nil {
119119
panic(err)
120120
}
Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
// see https://hardhat.org/hardhat-network/docs/reference#config
2-
module.exports = {
3-
solidity: "0.8.28",
2+
export default {
3+
solidity: {
4+
version: "0.8.28",
5+
settings: {
6+
/* solc settings */
7+
}
8+
},
49

510
networks: {
611
hardhat: {
12+
type: "edr-simulated",
13+
chainType: "l1",
14+
15+
chainId: 1337,
16+
717
mining: {
818
auto: false,
919
interval: 1000
@@ -13,12 +23,20 @@ module.exports = {
1323
// blockGasLimit: 10000000000000,
1424
// gasPrice: 2,
1525
initialBaseFeePerGas: 1,
16-
chainId: 1337,
17-
accounts: {
26+
27+
accounts: {
1828
mnemonic: 'major danger this key only test please avoid main net use okay'
1929
},
30+
2031
// loggingEnabled: true
2132
// verbose: true
2233
},
23-
}
34+
},
35+
36+
test: {
37+
solidity: {
38+
timeout: 40000,
39+
// other solidity tests options
40+
},
41+
},
2442
}

ethtest/testchain/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
22
"name": "testchain",
3+
"type": "module",
34
"version": "0.0.0",
45
"private": true,
56
"license": "none",
67
"scripts": {
7-
"start:hardhat": "hardhat node --hostname 0.0.0.0",
8-
"start:hardhat:verbose": "hardhat --verbose node --hostname 0.0.0.0",
9-
"start:geth": "docker run -p 8545:8545 --rm ethereum/client-go:v1.15.11 --networkid ${npm_package_config_testchainChainID} --dev --dev.period 1 --dev.gaslimit ${npm_package_config_testchainGasLimit} --miner.gaslimit ${npm_package_config_testchainGasLimit} --miner.gasprice 1 --http --http.addr 0.0.0.0 --rpc.allow-unprotected-txs --verbosity 1",
10-
"start:geth:verbose": "docker run -p 8545:8545 --rm ethereum/client-go:v1.15.11 --networkid ${npm_package_config_testchainChainID} --dev --dev.period 1 --dev.gaslimit ${npm_package_config_testchainGasLimit} --miner.gaslimit ${npm_package_config_testchainGasLimit} --miner.gasprice 1 --http --http.addr 0.0.0.0 --rpc.allow-unprotected-txs",
8+
"start:hardhat": "hardhat node --hostname 0.0.0.0 --network hardhat",
9+
"start:hardhat:verbose": "hardhat --verbose node --hostname 0.0.0.0 --network hardhat",
10+
"start:geth": "docker run -p 8545:8545 --rm ethereum/client-go:v1.16.4 --dev --dev.period 1 --dev.gaslimit ${npm_package_config_testchainGasLimit} --miner.gaslimit ${npm_package_config_testchainGasLimit} --miner.gasprice 1 --http --http.addr 0.0.0.0 --rpc.allow-unprotected-txs --verbosity 1",
11+
"start:geth:verbose": "docker run -p 8545:8545 --rm ethereum/client-go:v1.16.4 --dev --dev.period 1 --dev.gaslimit ${npm_package_config_testchainGasLimit} --miner.gaslimit ${npm_package_config_testchainGasLimit} --miner.gasprice 1 --http --http.addr 0.0.0.0 --rpc.allow-unprotected-txs",
1112
"start:anvil": "anvil --mnemonic \"${npm_package_config_mnemonic}\" --block-time 1 --balance ${npm_package_config_etherBalance} --host 0.0.0.0 --chain-id ${npm_package_config_testchainChainID} --gas-limit ${npm_package_config_testchainGasLimit} --gas-price ${npm_package_config_testchainGasPrice}",
1213
"start:anvil:verbose": "anvil --mnemonic \"${npm_package_config_mnemonic}\" --block-time 1 --balance ${npm_package_config_etherBalance} --host 0.0.0.0 --chain-id ${npm_package_config_testchainChainID} --gas-limit ${npm_package_config_testchainGasLimit} --gas-price ${npm_package_config_testchainGasPrice} -vvv",
1314
"install:anvil": "curl -L https://foundry.paradigm.xyz | bash; foundryup",
1415
"wait:server": "wait-on -t 120000 tcp:127.0.0.1:8545"
1516
},
1617
"devDependencies": {
17-
"concurrently": "^9.1.2",
18-
"hardhat": "^2.24.1",
19-
"wait-on": "^8.0.3"
18+
"hardhat": "^3.0.6",
19+
"wait-on": "^9.0.1"
2020
},
2121
"config": {
2222
"mnemonic": "major danger this key only test please avoid main net use okay",

0 commit comments

Comments
 (0)