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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # rocketh
2
2
 
3
+ ## 0.10.11
4
+
5
+ ### Patch Changes
6
+
7
+ - speicfy context from executor
8
+
9
+ ## 0.10.10
10
+
11
+ ### Patch Changes
12
+
13
+ - unnamedAccounts
14
+
3
15
  ## 0.10.9
4
16
 
5
17
  ### Patch Changes
package/dist/cli.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  var ldenv = require('ldenv');
5
- var index = require('./index-BJlVmvtt.cjs');
5
+ var index = require('./index-t2GbLf0K.cjs');
6
6
  require('node:path');
7
7
  require('node:fs');
8
8
  require('ethers');
@@ -16,7 +16,7 @@ require('viem/chains');
16
16
  require('prompts');
17
17
 
18
18
  var name = "rocketh";
19
- var version = "0.10.8";
19
+ var version = "0.10.10";
20
20
  var description = "deploy smart contract on ethereum-compatible networks";
21
21
  var publishConfig = {
22
22
  access: "public"
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { loadEnv } from 'ldenv';
2
- import { f as loadAndExecuteDeployments } from './index-DOSnToHV.mjs';
2
+ import { f as loadAndExecuteDeployments } from './index-Cs7zkNfV.mjs';
3
3
  import 'node:path';
4
4
  import 'node:fs';
5
5
  import 'ethers';
@@ -13,7 +13,7 @@ import 'viem/chains';
13
13
  import 'prompts';
14
14
 
15
15
  var name = "rocketh";
16
- var version = "0.10.8";
16
+ var version = "0.10.10";
17
17
  var description = "deploy smart contract on ethereum-compatible networks";
18
18
  var publishConfig = {
19
19
  access: "public"
@@ -459,6 +459,7 @@ async function createEnvironment(config, providedContext) {
459
459
  saveDeployments = config.saveDeployments;
460
460
  }
461
461
  const resolvedAccounts = {};
462
+ const allRemoteAccounts = await provider.request({ method: "eth_accounts" });
462
463
  const accountCache = {};
463
464
  async function getAccount(name, accounts, accountDef) {
464
465
  if (accountCache[name]) {
@@ -466,8 +467,7 @@ async function createEnvironment(config, providedContext) {
466
467
  }
467
468
  let account;
468
469
  if (typeof accountDef === "number") {
469
- const accounts2 = await provider.request({ method: "eth_accounts" });
470
- const accountPerIndex = accounts2[accountDef];
470
+ const accountPerIndex = allRemoteAccounts[accountDef];
471
471
  if (accountPerIndex) {
472
472
  accountCache[name] = account = {
473
473
  type: "remote",
@@ -562,11 +562,19 @@ async function createEnvironment(config, providedContext) {
562
562
  addressSigners[address] = namedSigner;
563
563
  namedSigners[name] = namedSigner;
564
564
  }
565
+ const unnamedAccounts = allRemoteAccounts.filter((v) => !addressSigners[v]);
566
+ for (const account of unnamedAccounts) {
567
+ addressSigners[account] = {
568
+ type: "remote",
569
+ signer: provider
570
+ };
571
+ }
565
572
  const perliminaryEnvironment = {
566
573
  config,
567
574
  deployments,
568
- accounts: namedAccounts,
569
- signers: namedSigners,
575
+ namedAccounts,
576
+ namedSigners,
577
+ unnamedAccounts,
570
578
  addressSigners,
571
579
  artifacts: context.artifacts,
572
580
  network: {
@@ -1089,11 +1097,11 @@ async function loadEnvironment(options, context) {
1089
1097
  const { external, internal } = await createEnvironment(resolvedConfig, context);
1090
1098
  return external;
1091
1099
  }
1092
- async function loadAndExecuteDeployments(options, args) {
1100
+ async function loadAndExecuteDeployments(options, context, args) {
1093
1101
  const resolvedConfig = readAndResolveConfig(options);
1094
- return executeDeployScripts(resolvedConfig, args);
1102
+ return executeDeployScripts(resolvedConfig, context, args);
1095
1103
  }
1096
- async function executeDeployScripts(config, args) {
1104
+ async function executeDeployScripts(config, context, args) {
1097
1105
  setLogLevel(typeof config.logLevel === "undefined" ? 0 : config.logLevel);
1098
1106
  let filepaths;
1099
1107
  filepaths = traverseMultipleDirectory([config.scripts]);
@@ -1106,7 +1114,8 @@ async function executeDeployScripts(config, args) {
1106
1114
  }
1107
1115
  return 0;
1108
1116
  });
1109
- let providedContext;
1117
+ let providedContext = context;
1118
+ const providedFromArguments = !!providedContext;
1110
1119
  const scriptModuleByFilePath = {};
1111
1120
  const scriptPathBags = {};
1112
1121
  const scriptFilePaths = [];
@@ -1126,10 +1135,12 @@ async function executeDeployScripts(config, args) {
1126
1135
  }
1127
1136
  }
1128
1137
  scriptModuleByFilePath[scriptFilePath] = scriptModule;
1129
- if (providedContext && providedContext !== scriptModule.providedContext) {
1130
- throw new Error(`context between 2 scripts is different, please share the same across them`);
1138
+ if (!providedFromArguments) {
1139
+ if (providedContext && providedContext !== scriptModule.providedContext) {
1140
+ throw new Error(`context between 2 scripts is different, please share the same across them`);
1141
+ }
1142
+ providedContext = scriptModule.providedContext;
1131
1143
  }
1132
- providedContext = scriptModule.providedContext;
1133
1144
  } catch (e) {
1134
1145
  logger.error(`could not import ${filepath}`);
1135
1146
  throw e;
@@ -1285,4 +1296,4 @@ Do you want to proceed (note that gas price can change for each tx)`
1285
1296
  }
1286
1297
 
1287
1298
  export { execute as a, readAndResolveConfig as b, resolveConfig as c, loadEnvironment as d, extendEnvironment as e, loadAndExecuteDeployments as f, executeDeployScripts as g, handleSignerProtocol as h, chainTypes as i, chainById as j, getChain as k, loadDeployments as l, mergeArtifacts as m, getGasPriceEstimate as n, getRoughGasPriceEstimate as o, readConfig as r };
1288
- //# sourceMappingURL=index-DOSnToHV.mjs.map
1299
+ //# sourceMappingURL=index-Cs7zkNfV.mjs.map