Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
go-version: [1.23.x,1.24.x]
go-version: [1.24.x,1.25.x]
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}
Expand Down
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ install:
# Run baseline tests
test: check-testchain-running go-test

# Run testchain and tests concurrently
test-concurrently:
cd ./tools/testchain && pnpm concurrently -k --success first 'pnpm start:hardhat' 'cd ../.. && make go-test'

# Run tests with reorgme
test-with-reorgme: check-reorgme-running
REORGME=true $(MAKE) go-test
Expand All @@ -80,13 +76,13 @@ tools:
cd ./ethtest/testchain && pnpm install
cd ./ethtest/reorgme && pnpm install

bootstrap:
cd ./ethtest/testchain && pnpm install


#
# Testchain
#
init-testchain:
cd ./ethtest/testchain && pnpm install

start-testchain:
cd ./ethtest/testchain && pnpm start:hardhat

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

check-testchain-running:
@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 \
|| { echo "*****"; echo "Oops! testchain is not running. Please run 'make start-testchain' in another terminal or use 'test-concurrently'."; echo "*****"; exit 1; }
|| { echo "*****"; echo "Oops! testchain is not running. Please run 'make start-testchain' in another terminal."; echo "*****"; exit 1; }


#
Expand Down
4 changes: 2 additions & 2 deletions cmd/ethkit/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func init() {
cmd.Flags().Bool("print-private-key", false, "print wallet private key from keyfile (danger!)")
cmd.Flags().Bool("import-mnemonic", false, "import a secret mnemonic to a new keyfile")
cmd.Flags().Int("entropy", 256, "set entropy bit size for new wallet, options: 128, 256 (default: 256)")
cmd.Flags().String("path", "", fmt.Sprintf("set derivation path, default: %s", ethwallet.DefaultWalletOptions.DerivationPath))
cmd.Flags().String("path", "", fmt.Sprintf("set derivation path, default: %s", ethwallet.DefaultWalletOptions().DerivationPath))

rootCmd.AddCommand(cmd)
}
Expand Down Expand Up @@ -185,7 +185,7 @@ func (c *wallet) createNew() error {

derivationPath := c.fPath
if derivationPath == "" {
derivationPath = ethwallet.DefaultWalletOptions.DerivationPath
derivationPath = ethwallet.DefaultWalletOptions().DerivationPath
}

c.wallet, err = getWallet(importMnemonic, derivationPath, c.fEntropy)
Expand Down
2 changes: 1 addition & 1 deletion ethtest/testchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (c *Testchain) MustWallet(optAccountIndex ...uint32) *ethwallet.Wallet {
panic(err)
}
if len(optAccountIndex) > 0 {
_, err = wallet.SelfDeriveAccountIndex(optAccountIndex[0])
wallet, _, err = wallet.DeriveFromAccountIndex(optAccountIndex[0])
if err != nil {
panic(err)
}
Expand Down
28 changes: 23 additions & 5 deletions ethtest/testchain/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
// see https://hardhat.org/hardhat-network/docs/reference#config
module.exports = {
solidity: "0.8.28",
export default {
solidity: {
version: "0.8.28",
settings: {
/* solc settings */
}
},

networks: {
hardhat: {
type: "edr-simulated",
chainType: "l1",

chainId: 1337,

mining: {
auto: false,
interval: 1000
Expand All @@ -13,12 +23,20 @@ module.exports = {
// blockGasLimit: 10000000000000,
// gasPrice: 2,
initialBaseFeePerGas: 1,
chainId: 1337,
accounts: {

accounts: {
mnemonic: 'major danger this key only test please avoid main net use okay'
},

// loggingEnabled: true
// verbose: true
},
}
},

test: {
solidity: {
timeout: 40000,
// other solidity tests options
},
},
}
14 changes: 7 additions & 7 deletions ethtest/testchain/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "testchain",
"type": "module",
"version": "0.0.0",
"private": true,
"license": "none",
"scripts": {
"start:hardhat": "hardhat node --hostname 0.0.0.0",
"start:hardhat:verbose": "hardhat --verbose node --hostname 0.0.0.0",
"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",
"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",
"start:hardhat": "hardhat node --hostname 0.0.0.0 --network hardhat",
"start:hardhat:verbose": "hardhat --verbose node --hostname 0.0.0.0 --network hardhat",
"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",
"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",
"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}",
"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",
"install:anvil": "curl -L https://foundry.paradigm.xyz | bash; foundryup",
"wait:server": "wait-on -t 120000 tcp:127.0.0.1:8545"
},
"devDependencies": {
"concurrently": "^9.1.2",
"hardhat": "^2.24.1",
"wait-on": "^8.0.3"
"hardhat": "^3.0.6",
"wait-on": "^9.0.1"
},
"config": {
"mnemonic": "major danger this key only test please avoid main net use okay",
Expand Down
Loading
Loading