aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-compiler/src
diff options
context:
space:
mode:
authorF. Eugene Aumson <feuGeneA@users.noreply.github.com>2018-10-03 22:57:37 +0800
committerF. Eugene Aumson <feuGeneA@users.noreply.github.com>2018-10-03 22:57:37 +0800
commitf614a2425f79c0ba4982b0868ed6edd9c491ef1b (patch)
treebe15cde35213dac54cf5059729d5f36d3faecfc9 /packages/sol-compiler/src
parent39a336ca6d6879ad6413cee714d929cb99bcd968 (diff)
downloaddexon-sol-tools-f614a2425f79c0ba4982b0868ed6edd9c491ef1b.tar
dexon-sol-tools-f614a2425f79c0ba4982b0868ed6edd9c491ef1b.tar.gz
dexon-sol-tools-f614a2425f79c0ba4982b0868ed6edd9c491ef1b.tar.bz2
dexon-sol-tools-f614a2425f79c0ba4982b0868ed6edd9c491ef1b.tar.lz
dexon-sol-tools-f614a2425f79c0ba4982b0868ed6edd9c491ef1b.tar.xz
dexon-sol-tools-f614a2425f79c0ba4982b0868ed6edd9c491ef1b.tar.zst
dexon-sol-tools-f614a2425f79c0ba4982b0868ed6edd9c491ef1b.zip
fix: comment need for sourceCodes pruning
Diffstat (limited to 'packages/sol-compiler/src')
-rw-r--r--packages/sol-compiler/src/compiler.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts
index 620728ed2..7eefc1474 100644
--- a/packages/sol-compiler/src/compiler.ts
+++ b/packages/sol-compiler/src/compiler.ts
@@ -297,6 +297,10 @@ export class Compiler {
): Promise<void> {
const compiledContract = compilerOutput.contracts[contractPath][contractName];
+ // need to gather sourceCodes for this artifact, but compilerOutput.sources (the list of contract modules)
+ // contains listings for for every contract compiled during the compiler invocation that compiled the contract
+ // to be persisted, which could include many that are irrelevant to the contract at hand. So, gather up only
+ // the relevant sources:
const { sourceCodes, sources } = this._getSourcesWithDependencies(contractPath, compilerOutput.sources);
const contractVersion: ContractVersionData = {
@@ -333,7 +337,7 @@ export class Compiler {
logUtils.warn(`${contractName} artifact saved!`);
}
/**
- * For the given @param contractPath, populates JSON objects to be used in the ContractArtifact interface's
+ * For the given @param contractPath, populates JSON objects to be used in the ContractVersionData interface's
* properties `sources` (source code file names mapped to ID numbers) and `sourceCodes` (source code content of
* contracts) for that contract. The source code pointed to by contractPath is read and parsed directly (via
* `this._resolver.resolve().source`), as are its imports, recursively. The ID numbers for @return `sources` are