fix: stacks predicate format

This commit is contained in:
Ludo Galabru
2023-06-29 20:04:31 -04:00
parent 572cf202ba
commit fcf9fb0e3f
2 changed files with 5 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
use crate::utils::{AbstractStacksBlock, Context};
use super::types::{
BlockIdentifierIndexRule, HookAction, StacksChainhookSpecification,
BlockIdentifierIndexRule, ExactMatchingRule, HookAction, StacksChainhookSpecification,
StacksContractDeploymentPredicate, StacksPredicate,
};
use chainhook_types::{
@@ -399,7 +399,9 @@ pub fn evaluate_stacks_predicate_on_transaction<'a>(
}
false
}
StacksPredicate::Txid(txid) => txid.eq(&transaction.transaction_identifier.hash),
StacksPredicate::Txid(ExactMatchingRule::Equals(txid)) => {
txid.eq(&transaction.transaction_identifier.hash)
}
StacksPredicate::BlockHeight(_) => unreachable!(),
}
}

View File

@@ -738,7 +738,7 @@ pub enum StacksPredicate {
FtEvent(StacksFtEventBasedPredicate),
NftEvent(StacksNftEventBasedPredicate),
StxEvent(StacksStxEventBasedPredicate),
Txid(String),
Txid(ExactMatchingRule),
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)]