@@ -3,17 +3,19 @@ import { StacksTestnet } from "@stacks/network";
33import { Accounts } from "../../constants" ;
44import {
55 buildDevnetNetworkOrchestrator ,
6- getNetworkIdFromEnv
6+ getNetworkIdFromEnv ,
77} from "../../helpers" ;
88import {
99 getPoxInfo ,
1010 waitForNextRewardPhase ,
11- waitForRewardCycleId
11+ waitForRewardCycleId ,
12+ readRewardCyclePoxAddressList ,
1213} from "../helpers" ;
1314import {
1415 broadcastStackIncrease ,
15- broadcastStackSTX
16+ broadcastStackSTX ,
1617} from "../helpers-direct-stacking" ;
18+ import { cvToString , hexToCV } from "@stacks/transactions" ;
1719
1820describe ( "testing stacking under epoch 2.1" , ( ) => {
1921 let orchestrator : DevnetNetworkOrchestrator ;
@@ -94,13 +96,23 @@ describe("testing stacking under epoch 2.1", () => {
9496
9597 // move on to the nexte cycle
9698 await waitForRewardCycleId ( network , orchestrator , 2 , 1 ) ;
97-
99+
98100 poxInfo = await getPoxInfo ( network ) ;
99101 // Assert that the current cycle has 100m STX locked and earning
100102 expect ( poxInfo . current_cycle . id ) . toBe ( 2 ) ;
101103 expect ( poxInfo . current_cycle . stacked_ustx ) . toBe ( 100_000_000_000_000 ) ;
102104 expect ( poxInfo . current_cycle . is_pox_active ) . toBe ( true ) ;
103105
106+ const poxAddrInfo0 = await readRewardCyclePoxAddressList ( network , 2 , 0 ) ;
107+ const poxAddrInfoStr0 = cvToString ( hexToCV ( poxAddrInfo0 . data ) ) ;
108+ // HERE'S THE BUG: THIS SHOULD BE `u80000000000000`
109+ // expect(poxAddrInfoStr0).toContain("(total-ustx u80000000000000)");
110+ expect ( poxAddrInfoStr0 ) . toContain ( "(total-ustx u100000000000000)" ) ;
111+
112+ const poxAddrInfo1 = await readRewardCyclePoxAddressList ( network , 2 , 1 ) ;
113+ const poxAddrInfoStr1 = cvToString ( hexToCV ( poxAddrInfo1 . data ) ) ;
114+ expect ( poxAddrInfoStr1 ) . toContain ( "(total-ustx u50000000000000)" ) ;
115+
104116 // move on to the nexte cycle
105117 await waitForNextRewardPhase ( network , orchestrator , 1 ) ;
106118
0 commit comments