fix: deployer predicate wildcard

This commit is contained in:
Ludo Galabru
2023-02-19 22:54:21 -06:00
parent 85c642b56b
commit 05ca395da1
2 changed files with 16 additions and 6 deletions

View File

@@ -159,12 +159,16 @@ pub async fn scan_stacks_chain_with_predicate(
rollback: vec![],
};
match handle_stacks_hook_action(trigger, &proofs, &ctx) {
Err(_e) => {}
Err(e) => {
error!(ctx.expect_logger(), "unable to handle action {}", e);
}
Ok(StacksChainhookOccurrence::Http(request)) => {
send_request(request, &ctx).await;
}
Ok(StacksChainhookOccurrence::File(path, bytes)) => file_append(path, bytes, &ctx),
Ok(StacksChainhookOccurrence::Data(_payload)) => {}
Ok(StacksChainhookOccurrence::File(path, bytes)) => {
file_append(path, bytes, &ctx);
}
Ok(StacksChainhookOccurrence::Data(_payload)) => unreachable!(),
}
}

View File

@@ -267,9 +267,15 @@ pub fn evaluate_stacks_predicate_on_transaction<'a>(
StacksPredicate::ContractDeployment(StacksContractDeploymentPredicate::Deployer(
expected_deployer,
)) => match &transaction.metadata.kind {
StacksTransactionKind::ContractDeployment(actual_deployment) => actual_deployment
.contract_identifier
.starts_with(expected_deployer),
StacksTransactionKind::ContractDeployment(actual_deployment) => {
if expected_deployer.eq("*") {
true
} else {
actual_deployment
.contract_identifier
.starts_with(expected_deployer)
}
}
_ => false,
},
StacksPredicate::ContractDeployment(StacksContractDeploymentPredicate::ImplementSip09) => {