@hardkas/localnet 0.6.0-alpha → 0.6.1-alpha

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -2
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -148,6 +148,7 @@ function createInitialLocalnetState(options = {}) {
148
148
  hardkasVersion: HARDKAS_VERSION,
149
149
  version: "1.0.0-alpha",
150
150
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
151
+ // hardkas-determinism-allow: initial state creation timestamp
151
152
  mode: "simulated",
152
153
  networkId: "simnet",
153
154
  daaScore: "0",
@@ -304,6 +305,7 @@ function createLocalnetSnapshot(state, name) {
304
305
  hardkasVersion: HARDKAS_VERSION2,
305
306
  version: ARTIFACT_VERSION,
306
307
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
308
+ // hardkas-determinism-allow: snapshot creation timestamp
307
309
  name,
308
310
  daaScore: state.daaScore,
309
311
  accountsHash,
@@ -1066,8 +1068,10 @@ import { ARTIFACT_SCHEMAS as ARTIFACT_SCHEMAS2, HARDKAS_VERSION as HARDKAS_VERSI
1066
1068
  async function forkFromNetwork(rpc, opts) {
1067
1069
  const info = await rpc.getInfo();
1068
1070
  const networkId = info.networkId || opts.network;
1069
- const currentDaaScore = info.virtualDaaScore?.toString() || "0";
1070
- const targetDaaScore = opts.atDaaScore || currentDaaScore;
1071
+ const targetDaaScore = opts.atDaaScore;
1072
+ if (!targetDaaScore) {
1073
+ throw new Error(`[CRITICAL SEMANTIC ERROR] Implicit 'latest' resolution forbidden. You must explicitly provide atDaaScore.`);
1074
+ }
1071
1075
  const utxos = [];
1072
1076
  for (const address of opts.addresses) {
1073
1077
  const rpcUtxos = await rpc.getUtxosByAddress(address);
@@ -1088,6 +1092,7 @@ async function forkFromNetwork(rpc, opts) {
1088
1092
  hashVersion: "sha256-canonical",
1089
1093
  mode: "simulated",
1090
1094
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1095
+ // hardkas-determinism-allow: fork state creation timestamp
1091
1096
  networkId,
1092
1097
  daaScore: targetDaaScore,
1093
1098
  accounts: opts.addresses.map((addr, i) => ({
@@ -1100,6 +1105,7 @@ async function forkFromNetwork(rpc, opts) {
1100
1105
  rpcUrl: opts.rpcUrl,
1101
1106
  daaScore: targetDaaScore,
1102
1107
  forkedAt: (/* @__PURE__ */ new Date()).toISOString(),
1108
+ // hardkas-determinism-allow: fork source timestamp
1103
1109
  addresses: opts.addresses
1104
1110
  }
1105
1111
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hardkas/localnet",
3
- "version": "0.6.0-alpha",
3
+ "version": "0.6.1-alpha",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -8,12 +8,12 @@
8
8
  ".": "./dist/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@hardkas/artifacts": "0.6.0-alpha",
12
- "@hardkas/core": "0.6.0-alpha",
13
- "@hardkas/query": "0.6.0-alpha",
14
- "@hardkas/simulator": "0.6.0-alpha",
15
- "@hardkas/kaspa-rpc": "0.6.0-alpha",
16
- "@hardkas/tx-builder": "0.6.0-alpha"
11
+ "@hardkas/artifacts": "0.6.1-alpha",
12
+ "@hardkas/core": "0.6.1-alpha",
13
+ "@hardkas/simulator": "0.6.1-alpha",
14
+ "@hardkas/query": "0.6.1-alpha",
15
+ "@hardkas/tx-builder": "0.6.1-alpha",
16
+ "@hardkas/kaspa-rpc": "0.6.1-alpha"
17
17
  },
18
18
  "devDependencies": {
19
19
  "fast-check": "^4.8.0",