Skip to content

Commit

Permalink
Complete the curse field added in Inscriptionview
Browse files Browse the repository at this point in the history
  • Loading branch information
baichuan3 committed Jun 12, 2024
1 parent 9892c38 commit c8f6150
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions crates/rooch-open-rpc-spec/schemas/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1418,9 +1418,12 @@
"bitcoin_txid",
"body",
"index",
"inscription_number",
"is_curse",
"metadata",
"offset",
"parents",
"sequence_number",
"txid"
],
"properties": {
Expand Down Expand Up @@ -1455,6 +1458,14 @@
"format": "uint32",
"minimum": 0.0
},
"inscription_number": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"is_curse": {
"type": "boolean"
},
"metadata": {
"$ref": "#/components/schemas/alloc::vec::Vec<u8>"
},
Expand Down Expand Up @@ -1484,6 +1495,11 @@
"format": "uint64",
"minimum": 0.0
},
"sequence_number": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"txid": {
"$ref": "#/components/schemas/primitive_types::H256"
}
Expand Down
6 changes: 6 additions & 0 deletions crates/rooch-rpc-api/src/jsonrpc_types/btc/ord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ pub struct InscriptionView {
pub bitcoin_txid: TxidView,
pub index: u32,
pub offset: u64,
pub sequence_number: u32,
pub inscription_number: u32,
pub is_curse: bool,
pub body: BytesView,
pub content_encoding: Option<MoveStringView>,
pub content_type: Option<MoveStringView>,
Expand All @@ -102,6 +105,9 @@ impl From<Inscription> for InscriptionView {
bitcoin_txid: StrView(Txid::from_byte_array(inscription.txid.into_bytes())),
index: inscription.index,
offset: inscription.offset,
sequence_number: inscription.sequence_number,
inscription_number: inscription.inscription_number,
is_curse: inscription.is_curse,
body: StrView(inscription.body),
content_encoding: Option::<MoveString>::from(inscription.content_encoding).map(StrView),
content_type: Option::<MoveString>::from(inscription.content_type).map(StrView),
Expand Down

0 comments on commit c8f6150

Please sign in to comment.