-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
115 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
diff --git a/node_modules/@ledgerhq/hw-transport-node-hid/lib/TransportNodeHid.js b/node_modules/@ledgerhq/hw-transport-node-hid/lib/TransportNodeHid.js | ||
index d96740f..5399a59 100644 | ||
--- a/node_modules/@ledgerhq/hw-transport-node-hid/lib/TransportNodeHid.js | ||
+++ b/node_modules/@ledgerhq/hw-transport-node-hid/lib/TransportNodeHid.js | ||
@@ -32,7 +32,7 @@ let listenDevicesPollingSkip = () => false; | ||
* TransportNodeHid.create().then(transport => ...) | ||
*/ | ||
|
||
- | ||
+let transportCache = null; | ||
class TransportNodeHid extends _hwTransportNodeHidNoevents.default { | ||
/** | ||
* | ||
@@ -61,14 +61,18 @@ class TransportNodeHid extends _hwTransportNodeHidNoevents.default { | ||
* if path="" is not provided, the library will take the first device | ||
*/ | ||
static open(path) { | ||
+ if(transportCache !== null) { | ||
+ transportCache.device.close() | ||
+ } | ||
return Promise.resolve().then(() => { | ||
if (path) { | ||
- return new TransportNodeHid(new _nodeHid.default.HID(path)); | ||
+ transportCache = new TransportNodeHid(new _nodeHid.default.HID(path)); | ||
+ } else { | ||
+ const device = (0, _hwTransportNodeHidNoevents.getDevices)()[0]; | ||
+ if (!device) throw new _errors.TransportError("NoDevice", "NoDevice"); | ||
+ transportCache = new TransportNodeHid(new _nodeHid.default.HID(device.path)); | ||
} | ||
- | ||
- const device = (0, _hwTransportNodeHidNoevents.getDevices)()[0]; | ||
- if (!device) throw new _errors.TransportError("NoDevice", "NoDevice"); | ||
- return new TransportNodeHid(new _nodeHid.default.HID(device.path)); | ||
+ return transportCache; | ||
}); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
diff --git a/node_modules/hardhat/internal/artifacts.js b/node_modules/hardhat/internal/artifacts.js | ||
index 7f6c14a..4f07cc1 100644 | ||
--- a/node_modules/hardhat/internal/artifacts.js | ||
+++ b/node_modules/hardhat/internal/artifacts.js | ||
@@ -186,6 +186,16 @@ class Artifacts { | ||
const files = await this.getArtifactPaths(); | ||
return this._getArtifactPathFromFiles(name, files); | ||
} | ||
+ /** | ||
+ * Pathced to not throw and return all artifacts with same name. | ||
+ */ | ||
+ async _getArtifactPathNoError(name) { | ||
+ if ((0, contract_names_1.isFullyQualifiedName)(name)) { | ||
+ return this._getValidArtifactPathFromFullyQualifiedName(name); | ||
+ } | ||
+ const files = await this.getArtifactPaths(); | ||
+ return this._getArtifactPathFromFilesNoError(name, files); | ||
+ } | ||
_createBuildInfo(id, solcVersion, solcLongVersion, input, output) { | ||
return { | ||
id, | ||
@@ -418,6 +428,20 @@ Please replace "${contractName}" for the correct contract name wherever you are | ||
} | ||
return matchingFiles[0]; | ||
} | ||
+ | ||
+ _getArtifactPathFromFilesNoError(contractName, files) { | ||
+ const matchingFiles = files.filter((file) => { | ||
+ return path.basename(file) === `${contractName}.json`; | ||
+ }); | ||
+ if (matchingFiles.length === 0) { | ||
+ return this._handleWrongArtifactForContractName(contractName, files); | ||
+ } | ||
+ if (matchingFiles.length > 1) { | ||
+ const candidates = matchingFiles.map((file) => this._getFullyQualifiedNameFromPath(file)); | ||
+ return candidates | ||
+ } | ||
+ return matchingFiles[0]; | ||
+ } | ||
/** | ||
* Returns the FQN of a contract giving the absolute path to its artifact. | ||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/node_modules/hardhat-deploy/dist/src/helpers.js b/node_modules/hardhat-deploy/dist/src/helpers.js | ||
index be6113f..c7f25da 100644 | ||
--- a/node_modules/hardhat-deploy/dist/src/helpers.js | ||
+++ b/node_modules/hardhat-deploy/dist/src/helpers.js | ||
@@ -796,7 +796,7 @@ getArtifact, saveDeployment, willSaveToDisk, onPendingTx, getGasPrice, log, prin | ||
} | ||
const proxyName = name + '_Proxy'; | ||
const { address: owner } = getProxyOwner(options); | ||
- const { address: from } = getFrom(options.from); | ||
+ // const { address: from } = getFrom(options.from); | ||
const implementationArgs = options.args ? [...options.args] : []; | ||
// --- Implementation Deployment --- | ||
const implementationOptions = { |