Skip to content

Commit c6f31b2

Browse files
committed
refactored boot contract deploy test
1 parent 1e411b4 commit c6f31b2

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12886,14 +12886,14 @@ fn test_sip_031_activation() {
1288612886

1288712887
// check if the coinbase activation block receipt has the mint event
1288812888
let mut mint_event_found: Option<serde_json::Value> = None;
12889-
let mut coinbase_txid: Option<String> = None;
12889+
let mut contract_deploy_txid: Option<String> = None;
1289012890
for block in test_observer::get_blocks().iter().rev() {
1289112891
let burn_block_height = block.get("burn_block_height").unwrap().as_u64().unwrap();
1289212892
if burn_block_height
1289312893
== naka_conf.burnchain.epochs.clone().unwrap()[StacksEpochId::Epoch32].start_height
1289412894
{
12895-
// the first transaction is the coinbase
12896-
coinbase_txid = Some(
12895+
// the first transaction is the boot contract deploy
12896+
contract_deploy_txid = Some(
1289712897
block
1289812898
.get("transactions")
1289912899
.unwrap()
@@ -12907,6 +12907,19 @@ fn test_sip_031_activation() {
1290712907
.unwrap()
1290812908
.into(),
1290912909
);
12910+
12911+
// ensure it has a contract_interface
12912+
assert!(block
12913+
.get("transactions")
12914+
.unwrap()
12915+
.as_array()
12916+
.unwrap()
12917+
.first()
12918+
.unwrap()
12919+
.get("contract_interface")
12920+
.unwrap()
12921+
.as_object()
12922+
.is_some());
1291012923
let events = block.get("events").unwrap().as_array().unwrap();
1291112924
for event in events {
1291212925
if let Some(_) = event.get("stx_mint_event") {
@@ -12918,7 +12931,7 @@ fn test_sip_031_activation() {
1291812931
}
1291912932
}
1292012933

12921-
assert!(coinbase_txid.is_some());
12934+
assert!(contract_deploy_txid.is_some());
1292212935
assert!(mint_event_found.is_some());
1292312936

1292412937
// check the amount
@@ -12958,7 +12971,7 @@ fn test_sip_031_activation() {
1295812971
.unwrap()
1295912972
.as_str()
1296012973
.unwrap(),
12961-
coinbase_txid.unwrap()
12974+
contract_deploy_txid.unwrap()
1296212975
);
1296312976

1296412977
coord_channel

0 commit comments

Comments
 (0)