rocketh 0.10.9 → 0.10.11

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.
@@ -14,7 +14,7 @@ var prompts = require('prompts');
14
14
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
15
15
  var require$1 = (
16
16
  false
17
- ? /* @__PURE__ */ module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index-BJlVmvtt.cjs', document.baseURI).href)))
17
+ ? /* @__PURE__ */ module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index-t2GbLf0K.cjs', document.baseURI).href)))
18
18
  : require
19
19
  );
20
20
 
@@ -462,6 +462,7 @@ async function createEnvironment(config, providedContext) {
462
462
  saveDeployments = config.saveDeployments;
463
463
  }
464
464
  const resolvedAccounts = {};
465
+ const allRemoteAccounts = await provider.request({ method: "eth_accounts" });
465
466
  const accountCache = {};
466
467
  async function getAccount(name, accounts, accountDef) {
467
468
  if (accountCache[name]) {
@@ -469,8 +470,7 @@ async function createEnvironment(config, providedContext) {
469
470
  }
470
471
  let account;
471
472
  if (typeof accountDef === "number") {
472
- const accounts2 = await provider.request({ method: "eth_accounts" });
473
- const accountPerIndex = accounts2[accountDef];
473
+ const accountPerIndex = allRemoteAccounts[accountDef];
474
474
  if (accountPerIndex) {
475
475
  accountCache[name] = account = {
476
476
  type: "remote",
@@ -565,11 +565,19 @@ async function createEnvironment(config, providedContext) {
565
565
  addressSigners[address] = namedSigner;
566
566
  namedSigners[name] = namedSigner;
567
567
  }
568
+ const unnamedAccounts = allRemoteAccounts.filter((v) => !addressSigners[v]);
569
+ for (const account of unnamedAccounts) {
570
+ addressSigners[account] = {
571
+ type: "remote",
572
+ signer: provider
573
+ };
574
+ }
568
575
  const perliminaryEnvironment = {
569
576
  config,
570
577
  deployments,
571
- accounts: namedAccounts,
572
- signers: namedSigners,
578
+ namedAccounts,
579
+ namedSigners,
580
+ unnamedAccounts,
573
581
  addressSigners,
574
582
  artifacts: context.artifacts,
575
583
  network: {
@@ -1092,11 +1100,11 @@ async function loadEnvironment(options, context) {
1092
1100
  const { external, internal } = await createEnvironment(resolvedConfig, context);
1093
1101
  return external;
1094
1102
  }
1095
- async function loadAndExecuteDeployments(options, args) {
1103
+ async function loadAndExecuteDeployments(options, context, args) {
1096
1104
  const resolvedConfig = readAndResolveConfig(options);
1097
- return executeDeployScripts(resolvedConfig, args);
1105
+ return executeDeployScripts(resolvedConfig, context, args);
1098
1106
  }
1099
- async function executeDeployScripts(config, args) {
1107
+ async function executeDeployScripts(config, context, args) {
1100
1108
  setLogLevel(typeof config.logLevel === "undefined" ? 0 : config.logLevel);
1101
1109
  let filepaths;
1102
1110
  filepaths = traverseMultipleDirectory([config.scripts]);
@@ -1109,7 +1117,8 @@ async function executeDeployScripts(config, args) {
1109
1117
  }
1110
1118
  return 0;
1111
1119
  });
1112
- let providedContext;
1120
+ let providedContext = context;
1121
+ const providedFromArguments = !!providedContext;
1113
1122
  const scriptModuleByFilePath = {};
1114
1123
  const scriptPathBags = {};
1115
1124
  const scriptFilePaths = [];
@@ -1129,10 +1138,12 @@ async function executeDeployScripts(config, args) {
1129
1138
  }
1130
1139
  }
1131
1140
  scriptModuleByFilePath[scriptFilePath] = scriptModule;
1132
- if (providedContext && providedContext !== scriptModule.providedContext) {
1133
- throw new Error(`context between 2 scripts is different, please share the same across them`);
1141
+ if (!providedFromArguments) {
1142
+ if (providedContext && providedContext !== scriptModule.providedContext) {
1143
+ throw new Error(`context between 2 scripts is different, please share the same across them`);
1144
+ }
1145
+ providedContext = scriptModule.providedContext;
1134
1146
  }
1135
- providedContext = scriptModule.providedContext;
1136
1147
  } catch (e) {
1137
1148
  logger.error(`could not import ${filepath}`);
1138
1149
  throw e;
@@ -1303,4 +1314,4 @@ exports.mergeArtifacts = mergeArtifacts;
1303
1314
  exports.readAndResolveConfig = readAndResolveConfig;
1304
1315
  exports.readConfig = readConfig;
1305
1316
  exports.resolveConfig = resolveConfig;
1306
- //# sourceMappingURL=index-BJlVmvtt.cjs.map
1317
+ //# sourceMappingURL=index-t2GbLf0K.cjs.map