GithubHelp home page GithubHelp logo

evm-tests's Introduction

EVM Tests for Telos EVM

REQUIREMENTS

This template requires NodeJS & NPM installed on your machine and a wallet address on the Telos EVM Testnet Network.

Commands used below work on recent Linux or Windows versions but have not been verified for Mac

INSTALL

  • Install the repository on your machine
  • Enter the directory of the project on your machine and install its dependencies by running npm install

TEST

  • Use npx hardhat test to build and launch the tests

OPTIONAL:

Run local evm node & autodeploy contract at tevmc/contracts/eosio.evm

Requirements:

  • Docker
  • Python 3.9+ (probably works with 3.7+ but haven't tested in a while)
  • Linux (for now)

Quickstart:

# from repo root:

# create virtualenv and activate
python3 -m venv venv
source venv/bin/activate

# install requirements
pip install -r tevmc/requirements.txt

# run deploy script, will wait for user input for teardown
pytest tevmc/test_deploy.py

# on another terminal run js evm tests
npx hardhat test --network tevmc

evm-tests's People

Contributors

guilledk avatar poplexity avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

evm-tests's Issues

Add estimateGas max value balance test

Description

Setting the maximum amount of a sender in value returns an error. We need a test for it to reproduce:

Hi there!
Could you help me guys with fee calculation?
I see if I send to RPC eth_estimatedGas (for send tx) it returns const value despite amount value I set. But if I send maximum amount for address, api returns error. What amount should we use to get estimatedGas for transaction?

Figure out why the provider isn't stopping the gas estimation call for Telos

Description

Test revealed that on gas estimation with a gas fee specified but no balance in the wallet, the call reverts with The sender address has a zero balance on Telos but Sepolia gives a provider error 'insufficient funds for intrinsic transaction cost' and doesn't even make the call.

Task

  • Figure out why the provider isn't stopping the call for Telos.

Add getLogs tests

Description

Make sure our getLogs response is the same as Erigon's

Following was reported by a partner

When querying logs on the RPC, topic filters seem to not be working when an array with multiple values is passed as filter parameter. Then eth_getLogs simply returns nothing anymore. Setting the filter as single value works, but passing multiple values, which should create an or, does not work.

e.g.:

{
  'topics': ['0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
     [
       '0x000000000000000000000000905caae1627856529bed7b9572f02af5e5ac6ca7', 
       '0x0000000000000000000000000000000000000000000000000000000000000000'
     ]
  ]
} 

does not work, while

{
  'topics': ['0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
    ['0x0000000000000000000000000000000000000000000000000000000000000000']
  ]
} 

works. Difference is the second element in the array.

Add test for internal call failing but the transaction continues

Description

Add test for internal call failing but the transaction continues

We should see how to force an out of gas failure as well, and do that in these tests too. The original create2 internal transaction contract deployment failure was due to out of gas, which might have a different response than a contract revert

Add test for factories deploying a contract and that contract fails

Description

We need a test for factories deploying a contract and that contract fails

We should see how to force an out of gas failure as well, and do that in these tests too. The original create2 internal transaction contract deployment failure was due to out of gas, which might have a different response than a contract revert

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.