Skip to content

Commit

Permalink
feat: Add config flag to turn off copying of deployment addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
espendk committed Nov 8, 2023
1 parent fe08d78 commit 53958cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ exports.full_exports = ["SimpleTestMaker"];
/////////////////////////////////////
// mangrove-deployments configuration

// Whether to fetch deployments from mangrove-deployments.
// Setting this to false allows manually specifying the addresses to use
// by writing them to the JSON files in the addresses/deployed directory.
// This may be useful if one wants to use a non-primary deployment.
// Default is true.
exports.copyDeployments = true;

// The SemVer range describing the versions of the Mangrove core contracts
// to query mangrove-deployments for.
// Default is the latest patch of the current package version.
Expand Down
9 changes: 9 additions & 0 deletions copyDeploymentAddresses.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ const fs = require("fs");
const path = require("path");
const config = require("./config");

if (!config.copyDeployments) {
console.group(
"Skipping copying deployments from the mangrove-deployments package.",
);
console.log("Set copyDeployments = true in config.js to enable copying.");
console.log("Using addresses/deployed/*.json files as-is instead.");
console.groupEnd();
}

// This is a hack to get the network names because the addresses
// file names use non-canonical network names from ethers.js
const networkNames = {
Expand Down

0 comments on commit 53958cd

Please sign in to comment.