Skip to content

Commit 4e49608

Browse files
fix: add missing fields to ordinal inscription reveals (#703)
Multiple parents and charms --------- Co-authored-by: Hugo CAILLARD <[email protected]>
1 parent 5f13912 commit 4e49608

File tree

5 files changed

+91
-37
lines changed

5 files changed

+91
-37
lines changed

Cargo.lock

Lines changed: 42 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/chainhook-cli/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ redis = "0.21.5"
1515
serde-redis = "0.12.0"
1616
hex = "0.4.3"
1717
rand = "0.8.5"
18-
chainhook-sdk = { version = "0.12.6", default-features = false, features = [
19-
"zeromq", "stacks-signers"
18+
chainhook-sdk = { default-features = false, features = [
19+
"zeromq",
20+
"stacks-signers",
2021
], path = "../chainhook-sdk" }
2122
hiro-system-kit = "0.3.4"
2223
# hiro-system-kit = { path = "../../../clarinet/components/hiro-system-kit" }
@@ -46,7 +47,7 @@ rocket_okapi = { version = "0.8.0", git = "https://github.com/hirosystems/okapi.
4647
rocket = { version = "=0.5.0", features = ["json"] }
4748

4849
[dependencies.rocksdb]
49-
version = "0.20.1"
50+
version = "0.21.0"
5051
default-features = false
5152
features = ["lz4", "snappy"]
5253

components/chainhook-sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "chainhook-sdk"
3-
version = "0.12.11"
3+
version = "0.12.12"
44
description = "Stateless Transaction Indexing Engine for Stacks and Bitcoin"
55
license = "GPL-3.0"
66
edition = "2021"

components/chainhook-sdk/src/observer/tests/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use crate::observer::{
2525
start_observer_commands_handler, EventObserverConfig, ObserverCommand, ObserverSidecar,
2626
};
2727
use crate::utils::{AbstractBlock, Context};
28+
use chainhook_types::OrdinalInscriptionCharms;
2829
use chainhook_types::{
2930
BitcoinBlockSignaling, BitcoinChainEvent, BitcoinNetwork, BlockchainEvent,
3031
BlockchainUpdatedWithHeaders, OrdinalInscriptionNumber, OrdinalInscriptionRevealData,
@@ -1164,14 +1165,15 @@ fn test_bitcoin_chainhook_through_reorg() {
11641165
metadata: None,
11651166
metaprotocol: None,
11661167
delegate: None,
1167-
parent: None,
1168+
parents: vec![],
11681169
ordinal_number: cursor,
11691170
ordinal_block_height: b.block.block_identifier.index,
11701171
ordinal_offset: 0,
11711172
tx_index,
11721173
transfers_pre_inscription: cursor as u32,
11731174
satpoint_post_inscription: format!("{cursor}"),
11741175
curse_type: None,
1176+
charms: OrdinalInscriptionCharms::none(),
11751177
},
11761178
))
11771179
}

components/chainhook-types-rs/src/ordinals.rs

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,45 @@ pub enum OrdinalInscriptionCurseType {
3939
Generic,
4040
}
4141

42+
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
43+
pub struct OrdinalInscriptionCharms {
44+
pub coin: bool,
45+
pub cursed: bool,
46+
pub epic: bool,
47+
pub legendary: bool,
48+
pub lost: bool,
49+
pub nineball: bool,
50+
pub rare: bool,
51+
pub reinscription: bool,
52+
pub unbound: bool,
53+
pub uncommon: bool,
54+
pub vindicated: bool,
55+
pub mythic: bool,
56+
pub burned: bool,
57+
pub palindrome: bool,
58+
}
59+
60+
impl OrdinalInscriptionCharms {
61+
pub fn none() -> Self {
62+
OrdinalInscriptionCharms {
63+
coin: false,
64+
cursed: false,
65+
epic: false,
66+
legendary: false,
67+
lost: false,
68+
nineball: false,
69+
rare: false,
70+
reinscription: false,
71+
unbound: false,
72+
uncommon: false,
73+
vindicated: false,
74+
mythic: false,
75+
burned: false,
76+
palindrome: false,
77+
}
78+
}
79+
}
80+
4281
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
4382
pub struct OrdinalInscriptionRevealData {
4483
pub content_bytes: String,
@@ -54,14 +93,15 @@ pub struct OrdinalInscriptionRevealData {
5493
pub delegate: Option<String>,
5594
pub metaprotocol: Option<String>,
5695
pub metadata: Option<Value>,
57-
pub parent: Option<String>,
96+
pub parents: Vec<String>,
5897
pub ordinal_number: u64,
5998
pub ordinal_block_height: u64,
6099
pub ordinal_offset: u64,
61100
pub tx_index: usize,
62101
pub transfers_pre_inscription: u32,
63102
pub satpoint_post_inscription: String,
64103
pub curse_type: Option<OrdinalInscriptionCurseType>,
104+
pub charms: OrdinalInscriptionCharms,
65105
}
66106

67107
impl OrdinalInscriptionNumber {

0 commit comments

Comments
 (0)