Skip to content

Commit 2c1f823

Browse files
committed
test: fix more tests
1 parent f6ec136 commit 2c1f823

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"fmt": "./node_modules/.bin/prettier --write ."
1212
},
1313
"dependencies": {
14-
"@hirosystems/stacks-devnet-js": "^2.5.0",
14+
"@hirosystems/stacks-devnet-js": "^2.5.1",
1515
"@noble/hashes": "^1.4.0",
1616
"@noble/secp256k1": "^2.1.0",
1717
"@scure/base": "^1.1.6",

tests/integration/clarity/natives/chain-id.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("chain-id", () => {
2121
let orchestrator: DevnetNetworkOrchestrator;
2222
let network: StacksNetwork;
2323

24-
let networkId: number;
24+
let networkId: number; // todo: remove these
2525

2626
beforeAll(() => {
2727
networkId = getNetworkIdFromEnv();

tests/integration/clarity/natives/stx-account.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
getBitcoinBlockHeight,
2121
waitForStacksTransaction,
2222
getNetworkIdFromEnv,
23-
getChainInfo,
23+
EPOCH_TIMELINE_LONG_2_1,
2424
} from "../../helpers";
2525
import { principalCV } from "@stacks/transactions/dist/clarity/types/principalCV";
2626
import { broadcastStackSTX } from "../../pox/helpers-direct-stacking";
@@ -34,9 +34,10 @@ describe("stx-account", () => {
3434
beforeAll(() => {
3535
networkId = getNetworkIdFromEnv();
3636
console.log(`network #${networkId}`);
37-
orchestrator = buildDevnetNetworkOrchestrator(networkId, {
38-
epoch_2_2: 300,
39-
});
37+
orchestrator = buildDevnetNetworkOrchestrator(
38+
networkId,
39+
EPOCH_TIMELINE_LONG_2_1,
40+
);
4041
orchestrator.start();
4142
network = new StacksTestnet({
4243
url: orchestrator.getStacksNodeUrl().replace("localhost", "127.0.0.1"),
@@ -332,11 +333,11 @@ describe("stx-account", () => {
332333
});
333334

334335
it("returns expected results when stacking", async () => {
335-
// Wait for block N-2 where N is the height of the next prepare phase
336+
// Wait for block N-3 where N is the height of the next prepare phase
336337
let chainUpdate = await waitForNextPreparePhase(
337338
network,
338339
orchestrator,
339-
-2,
340+
-3,
340341
);
341342
let blockHeight = getBitcoinBlockHeight(chainUpdate);
342343

tests/integration/clarity/traits/call-nested-1.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
buildDevnetNetworkOrchestrator,
55
getNetworkIdFromEnv,
66
getChainInfo,
7+
EPOCH_TIMELINE_LONG_2_05,
78
} from "../../helpers";
89
import { DevnetNetworkOrchestrator } from "@hirosystems/stacks-devnet-js";
910
import { contract_call, load_versioned } from "./helper";
@@ -13,19 +14,16 @@ import { contractPrincipalCV } from "@stacks/transactions/dist/clarity/types/pri
1314
describe("call functions with nested traits", () => {
1415
let orchestrator: DevnetNetworkOrchestrator;
1516
let network: StacksNetwork;
16-
const STACKS_2_1_EPOCH = 112;
1717

1818
let networkId: number;
1919

2020
beforeAll(() => {
2121
networkId = getNetworkIdFromEnv();
2222
console.log(`network #${networkId}`);
23-
orchestrator = buildDevnetNetworkOrchestrator(networkId, {
24-
epoch_2_0: 100,
25-
epoch_2_05: 102,
26-
epoch_2_1: STACKS_2_1_EPOCH,
27-
pox_2_activation: 120,
28-
});
23+
orchestrator = buildDevnetNetworkOrchestrator(
24+
networkId,
25+
EPOCH_TIMELINE_LONG_2_05,
26+
);
2927
orchestrator.start();
3028
network = new StacksTestnet({
3129
url: orchestrator.getStacksNodeUrl().replace("localhost", "127.0.0.1"),
@@ -78,14 +76,16 @@ describe("call functions with nested traits", () => {
7876

7977
// Make sure this we stayed in 2.05
8078
let chainInfo = await getChainInfo(network);
81-
expect(chainInfo.burn_block_height).toBeLessThanOrEqual(STACKS_2_1_EPOCH);
79+
expect(chainInfo.burn_block_height).toBeLessThanOrEqual(
80+
EPOCH_TIMELINE_LONG_2_05.epoch_2_1,
81+
);
8282
});
8383

8484
describe("in 2.1", () => {
8585
beforeAll(async () => {
8686
// Wait for 2.1 to go live
8787
await orchestrator.waitForStacksBlockAnchoredOnBitcoinBlockOfHeight(
88-
STACKS_2_1_EPOCH + 1,
88+
EPOCH_TIMELINE_LONG_2_05.epoch_2_1 + 1,
8989
);
9090
});
9191

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,10 @@
439439
resolved "https://registry.yarnpkg.com/@hirosystems/chainhook-types/-/chainhook-types-1.1.2.tgz#9e6788c6c74f3dc2bee64b7f97f1b5cd4c2db1cb"
440440
integrity sha512-klQDKRyiPqF9fgDetMLTPMcB4A/+Vo7px74RbzzvmnCSDMPQua0DD5zhfuo12Ga3pexFFoIftIqnSjWvjncKNQ==
441441

442-
"@hirosystems/stacks-devnet-js@^2.5.0":
443-
version "2.5.0"
444-
resolved "https://registry.yarnpkg.com/@hirosystems/stacks-devnet-js/-/stacks-devnet-js-2.5.0.tgz#7b64720ec5dadb1183c3df4471771b78c9eb2888"
445-
integrity sha512-yMJELdpMhxBgIKpPQjbMCmDCXM+8Ytq5od0Mtx5gHKLbQ0R4TsFBJ6456MVQX4M8Hw9nA0rFtPVGVt4ddpMGDw==
442+
"@hirosystems/stacks-devnet-js@^2.5.1":
443+
version "2.5.1"
444+
resolved "https://registry.yarnpkg.com/@hirosystems/stacks-devnet-js/-/stacks-devnet-js-2.5.1.tgz#be2b6d075da1bc0fdefa30d29e01b254e119f71b"
445+
integrity sha512-DTICeqHr8mMLHaMEF9/LxkgNZShABH4miGYQ36HfxuhCKbAodyy4vmAvOMkmG4ruuPQeLa9DvfV/3WHWcqu3PQ==
446446
dependencies:
447447
"@hirosystems/chainhook-types" "^1.1.2"
448448
"@mapbox/node-pre-gyp" "^1.0.8"

0 commit comments

Comments
 (0)