From 53958cd588b527cec7db6dfc742316071632cbd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Espen=20H=C3=B8jsgaard?= Date: Wed, 8 Nov 2023 12:47:11 +0100 Subject: [PATCH] feat: Add config flag to turn off copying of deployment addresses --- config.js | 7 +++++++ copyDeploymentAddresses.js | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/config.js b/config.js index c22883428..e15e7ceb0 100644 --- a/config.js +++ b/config.js @@ -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. diff --git a/copyDeploymentAddresses.js b/copyDeploymentAddresses.js index 3ac7f3f69..30931ce35 100644 --- a/copyDeploymentAddresses.js +++ b/copyDeploymentAddresses.js @@ -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 = {