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

add foundry integration #845

Open
wants to merge 21 commits into
base: dev
Choose a base branch
from
Open

add foundry integration #845

wants to merge 21 commits into from

Conversation

r3kt-eth
Copy link
Contributor

Motivation and context

It's good beginning.

Does it fix any issue?

#(issue)

Other useful info

N/A

Quality checklist

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough e2e tests.

⚠️👆 Delete any section you see irrelevant before submitting the pull request 👆⚠️

@cypress
Copy link

cypress bot commented Sep 11, 2023

Passing run #434 ↗︎

0 207 0 0 Flakiness 0

Details:

add foundry integration
Project: synpress Commit: fe60bc896d
Status: Passed Duration: 18:58 💡
Started: Sep 12, 2023 1:33 AM Ended: Sep 12, 2023 1:52 AM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

Copy link
Contributor

@roninjin10 roninjin10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice


let activeChains;

module.exports = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should write new code in a .mjs file imo so converting it to TS later is easier

commands/foundry.js Show resolved Hide resolved

const log = require('debug')('synpress:foundry');

let activeChains;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doing module level state like this is common in synpress and not a good practice in general imo. Instead state should be instanciated by user e.g. synpressFoundry(options) where on the implementation you can set state in the factory function or the class in case of doing new SynpressFoundry(options). It's way more robust to later having more than one for example and leads to less problems long term. Easier to read the code and debug too imo

commands/foundry.js Show resolved Hide resolved
commands/foundry.js Show resolved Hide resolved
commands/foundry.js Show resolved Hide resolved
Comment on lines +46 to +60
const testClient = createTestClient({
chain: anvilChainType,
mode: 'anvil',
transport: http(),
});

const publicClient = createPublicClient({
chain: anvilChainType,
transport: http(),
});

const walletClient = createWalletClient({
chain: anvilChainType,
transport: http(),
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you did the new AnvilSynpressUtil() pattern here the utility could give these to user so user could use them in their tests too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants