Skip to content

Commit 3381c5b

Browse files
authored
fix(rust/cardano-blockchain-types): remove hashes.rs and conversion.rs (#152)
* fix(cardano-blockchain-types): remove hashes.rs and conversion.rs Signed-off-by: bkioshn <[email protected]> * fix(cardano-blockchain-types): use cat-types Signed-off-by: bkioshn <[email protected]> * fix(cardano-blockchain-types): remove unused dep Signed-off-by: bkioshn <[email protected]> * fix(cardano-blockchain-types): format Signed-off-by: bkioshn <[email protected]> * fix(cardano-blockchain-types): doctest Signed-off-by: bkioshn <[email protected]> --------- Signed-off-by: bkioshn <[email protected]>
1 parent de369c5 commit 3381c5b

File tree

11 files changed

+15
-212
lines changed

11 files changed

+15
-212
lines changed

rust/cardano-blockchain-types/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ workspace = true
1919

2020
[dependencies]
2121
pallas = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }
22-
pallas-crypto = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }
2322
# pallas-hardano = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }
2423
cbork-utils = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "v0.0.11" }
2524
catalyst-types = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250108-00" }

rust/cardano-blockchain-types/src/auxdata/metadatum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
33
use std::sync::Arc;
44

5+
use catalyst_types::conversion::from_saturating;
56
use dashmap::DashMap;
67
use minicbor::Decode;
78

89
use super::{metadatum_label::MetadatumLabel, metadatum_value::MetadatumValue};
9-
use crate::conversion::from_saturating;
1010

1111
/// Transaction Metadata
1212
/// See: <https://github.com/IntersectMBO/cardano-ledger/blob/78b32d585fd4a0340fb2b184959fb0d46f32c8d2/eras/conway/impl/cddl-files/conway.cddl#L519>

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

-55
This file was deleted.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
use std::fmt;
1010

11-
use crate::conversion::from_saturating;
11+
use catalyst_types::conversion::from_saturating;
1212

1313
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd)]
1414
/// Counter that is incremented every time there is a roll-back in live-chain.

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

-144
This file was deleted.

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

-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
//! Catalyst Enhanced `MultiEraBlock` Structures
22
33
mod auxdata;
4-
pub mod conversion;
54
mod fork;
6-
pub mod hashes;
75
mod metadata;
86
mod multi_era_block_data;
97
mod network;

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
use std::{ffi::OsStr, path::PathBuf};
44

5+
use catalyst_types::conversion::from_saturating;
56
use chrono::{DateTime, Utc};
67
use pallas::{
78
ledger::traverse::wellknown::GenesisValues,
@@ -11,7 +12,7 @@ use pallas::{
1112
// use strum_macros;
1213
use tracing::debug;
1314

14-
use crate::{conversion::from_saturating, Slot};
15+
use crate::Slot;
1516

1617
/// Default name of the executable if we can't derive it.
1718
pub(crate) const DEFAULT_EXE_NAME: &str = "cardano_chain_follower";

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ use std::{
88
fmt::{Debug, Display, Formatter},
99
};
1010

11+
use catalyst_types::hashes::Blake2b256Hash;
1112
use pallas::crypto::hash::Hash;
1213

13-
use crate::{hashes::Blake2b256Hash, Slot};
14+
use crate::Slot;
1415

1516
/// A specific point in the blockchain. It can be used to
1617
/// identify a particular location within the blockchain, such as the tip (the
@@ -279,7 +280,8 @@ impl Point {
279280
/// # Examples
280281
///
281282
/// ```
282-
/// use cardano_blockchain_types::{hashes::Blake2b256Hash, Point};
283+
/// use cardano_blockchain_types::Point;
284+
/// use catalyst_types::hashes::Blake2b256Hash;
283285
///
284286
/// let specific_point = Point::new(42.into(), [0; 32].into());
285287
/// assert_eq!(
@@ -489,7 +491,9 @@ fn cmp_point(
489491

490492
#[cfg(test)]
491493
mod tests {
492-
use crate::{hashes::Blake2bHash, point::*};
494+
use catalyst_types::hashes::Blake2bHash;
495+
496+
use crate::point::*;
493497

494498
#[test]
495499
fn test_cmp_hash_simple() {

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ use std::{
55
ops::{MulAssign, Sub},
66
};
77

8+
use catalyst_types::conversion::from_saturating;
89
use num_bigint::{BigInt, Sign};
910
use serde::Serialize;
1011

11-
use crate::conversion::from_saturating;
12-
1312
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Default, Serialize)]
1413

1514
/// Slot on the blockchain, typically one slot equals one second. However chain

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Transaction Index
2-
use crate::conversion::from_saturating;
2+
use catalyst_types::conversion::from_saturating;
33

44
/// Transaction index within a block
55
/// See: <https://github.com/IntersectMBO/cardano-ledger/blob/78b32d585fd4a0340fb2b184959fb0d46f32c8d2/eras/conway/impl/cddl-files/conway.cddl#L20C1-L20C33>

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
//! Transaction Witness
22
use std::fmt::{Display, Formatter};
33

4+
use catalyst_types::{conversion::vkey_from_bytes, hashes::Blake2b224Hash};
45
use dashmap::{DashMap, DashSet};
56
use ed25519_dalek::VerifyingKey;
67
use pallas::ledger::traverse::MultiEraTx;
78

8-
use crate::{conversion::vkey_from_bytes, hashes::Blake2b224Hash, TxnIndex};
9+
use crate::TxnIndex;
910

1011
/// Hash of a witness verifying public key
1112
pub type VKeyHash = Blake2b224Hash;

0 commit comments

Comments
 (0)