Skip to content

Commit f79b505

Browse files
committed
added check for liquidity
1 parent 9dab144 commit f79b505

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12721,7 +12721,29 @@ fn test_sip_031_activation() {
1272112721

1272212722
wait_for_first_naka_block_commit(60, &commits_submitted);
1272312723

12724-
// mine until epooch 3.2 height
12724+
// retrieve current liquidity
12725+
let last_block_id = StacksBlockId::from_hex(
12726+
&test_observer::get_blocks()
12727+
.last()
12728+
.unwrap()
12729+
.get("index_block_hash")
12730+
.unwrap()
12731+
.as_str()
12732+
.unwrap()[2..],
12733+
)
12734+
.unwrap();
12735+
12736+
let sip_031_initial_total_liquid_ustx = chainstate
12737+
.with_read_only_clarity_tx(
12738+
&sortdb
12739+
.index_handle_at_block(&chainstate, &last_block_id)
12740+
.unwrap(),
12741+
&last_block_id,
12742+
|conn| conn.with_clarity_db_readonly(|db| db.get_total_liquid_ustx().unwrap()),
12743+
)
12744+
.unwrap();
12745+
12746+
// mine until epoch 3.2 height
1272512747
loop {
1272612748
let commits_before = commits_submitted.load(Ordering::SeqCst);
1272712749
next_block_and_process_new_stacks_block(&mut btc_regtest_controller, 60, &coord_channel)
@@ -12798,6 +12820,19 @@ fn test_sip_031_activation() {
1279812820
}))
1279912821
);
1280012822

12823+
// check liquidity has been updated accordingly
12824+
let sip_031_total_liquid_ustx = chainstate
12825+
.with_read_only_clarity_tx(
12826+
&sortdb
12827+
.index_handle_at_block(&chainstate, &latest_stacks_block_id)
12828+
.unwrap(),
12829+
&latest_stacks_block_id,
12830+
|conn| conn.with_clarity_db_readonly(|db| db.get_total_liquid_ustx().unwrap()),
12831+
)
12832+
.unwrap();
12833+
12834+
assert!(sip_031_total_liquid_ustx - sip_031_initial_total_liquid_ustx >= SIP_031_INITIAL_MINT);
12835+
1280112836
// check if the coinbase activation block receipt has the mint event
1280212837
let mut mint_event_found: Option<serde_json::Value> = None;
1280312838
let mut coinbase_txid: Option<String> = None;

0 commit comments

Comments
 (0)