Skip to content

Commit

Permalink
fix: expose error list and types at npm package (#809)
Browse files Browse the repository at this point in the history
* fix: expose error list and types at npm package

* chore: set same ethers version for typechain and hardhat
  • Loading branch information
kartojal authored Jan 31, 2023
1 parent 938743e commit 0334bf2
Show file tree
Hide file tree
Showing 6 changed files with 313 additions and 1,058 deletions.
6 changes: 3 additions & 3 deletions helper-hardhat-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export const buildForkConfig = (): HardhatNetworkForkingUserConfig | undefined =
let forkMode: HardhatNetworkForkingUserConfig | undefined;
if (FORK) {
forkMode = {
url: NETWORKS_RPC_URL[FORK],
url: NETWORKS_RPC_URL[FORK as eEthereumNetwork],
};
if (FORK_BLOCK_NUMBER || BLOCK_TO_FORK[FORK]) {
forkMode.blockNumber = FORK_BLOCK_NUMBER || BLOCK_TO_FORK[FORK];
if (FORK_BLOCK_NUMBER || BLOCK_TO_FORK[FORK as eEthereumNetwork]) {
forkMode.blockNumber = FORK_BLOCK_NUMBER || BLOCK_TO_FORK[FORK as eEthereumNetwork];
}
}
return forkMode;
Expand Down
3 changes: 0 additions & 3 deletions helpers/contracts-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ import { ethers } from 'ethers';
import { signTypedData_v4 } from 'eth-sig-util';
import { fromRpcSig, ECDSASignature } from 'ethereumjs-util';
import { tEthereumAddress, tStringTokenSmallUnits } from './types';
import { MintableERC20 } from '../types/MintableERC20';
import { getContract } from '@aave/deploy-v3';
import { impersonateAccountsHardhat } from './misc-utils';
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { InitializableImmutableAdminUpgradeabilityProxy } from '../types';

declare var hre: HardhatRuntimeEnvironment;

export type MockTokenMap = { [symbol: string]: MintableERC20 };

export const convertToCurrencyDecimals = async (tokenAddress: tEthereumAddress, amount: string) => {
const token = await getContract('IERC20Detailed', tokenAddress);
let decimals = (await token.decimals()).toString();
Expand Down
3 changes: 3 additions & 0 deletions helpers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './constants';
export * from './types';
export * from './contracts-helpers';
16 changes: 16 additions & 0 deletions lib.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"outDir": "dist/",
"importHelpers": false,
"declaration": true,
"declarationMap": true,
"declarationDir": "dist/types",
"typeRoots": ["./typechain/*.d.ts", "./node_modules/@types"]
},
"include": ["helpers", "types", "hardhat.config.ts"]
}
Loading

0 comments on commit 0334bf2

Please sign in to comment.