Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0cb4a3

Browse files
committed
fix : was not reading generateTypedArtifacts config
1 parent b0988a4 commit c0cb4a3

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

.changeset/pre.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"tall-doodles-wash",
5959
"tasty-bars-jump",
6060
"ten-ideas-travel",
61+
"thin-dryers-poke",
6162
"tidy-rats-write",
6263
"tough-dogs-wish",
6364
"wild-masks-beg",

.changeset/thin-dryers-poke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat-deploy": patch
3+
---
4+
5+
fix : was not reading generateTypedArtifacts config

packages/hardhat-deploy/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# hardhat-deploy
22

3+
## 2.0.0-next.57
4+
5+
### Patch Changes
6+
7+
- fix : was not reading generateTypedArtifacts config
8+
39
## 2.0.0-next.56
410

511
### Patch Changes

packages/hardhat-deploy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hardhat-deploy",
3-
"version": "2.0.0-next.56",
3+
"version": "2.0.0-next.57",
44
"description": "deployment plugin for hardhat",
55
"publishConfig": {
66
"access": "public"

packages/hardhat-deploy/src/generate-types.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function writeABIDefinitionToFile(
111111
folder: string,
112112
canonicalName: string,
113113
data: Artifact,
114-
mode: 'typescript' | 'javascript'
114+
mode: 'typescript' | 'javascript',
115115
) {
116116
const nameAsPath = canonicalName.split('/');
117117
const name = nameAsPath[nameAsPath.length - 1];
@@ -173,7 +173,7 @@ export async function generateTypes(paths: {artifacts: string[]}, config: Artifa
173173
artifactsPath,
174174
[],
175175
artifactsPath,
176-
(name) => name != 'build-info' && !name.endsWith('.t.sol') && !name.endsWith('.dbg.json')
176+
(name) => name != 'build-info' && !name.endsWith('.t.sol') && !name.endsWith('.dbg.json'),
177177
);
178178

179179
// console.log('--------------------------');
@@ -267,13 +267,15 @@ export async function generateTypes(paths: {artifacts: string[]}, config: Artifa
267267

268268
// writeFiles(undefined, allArtifacts, config);
269269

270-
const generatedFolder = 'generated';
271-
const mode = 'javascript';
272-
for (const key of Object.keys(allArtifacts)) {
273-
writeABIDefinitionToFile(generatedFolder, key, allArtifacts[key], mode);
274-
writeArtifactToFile(generatedFolder, key, allArtifacts[key], mode);
275-
}
270+
for (const destination of config.destinations) {
271+
const generatedFolder = destination.folder;
272+
const mode = destination.mode;
273+
for (const key of Object.keys(allArtifacts)) {
274+
writeABIDefinitionToFile(generatedFolder, key, allArtifacts[key], mode);
275+
writeArtifactToFile(generatedFolder, key, allArtifacts[key], mode);
276+
}
276277

277-
writeArtifactIndexToFile(generatedFolder, allArtifacts, mode);
278-
writeABIDefinitionIndexToFile(generatedFolder, allArtifacts, mode);
278+
writeArtifactIndexToFile(generatedFolder, allArtifacts, mode);
279+
writeABIDefinitionIndexToFile(generatedFolder, allArtifacts, mode);
280+
}
279281
}

0 commit comments

Comments
 (0)