Skip to content

Commit

Permalink
Merge pull request #19 from NilFoundation/delpoy-utils
Browse files Browse the repository at this point in the history
Wallet deploy and test
  • Loading branch information
dmtrskv authored Jul 22, 2024
2 parents 012aa3a + 5c0b0cd commit 33ce540
Show file tree
Hide file tree
Showing 16 changed files with 8,556 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
node_modules
.env
.idea
dist/
.vscode/*
!.vscode/settings.json
.tsbuildinfo
*.tar.gz
*.tgz
/cache/
/artifacts/
/typechain-types/
208 changes: 206 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nilfoundation/hardhat-plugin",
"version": "0.1.9",
"version": "0.1.10",
"description": "Custom Hardhat plugin to enable seamless deployment and interaction with applications within =nil;",
"repository": {
"type": "git",
Expand Down
18 changes: 14 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@ import type { HardhatUserConfig } from "hardhat/types";
import { unifiedInterceptor } from "./interceptors";
import { setupWalletAndClient } from "./setup";

extendEnvironment(async (hre) => {
const context = await setupWalletAndClient(hre);
extendEnvironment((hre) => {
const originalRequest = hre.network.provider.request.bind(
hre.network.provider,
);
const originalSend = hre.network.provider.send.bind(hre.network.provider);
const contextPromise = setupWalletAndClient(
hre,
originalRequest,
originalSend,
);

hre.network.provider.send = (method, params) => {
hre.network.provider.send = async (method, params) => {
const context = await contextPromise;
context.isRequest = false;
return unifiedInterceptor(method, params || [], context);
};

hre.network.provider.request = (args) => {
hre.network.provider.request = async (args) => {
const context = await contextPromise;
context.isRequest = true;
const safeParams = Array.isArray(args.params)
? args.params
Expand Down
Loading

0 comments on commit 33ce540

Please sign in to comment.