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

Wallet deploy and test #19

Merged
merged 2 commits into from
Jul 22, 2024
Merged

Wallet deploy and test #19

merged 2 commits into from
Jul 22, 2024

Conversation

dmtrskv
Copy link
Contributor

@dmtrskv dmtrskv commented Jul 18, 2024

Generating and deploying new wallet if one does not exist. First of all, required for tests (we have no other reasonable way to create a wallet in hardhat tests actually, because we must inject it into the handler context). But also can be useful for cli use, so that a user won't have to use nil_cli.

The private key is required by hardhat, so we shouldn't generate it.

Here I generate the wallet address if it is not provided.
If the wallet is not deployed to the address (either provided or generated), then it is deployed.

For this I fixed extendEnvironment which actually contained a race between the test and the setup (due to async func being called before setting up send and request functions; we should wait inside them on the promise).

The second commit introduces incrementer ignition module from example and a script running it. I think we'll need a trivial test of the hardhat cli of such kind.

src/utils/conversion.ts Outdated Show resolved Hide resolved
@dmtrskv dmtrskv force-pushed the delpoy-utils branch 5 times, most recently from 8bd2572 to 7f40c3a Compare July 18, 2024 19:43
@dmtrskv dmtrskv marked this pull request as ready for review July 18, 2024 19:43
@dmtrskv dmtrskv force-pushed the delpoy-utils branch 2 times, most recently from 6c39064 to 2fbd160 Compare July 18, 2024 20:29
@dmtrskv dmtrskv changed the title Wallet and contract deploy utils Wallet deploy and test Jul 18, 2024
@dmtrskv
Copy link
Contributor Author

dmtrskv commented Jul 19, 2024

I do not get why build on 22 fails.

@0xAleksaOpacic
Copy link
Collaborator

0xAleksaOpacic commented Jul 19, 2024

I do not get why build on 22 fails.

@dmtrskv Hey, just check the issue and it is related to node version.

To be more specific our GH action is using v22.5.0. And in the GH action you can see that installation failed:
https://github.com/NilFoundation/nil-hardhat-plugin/actions/runs/10009987332/job/27675560764?pr=19#step:3:50

I tried locally to use this version and have the same issue. I checked the latest release and found these is a patch fix v22.5.1. Tried locally using this version and no issues.

If you checkout this release you can see that it fixes the error we have: Exit handler never called! (https://nodejs.org/en/blog/release/v22.5.1)

This fix was release 3h ago, so i assume it will just take some time to propage version, @ukorvl an i right?

@dmtrskv dmtrskv force-pushed the delpoy-utils branch 2 times, most recently from 3658772 to db26bda Compare July 19, 2024 20:37
@dmtrskv
Copy link
Contributor Author

dmtrskv commented Jul 19, 2024

Merged the commits and moved tests to the tests directory, so that they don't spam plugin structure with contracts and other hardhat dirs.

@dmtrskv dmtrskv requested a review from 0xAleksaOpacic July 19, 2024 21:41
Copy link
Collaborator

@0xAleksaOpacic 0xAleksaOpacic left a comment

Choose a reason for hiding this comment

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

Than you for opening PR and adding this!

@dmtrskv dmtrskv merged commit 33ce540 into master Jul 22, 2024
3 checks passed
@dmtrskv dmtrskv deleted the delpoy-utils branch July 22, 2024 13:19
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.

2 participants