Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Fix: get networkId for truffle artifacts #240

Merged
merged 1 commit into from
Feb 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/artifactor.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const SyncRequest = require("./syncRequest");
const { parseSoliditySources } = require("./utils");

/**
Expand All @@ -6,6 +7,7 @@ const { parseSoliditySources } = require("./utils");
class Artifactor {
constructor(config) {
this.config = config;
this.sync = new SyncRequest(config.url);
}

/**
Expand Down Expand Up @@ -92,7 +94,8 @@ class Artifactor {
// or truffle versions. Catching because truffle
// is sometimes weird re: artifact access.
try {
deployed = artifact.networks[this.networkId];
const networkId = !this.config.provider ? this.sync.getNetworkId() : null;
deployed = artifact.networks[networkId];
metadata = artifact.metadata;
} catch (err) {}

Expand Down