Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pallas-primitives/src/alonzo/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ pub struct HeaderBody {
}

#[derive(Serialize, Deserialize, Encode, Decode, Debug, PartialEq, Eq, Clone)]
pub struct Header {
#[n(0)]
pub header_body: HeaderBody,
pub struct Header<'b> {
#[b(0)]
pub header_body: KeepRaw<'b, HeaderBody>,

#[n(1)]
pub body_signature: Bytes,
}

#[deprecated(since = "1.0.0-alpha", note = "use `KeepRaw<'_, Header>` instead")]
pub type MintedHeader<'a> = KeepRaw<'a, Header>;
#[deprecated(since = "1.0.0-alpha", note = "use `KeepRaw<'_, Header<'_>>` instead")]
pub type MintedHeader<'a> = KeepRaw<'a, Header<'a>>;

pub type Multiasset<A> = BTreeMap<PolicyId, BTreeMap<AssetName, A>>;

Expand Down Expand Up @@ -469,7 +469,7 @@ codec_by_datatype! {
#[derive(Serialize, Deserialize, Encode, Decode, Debug, PartialEq, Clone)]
pub struct Block<'b> {
#[n(0)]
pub header: KeepRaw<'b, Header>,
pub header: KeepRaw<'b, Header<'b>>,

#[b(1)]
pub transaction_bodies: Vec<KeepRaw<'b, TransactionBody>>,
Expand Down
12 changes: 6 additions & 6 deletions pallas-primitives/src/babbage/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ pub struct OperationalCert {
}

#[derive(Serialize, Deserialize, Encode, Decode, Debug, PartialEq, Eq, Clone)]
pub struct Header {
#[n(0)]
pub header_body: HeaderBody,
pub struct Header<'b> {
#[b(0)]
pub header_body: KeepRaw<'b, HeaderBody>,

#[n(1)]
pub body_signature: Bytes,
}

#[deprecated(since = "1.0.0-alpha", note = "use `KeepRaw<'_, Header>` instead")]
pub type MintedHeader<'a> = KeepRaw<'a, Header>;
#[deprecated(since = "1.0.0-alpha", note = "use `KeepRaw<'_, Header<'_>>` instead")]
pub type MintedHeader<'a> = KeepRaw<'a, Header<'a>>;

pub use crate::alonzo::Multiasset;

Expand Down Expand Up @@ -417,7 +417,7 @@ pub use crate::alonzo::AuxiliaryData;
#[derive(Serialize, Encode, Decode, Debug, PartialEq, Clone)]
pub struct Block<'b> {
#[n(0)]
pub header: KeepRaw<'b, Header>,
pub header: KeepRaw<'b, Header<'b>>,

#[b(1)]
pub transaction_bodies: Vec<KeepRaw<'b, TransactionBody<'b>>>,
Expand Down
2 changes: 1 addition & 1 deletion pallas-primitives/src/conway/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ pub use crate::alonzo::AuxiliaryData;
#[derive(Serialize, Deserialize, Encode, Decode, Debug, PartialEq, Clone)]
pub struct Block<'b> {
#[n(0)]
pub header: KeepRaw<'b, Header>,
pub header: KeepRaw<'b, Header<'b>>,

#[b(1)]
pub transaction_bodies: Vec<KeepRaw<'b, TransactionBody<'b>>>,
Expand Down
8 changes: 4 additions & 4 deletions pallas-traverse/src/hashes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ impl OriginalHash<32> for KeepRaw<'_, byron::Tx> {
}
}

impl ComputeHash<32> for alonzo::Header {
impl ComputeHash<32> for alonzo::Header<'_> {
fn compute_hash(&self) -> pallas_crypto::hash::Hash<32> {
Hasher::<256>::hash_cbor(self)
}
}

impl OriginalHash<32> for KeepRaw<'_, alonzo::Header> {
impl OriginalHash<32> for KeepRaw<'_, alonzo::Header<'_>> {
fn original_hash(&self) -> pallas_crypto::hash::Hash<32> {
Hasher::<256>::hash(self.raw_cbor())
}
Expand Down Expand Up @@ -106,13 +106,13 @@ impl OriginalHash<32> for KeepRaw<'_, alonzo::TransactionBody> {
}
}

impl ComputeHash<32> for babbage::Header {
impl ComputeHash<32> for babbage::Header<'_> {
fn compute_hash(&self) -> pallas_crypto::hash::Hash<32> {
Hasher::<256>::hash_cbor(self)
}
}

impl OriginalHash<32> for KeepRaw<'_, babbage::Header> {
impl OriginalHash<32> for KeepRaw<'_, babbage::Header<'_>> {
fn original_hash(&self) -> pallas_crypto::hash::Hash<32> {
Hasher::<256>::hash(self.raw_cbor())
}
Expand Down
4 changes: 2 additions & 2 deletions pallas-traverse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ pub enum Feature {
#[derive(Debug)]
pub enum MultiEraHeader<'b> {
EpochBoundary(Cow<'b, KeepRaw<'b, byron::EbbHead>>),
ShelleyCompatible(Cow<'b, KeepRaw<'b, alonzo::Header>>),
BabbageCompatible(Cow<'b, KeepRaw<'b, babbage::Header>>),
ShelleyCompatible(Cow<'b, KeepRaw<'b, alonzo::Header<'b>>>),
BabbageCompatible(Cow<'b, KeepRaw<'b, babbage::Header<'b>>>),
Byron(Cow<'b, KeepRaw<'b, byron::BlockHead>>),
}

Expand Down
Loading