Skip to content

Commit 77f3870

Browse files
Add TransactionHash and PubKeyHash types
1 parent e251dea commit 77f3870

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

rust/cardano-blockchain-types/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ workspace = true
2020
[dependencies]
2121
pallas = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }
2222
# pallas-hardano = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }
23-
cbork-utils = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250127-00" }
24-
catalyst-types = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250127-00" }
23+
cbork-utils = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250128-01" }
24+
catalyst-types = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250128-01" }
2525

2626
ouroboros = "0.18.4"
2727
tracing = "0.1.41"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use catalyst_types::{
2+
define_hashes,
3+
hashes::{Blake2b224Hash, Blake2b256Hash},
4+
};
5+
6+
define_hashes!(
7+
/// A transaction hash - Blake2b-256 hash of a transaction.
8+
(TransactionHash, Blake2b256Hash),
9+
/// A public key hash - raw Blake2b-224 hash of an Ed25519 public key (has no discriminator, just the hash).
10+
(PubKeyHash, Blake2b224Hash)
11+
);

rust/cardano-blockchain-types/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
mod auxdata;
44
mod cip134_uri;
55
mod fork;
6+
mod hashes;
67
mod metadata;
78
mod multi_era_block_data;
89
mod network;
@@ -21,6 +22,7 @@ pub use auxdata::{
2122
};
2223
pub use cip134_uri::Cip0134Uri;
2324
pub use fork::Fork;
25+
pub use hashes::{PubKeyHash, TransactionHash};
2426
pub use metadata::cip36::{voting_pk::VotingPubKey, Cip36};
2527
pub use multi_era_block_data::MultiEraBlock;
2628
pub use network::Network;

0 commit comments

Comments
 (0)