Skip to content

Commit

Permalink
Propagate hardhat-tenderly version through env (#214)
Browse files Browse the repository at this point in the history
* initional hardhat-ignition example

* added hardhat-tenderly to ignition project

* propagate hardhat-tenderly version through env

* changeset version
  • Loading branch information
dule-git authored Sep 23, 2024
1 parent 8b92b4a commit 3ccd4eb
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .changeset/eighty-otters-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@tenderly/hardhat-tenderly": patch
"@tenderly/api-client": patch
"@tenderly/hardhat-integration": patch
---

Restructured internal packages
5 changes: 3 additions & 2 deletions packages/hre-extender-v1/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ const tenderlyService = new TenderlyService(PLUGIN_NAME);

export function setup(cfg: { automaticVerifications: boolean } = { automaticVerifications: true }) {
extendEnvironment(async (hre: HardhatRuntimeEnvironment) => {
process.env.TENDERLY_AUTOMATIC_VERIFICATION = cfg.automaticVerifications
process.env.AUTOMATIC_VERIFICATION_ENABLED = cfg.automaticVerifications
process.env.TENDERLY_AUTOMATIC_VERIFICATION = cfg.automaticVerifications ? "true": "false"
process.env.AUTOMATIC_VERIFICATION_ENABLED = cfg.automaticVerifications ? "true": "false"
process.env.HARDHAT_TENDERLY_VERSION = require("../package.json").version;

hre.tenderly = lazyObject(() => new Tenderly(hre));

Expand Down
5 changes: 3 additions & 2 deletions packages/hre-extender-v2/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ const tenderlyService = new TenderlyService(PLUGIN_NAME);

export function setup(cfg: { automaticVerifications: boolean } = { automaticVerifications: true }) {
extendEnvironment(async (hre: HardhatRuntimeEnvironment) => {
process.env.TENDERLY_AUTOMATIC_VERIFICATION = cfg.automaticVerifications
process.env.AUTOMATIC_VERIFICATION_ENABLED = cfg.automaticVerifications
process.env.TENDERLY_AUTOMATIC_VERIFICATION = cfg.automaticVerifications ? "true": "false"
process.env.AUTOMATIC_VERIFICATION_ENABLED = cfg.automaticVerifications ? "true": "false"
process.env.HARDHAT_TENDERLY_VERSION = require("../package.json").version;

hre.tenderly = lazyObject(() => new Tenderly(hre));

Expand Down
2 changes: 1 addition & 1 deletion packages/tenderly-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"url": "https://github.com/Tenderly/hardhat-tenderly.git"
},
"scripts": {
"build": "rm -rf build-test && rm -f tsconfig.tsbuildinfo && node version-generator.js && tsc --build .",
"build": "rm -rf build-test && rm -f tsconfig.tsbuildinfo && tsc --build .",
"clean": "rm -rf node_modules && rm -rf build-test && rm -rf common && rm -rf internal && rm -rf types && rm -rf utils && rm -f tsconfig.tsbuildinfo",
"lint": "yarn run prettier --check && yarn run eslint",
"lint:fix": "yarn run prettier --write && yarn run eslint --fix",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
TENDERLY_API_BASE_URL,
TENDERLY_JSON_RPC_BASE_URL,
} from "../../../common/constants";
import { HARDHAT_TENDERLY_VERSION } from "./hardhat-tenderly-version";
import * as dotenv from "dotenv";

export class TenderlyApiService {
public static configureInstance(
Expand All @@ -21,11 +21,15 @@ export class TenderlyApiService {
const tdlyConfig = getConfig();
accessKey = tdlyConfig.access_key;
}

dotenv.config();
const hardhatTenderlyVersion = process.env.HARDHAT_TENDERLY_VERSION;

const params = {
baseURL: TENDERLY_API_BASE_URL,
headers: {
"x-access-key": accessKey,
"x-user-agent": `@tenderly/hardhat-tenderly/${HARDHAT_TENDERLY_VERSION}`,
"x-user-agent": `@tenderly/hardhat-tenderly/${hardhatTenderlyVersion}`,
},
};

Expand Down

This file was deleted.

9 changes: 0 additions & 9 deletions packages/tenderly-core/version-generator.js

This file was deleted.

0 comments on commit 3ccd4eb

Please sign in to comment.