mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-01-12 22:43:06 +08:00
fix: documentation drift
This commit is contained in:
10
README.md
10
README.md
@@ -129,7 +129,7 @@ The current `bitcoin` predicates supports the following `if_this` constructs:
|
||||
// Broadcasted payloads include Proof of Transfer reward informations.
|
||||
{
|
||||
"if_this": {
|
||||
"protocol": "stacks",
|
||||
"scope": "stacks_protocol",
|
||||
"operation": "block_committed"
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ The current `bitcoin` predicates supports the following `if_this` constructs:
|
||||
// Get any transaction including a key registration operation
|
||||
{
|
||||
"if_this": {
|
||||
"protocol": "stacks",
|
||||
"scope": "stacks_protocol",
|
||||
"operation": "leader_key_registered"
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,7 @@ The current `bitcoin` predicates supports the following `if_this` constructs:
|
||||
// Coming soon
|
||||
{
|
||||
"if_this": {
|
||||
"protocol": "stacks",
|
||||
"scope": "stacks_protocol",
|
||||
"operation": "stx_transfered"
|
||||
}
|
||||
}
|
||||
@@ -155,7 +155,7 @@ The current `bitcoin` predicates supports the following `if_this` constructs:
|
||||
// Coming soon
|
||||
{
|
||||
"if_this": {
|
||||
"protocol": "stacks",
|
||||
"scope": "stacks_protocol",
|
||||
"operation": "stx_locked"
|
||||
}
|
||||
}
|
||||
@@ -163,7 +163,7 @@ The current `bitcoin` predicates supports the following `if_this` constructs:
|
||||
// Get any transaction including a new Ordinal inscription (inscription revealed and transfered)
|
||||
{
|
||||
"if_this": {
|
||||
"protocol": "ordinals",
|
||||
"scope": "ordinals_protocol",
|
||||
"operation": "inscription_feed"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::service::Service;
|
||||
use chainhook_event_observer::bitcoincore_rpc::{Auth, Client, RpcApi};
|
||||
use chainhook_event_observer::chainhooks::types::{
|
||||
BitcoinChainhookFullSpecification, BitcoinChainhookNetworkSpecification, BitcoinPredicateType,
|
||||
ChainhookFullSpecification, FileHook, HookAction, OrdinalOperations, Protocols,
|
||||
ChainhookFullSpecification, FileHook, HookAction, OrdinalOperations,
|
||||
StacksChainhookFullSpecification, StacksChainhookNetworkSpecification, StacksPredicate,
|
||||
StacksPrintEventBasedPredicate,
|
||||
};
|
||||
@@ -463,9 +463,9 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
|
||||
BitcoinChainhookNetworkSpecification {
|
||||
start_block: Some(0),
|
||||
end_block: Some(100),
|
||||
predicate: BitcoinPredicateType::Protocol(Protocols::Ordinal(
|
||||
predicate: BitcoinPredicateType::OrdinalsProtocol(
|
||||
OrdinalOperations::InscriptionFeed,
|
||||
)),
|
||||
),
|
||||
expire_after_occurrence: None,
|
||||
action: HookAction::FileAppend(FileHook {
|
||||
path: "ordinals.txt".into(),
|
||||
|
||||
@@ -6,7 +6,7 @@ use chainhook_event_observer::chainhooks::bitcoin::{
|
||||
BitcoinChainhookOccurrence, BitcoinTriggerChainhook,
|
||||
};
|
||||
use chainhook_event_observer::chainhooks::types::{
|
||||
BitcoinChainhookSpecification, BitcoinPredicateType, Protocols,
|
||||
BitcoinChainhookSpecification, BitcoinPredicateType,
|
||||
};
|
||||
use chainhook_event_observer::hord::db::{
|
||||
fetch_and_cache_blocks_in_hord_db, find_all_inscriptions, find_block_at_block_height,
|
||||
@@ -71,7 +71,7 @@ pub async fn scan_bitcoin_chainstate_via_http_using_predicate(
|
||||
let mut is_predicate_evaluating_ordinals = false;
|
||||
let mut hord_blocks_requires_update = false;
|
||||
|
||||
if let BitcoinPredicateType::Protocol(Protocols::Ordinal(_)) = &predicate_spec.predicate {
|
||||
if let BitcoinPredicateType::OrdinalsProtocol(_) = &predicate_spec.predicate {
|
||||
is_predicate_evaluating_ordinals = true;
|
||||
if let Ok(inscriptions_db_conn) =
|
||||
open_readonly_hord_db_conn(&config.expected_cache_path(), &ctx)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use super::types::{
|
||||
BitcoinChainhookSpecification, BitcoinPredicateType, ExactMatchingRule, HookAction,
|
||||
InputPredicate, MatchingRule, OrdinalOperations, OutputPredicate, Protocols, StacksOperations,
|
||||
InputPredicate, MatchingRule, OrdinalOperations, OutputPredicate, StacksOperations,
|
||||
};
|
||||
use crate::utils::Context;
|
||||
|
||||
@@ -373,9 +373,7 @@ impl BitcoinPredicateType {
|
||||
// TODO(lgalabru)
|
||||
unimplemented!()
|
||||
}
|
||||
BitcoinPredicateType::Protocol(Protocols::Stacks(
|
||||
StacksOperations::StackerRewarded,
|
||||
)) => {
|
||||
BitcoinPredicateType::StacksProtocol(StacksOperations::StackerRewarded) => {
|
||||
for op in tx.metadata.stacks_operations.iter() {
|
||||
if let StacksBaseChainOperation::BlockCommitted(_) = op {
|
||||
return true;
|
||||
@@ -383,7 +381,7 @@ impl BitcoinPredicateType {
|
||||
}
|
||||
false
|
||||
}
|
||||
BitcoinPredicateType::Protocol(Protocols::Stacks(StacksOperations::BlockCommitted)) => {
|
||||
BitcoinPredicateType::StacksProtocol(StacksOperations::BlockCommitted) => {
|
||||
for op in tx.metadata.stacks_operations.iter() {
|
||||
if let StacksBaseChainOperation::BlockCommitted(_) = op {
|
||||
return true;
|
||||
@@ -391,9 +389,7 @@ impl BitcoinPredicateType {
|
||||
}
|
||||
false
|
||||
}
|
||||
BitcoinPredicateType::Protocol(Protocols::Stacks(
|
||||
StacksOperations::LeaderRegistered,
|
||||
)) => {
|
||||
BitcoinPredicateType::StacksProtocol(StacksOperations::LeaderRegistered) => {
|
||||
for op in tx.metadata.stacks_operations.iter() {
|
||||
if let StacksBaseChainOperation::LeaderRegistered(_) = op {
|
||||
return true;
|
||||
@@ -401,7 +397,7 @@ impl BitcoinPredicateType {
|
||||
}
|
||||
false
|
||||
}
|
||||
BitcoinPredicateType::Protocol(Protocols::Stacks(StacksOperations::StxTransfered)) => {
|
||||
BitcoinPredicateType::StacksProtocol(StacksOperations::StxTransfered) => {
|
||||
for op in tx.metadata.stacks_operations.iter() {
|
||||
if let StacksBaseChainOperation::StxTransfered(_) = op {
|
||||
return true;
|
||||
@@ -409,7 +405,7 @@ impl BitcoinPredicateType {
|
||||
}
|
||||
false
|
||||
}
|
||||
BitcoinPredicateType::Protocol(Protocols::Stacks(StacksOperations::StxLocked)) => {
|
||||
BitcoinPredicateType::StacksProtocol(StacksOperations::StxLocked) => {
|
||||
for op in tx.metadata.stacks_operations.iter() {
|
||||
if let StacksBaseChainOperation::StxLocked(_) = op {
|
||||
return true;
|
||||
@@ -417,9 +413,7 @@ impl BitcoinPredicateType {
|
||||
}
|
||||
false
|
||||
}
|
||||
BitcoinPredicateType::Protocol(Protocols::Ordinal(
|
||||
OrdinalOperations::InscriptionFeed,
|
||||
)) => {
|
||||
BitcoinPredicateType::OrdinalsProtocol(OrdinalOperations::InscriptionFeed) => {
|
||||
for op in tx.metadata.ordinal_operations.iter() {
|
||||
if let OrdinalOperation::InscriptionRevealed(_) = op {
|
||||
return true;
|
||||
|
||||
@@ -469,7 +469,8 @@ pub enum BitcoinPredicateType {
|
||||
Txid(ExactMatchingRule),
|
||||
Inputs(InputPredicate),
|
||||
Outputs(OutputPredicate),
|
||||
Protocol(Protocols),
|
||||
StacksProtocol(StacksOperations),
|
||||
OrdinalsProtocol(OrdinalOperations),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)]
|
||||
@@ -489,13 +490,6 @@ pub enum OutputPredicate {
|
||||
P2wsh(ExactMatchingRule),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum Protocols {
|
||||
Stacks(StacksOperations),
|
||||
Ordinal(OrdinalOperations),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum StacksOperations {
|
||||
|
||||
Reference in New Issue
Block a user