Skip to content

Commit

Permalink
fix(crypto): expose operation hash as blake2b schema
Browse files Browse the repository at this point in the history
  • Loading branch information
zcabter committed Nov 18, 2024
1 parent f750ddf commit ed18ad5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/jstz_crypto/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use boa_gc::{empty_trace, Finalize, Trace};
use derive_more::{Display, Error};
use hex::FromHexError;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;

#[derive(
Debug,
Expand All @@ -20,6 +21,7 @@ use serde::{Deserialize, Serialize};
Deserialize,
Default,
Finalize,
ToSchema,
)]
pub struct Blake2b([u8; 32]);

Expand Down
10 changes: 9 additions & 1 deletion crates/jstz_node/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,14 @@
},
"components": {
"schemas": {
"Blake2b": {
"type": "array",
"items": {
"type": "integer",
"format": "int32",
"minimum": 0
}
},
"Content": {
"oneOf": [
{
Expand Down Expand Up @@ -669,7 +677,7 @@
],
"properties": {
"hash": {
"type": "string"
"$ref": "#/components/schemas/Blake2b"
},
"result": {
"$ref": "#/components/schemas/ReceiptResult"
Expand Down
1 change: 0 additions & 1 deletion crates/jstz_proto/src/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ impl From<Result<ReceiptContent>> for ReceiptResult {

#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct Receipt {
#[schema(value_type = String)]
hash: OperationHash,
pub result: ReceiptResult,
}
Expand Down

0 comments on commit ed18ad5

Please sign in to comment.