From 384f94ac1e6f216e7016bcd18e36dcb6d5d46f41 Mon Sep 17 00:00:00 2001 From: Micaiah Reid Date: Wed, 14 Feb 2024 16:22:10 -0500 Subject: [PATCH] chore: update reveal schema (#500) Co-authored-by: Ludo Galabru --- Cargo.lock | 6 +++--- components/chainhook-cli/Cargo.toml | 2 +- components/chainhook-sdk/Cargo.toml | 4 ++-- components/chainhook-sdk/src/observer/tests/mod.rs | 6 +++++- components/chainhook-sdk/src/observer/zmq.rs | 1 + components/chainhook-types-rs/Cargo.toml | 2 +- components/chainhook-types-rs/src/rosetta.rs | 7 ++++++- docs/chainhook-openapi.json | 2 +- 8 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d976dacad..c23a4808b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -407,7 +407,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chainhook" -version = "1.3.0" +version = "1.3.1" dependencies = [ "ansi_term", "atty", @@ -446,7 +446,7 @@ dependencies = [ [[package]] name = "chainhook-sdk" -version = "0.12.1" +version = "0.12.5" dependencies = [ "base58 0.2.0", "base64 0.21.5", @@ -481,7 +481,7 @@ dependencies = [ [[package]] name = "chainhook-types" -version = "1.3.1" +version = "1.3.3" dependencies = [ "hex", "schemars", diff --git a/components/chainhook-cli/Cargo.toml b/components/chainhook-cli/Cargo.toml index ae07fd139..f5ce0c451 100644 --- a/components/chainhook-cli/Cargo.toml +++ b/components/chainhook-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chainhook" -version = "1.3.0" +version = "1.3.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/components/chainhook-sdk/Cargo.toml b/components/chainhook-sdk/Cargo.toml index 8b0d0beb1..d85a8dcd5 100644 --- a/components/chainhook-sdk/Cargo.toml +++ b/components/chainhook-sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chainhook-sdk" -version = "0.12.1" +version = "0.12.5" description = "Stateless Transaction Indexing Engine for Stacks and Bitcoin" license = "GPL-3.0" edition = "2021" @@ -16,7 +16,7 @@ stacks-rpc-client = "2" hiro-system-kit = { version = "0.3.1", optional = true } # stacks-rpc-client = { version = "1", path = "../../../clarinet/components/stacks-rpc-client" } # hiro-system-kit = { version = "0.1.0", path = "../../../clarinet/components/hiro-system-kit" } -chainhook-types = { version = "1.3.0", path = "../chainhook-types-rs" } +chainhook-types = { version = "1.3.3", path = "../chainhook-types-rs" } rocket = { version = "=0.5.0-rc.3", features = ["json"] } bitcoincore-rpc = "0.18.0" bitcoincore-rpc-json = "0.18.0" diff --git a/components/chainhook-sdk/src/observer/tests/mod.rs b/components/chainhook-sdk/src/observer/tests/mod.rs index 965dc4ca4..7b678d2ce 100644 --- a/components/chainhook-sdk/src/observer/tests/mod.rs +++ b/components/chainhook-sdk/src/observer/tests/mod.rs @@ -1146,8 +1146,12 @@ fn test_bitcoin_chainhook_through_reorg() { inscription_output_value: cursor, inscription_id: format!("{cursor}"), inscription_input_index: 0, - inscription_pointer: 0, + inscription_pointer: None, inscriber_address: None, + metadata: None, + metaprotocol: None, + delegate: None, + parent: None, ordinal_number: cursor, ordinal_block_height: b.block.block_identifier.index, ordinal_offset: 0, diff --git a/components/chainhook-sdk/src/observer/zmq.rs b/components/chainhook-sdk/src/observer/zmq.rs index 30a50592f..5d31a7dea 100644 --- a/components/chainhook-sdk/src/observer/zmq.rs +++ b/components/chainhook-sdk/src/observer/zmq.rs @@ -148,6 +148,7 @@ pub async fn start_zeromq_runloop( "Possible re-org detected, retrieving parent block {parent_block_hash}" ) }); + block_hashes.push_front(block_hash); block_hashes.push_front(parent_block_hash); } } diff --git a/components/chainhook-types-rs/Cargo.toml b/components/chainhook-types-rs/Cargo.toml index da83955e0..a09f1b58c 100644 --- a/components/chainhook-types-rs/Cargo.toml +++ b/components/chainhook-types-rs/Cargo.toml @@ -2,7 +2,7 @@ name = "chainhook-types" description = "Bitcoin and Stacks data schemas, based on the Rosetta specification" license = "MIT" -version = "1.3.1" +version = "1.3.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/components/chainhook-types-rs/src/rosetta.rs b/components/chainhook-types-rs/src/rosetta.rs index 88d98535d..ef0ab908a 100644 --- a/components/chainhook-types-rs/src/rosetta.rs +++ b/components/chainhook-types-rs/src/rosetta.rs @@ -2,6 +2,7 @@ use super::bitcoin::{TxIn, TxOut}; use crate::contract_interface::ContractInterface; use crate::events::*; use schemars::JsonSchema; +use serde_json::Value; use std::cmp::Ordering; use std::collections::HashSet; use std::fmt::Display; @@ -363,8 +364,12 @@ pub struct OrdinalInscriptionRevealData { pub inscription_output_value: u64, pub inscription_id: String, pub inscription_input_index: usize, - pub inscription_pointer: u64, + pub inscription_pointer: Option, pub inscriber_address: Option, + pub delegate: Option, + pub metaprotocol: Option, + pub metadata: Option, + pub parent: Option, pub ordinal_number: u64, pub ordinal_block_height: u64, pub ordinal_offset: u64, diff --git a/docs/chainhook-openapi.json b/docs/chainhook-openapi.json index b050194dc..c7c4957d0 100644 --- a/docs/chainhook-openapi.json +++ b/docs/chainhook-openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.0", "info": { "title": "chainhook", - "version": "1.3.0" + "version": "1.3.1" }, "paths": { "/ping": {