Skip to content

simsonraj/eth-err-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ethereum Clients Error Codes Test suite

Test suite for validating error code implementations across different Ethereum clients. Test scenarios for eth_ methods are here

Setup

The tests can be run against different Ethereum clients locally with docker or an actual CHAIN's RPCs

  1. Set your private key:
export PRIVATE_KEY=your_private_key_here
  1. Run tests:
# Test with Geth
go run main.go --env=geth-local > reports/geth-local.log

# Test with Besu
go run main.go --env=besu-local > reports/besu-local.log

Note: Besu dev mode comes with a pre-funded account: https://besu.hyperledger.org/private-networks/reference/accounts-for-testing

Generate Reports

Convert logs to CSV:

go run main.go report reports/geth-local.log

Output: geth-local.csv

Add New Clients

Edit pkg/config/config.go:

myClientConfig = Config{
    Network:       "my-client",
    Url:           "http://localhost:8545",
    From:          "0xYourAddress",
    PrivateKey:    os.Getenv("PRIVATE_KEY"),
    ChainID:       1337,
    LocalNodeType: "myclient", // Will need to configure the docker setup as well to run this client
}

Add to GetConfig() function:

case "myclient":
    return myClientConfig, nil

Add the new client docker setup in localnode/manager.go

About

Test suite for validating error code implementations across different Ethereum clients

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published