@skalenetwork/upgrade-tools 2.0.0-refactor.4 → 2.0.0-refactor.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,5 @@ import { UnsignedTransaction } from "ethers";
2
2
  import { Submitter } from "./submitter";
3
3
  export declare class EoaSubmitter implements Submitter {
4
4
  submit(transactions: UnsignedTransaction[]): Promise<void>;
5
+ _atomicityWarning(): void;
5
6
  }
@@ -8,12 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.EoaSubmitter = void 0;
16
+ const chalk_1 = __importDefault(require("chalk"));
13
17
  const hardhat_1 = require("hardhat");
14
18
  class EoaSubmitter {
15
19
  submit(transactions) {
16
20
  return __awaiter(this, void 0, void 0, function* () {
21
+ this._atomicityWarning();
17
22
  const [deployer] = yield hardhat_1.ethers.getSigners();
18
23
  for (const transaction of transactions) {
19
24
  console.log("Send transaction");
@@ -28,5 +33,16 @@ class EoaSubmitter {
28
33
  }
29
34
  });
30
35
  }
36
+ // private
37
+ _atomicityWarning() {
38
+ if (!process.env.ALLOW_NOT_ATOMIC_UPGRADE) {
39
+ console.log(chalk_1.default.red("The upgrade will consist of multiple transactions and will not be atomic"));
40
+ console.log(chalk_1.default.red("If not atomic upgrade is OK set ALLOW_NOT_ATOMIC_UPGRADE environment variable"));
41
+ process.exit(1);
42
+ }
43
+ else {
44
+ console.log(chalk_1.default.yellow("Not atomic upgrade is performing"));
45
+ }
46
+ }
31
47
  }
32
48
  exports.EoaSubmitter = EoaSubmitter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skalenetwork/upgrade-tools",
3
- "version": "2.0.0-refactor.4",
3
+ "version": "2.0.0-refactor.5",
4
4
  "description": "Scripts to support upgrades of smart contracts",
5
5
  "files": [
6
6
  "dist/**/*"