feat: include the pox contract id in stx_lock_event payloads (e.g. <addr>.pox or <addr>.pox-2)

This commit is contained in:
Matthew Little
2022-11-21 20:06:32 +01:00
parent 8b6a62103d
commit baab8b9bb2
2 changed files with 9 additions and 0 deletions

View File

@@ -181,6 +181,7 @@ pub struct STXLockEventData {
pub locked_amount: u128,
pub unlock_height: u64,
pub locked_address: PrincipalData,
pub contract_identifier: QualifiedContractIdentifier,
}
impl STXLockEventData {
@@ -189,6 +190,7 @@ impl STXLockEventData {
"locked_amount": format!("{}",self.locked_amount),
"unlock_height": format!("{}", self.unlock_height),
"locked_address": format!("{}", self.locked_address),
"contract_identifier": self.contract_identifier.to_string(),
})
}
}

View File

@@ -217,6 +217,10 @@ fn handle_pox_v1_api_contract_call(
locked_amount,
unlock_height,
locked_address: stacker,
contract_identifier: boot_code_id(
"pox",
global_context.mainnet,
),
}),
));
}
@@ -668,6 +672,7 @@ fn handle_stack_lockup(
locked_amount,
unlock_height,
locked_address: stacker,
contract_identifier: boot_code_id("pox-2", global_context.mainnet),
},
));
return Ok(Some(event));
@@ -726,6 +731,7 @@ fn handle_stack_lockup_extension(
locked_amount,
unlock_height,
locked_address: stacker,
contract_identifier: boot_code_id("pox-2", global_context.mainnet),
},
));
return Ok(Some(event));
@@ -787,6 +793,7 @@ fn handle_stack_lockup_increase(
locked_amount: new_balance.amount_locked(),
unlock_height: new_balance.unlock_height(),
locked_address: stacker,
contract_identifier: boot_code_id("pox-2", global_context.mainnet),
},
));