Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨(gentest): Add support for chain_id #908

Open
Tracked by #866
raxhvl opened this issue Oct 23, 2024 · 3 comments
Open
Tracked by #866

✨(gentest): Add support for chain_id #908

raxhvl opened this issue Oct 23, 2024 · 3 comments
Labels
scope:gentest Scope: gentest CLI type:feat type: Feature

Comments

@raxhvl
Copy link
Contributor

raxhvl commented Oct 23, 2024

Would be nice to extend the interface to allow specification of other chains (especially testnets - we could test with sepolia, for example).

Also, modify the docstring to have a pythonic one-liner with an abbreviated tx.hash and chainid. The full tx.hash can be then provided below with link.

@danceratopz
Copy link
Member

It's worth taking a look at foundry's cast CLI, at least for inspiration regarding cli design.

I would love to be able to use it within EEST, but we've tried hard to remove non-python dependencies to make it easy for new test developers getting started. If you feel it would add a lot of value, we can reconsider.

@raxhvl
Copy link
Contributor Author

raxhvl commented Oct 23, 2024

I completely agree with you. Let's spec out an awesome interface.

@raxhvl
Copy link
Contributor Author

raxhvl commented Oct 29, 2024

Here are two ways to implement this.

A) Add chain ID

uvx gentest --chainid 1 ...

We could add a chain id to the env.yaml

remote_nodes:
  - name: mainnet
    node_url: <>
+  chainid: 1

This approach requires verifying the chainid using RPC before running tests to ensure a match. Otherwise, the setup below will work, but ideally, it shouldn’t.

uvx gentest --chainid 365 ...
remote_nodes:
  - name: mainnet
    node_url: <>
+  chainid: 365

B) Select using network name (preferred)

If the goal is to simply select one of many available remote nodes then we can take a simpler approach.

Remote nodes could be renamed to network (friendly name for rpc node used elsewhere) in env.yaml.

Then we could use

uvx gentest  --network mainnet ...
networks:
  - name: mainnet
    node_url: <>
    
  - name: sepolia
    node_url: <>

If no network is selected, it will use the first network as default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:gentest Scope: gentest CLI type:feat type: Feature
Projects
None yet
Development

No branches or pull requests

2 participants