fix(traverse): Make ToHash trait public outside crate (#186)
This commit is contained in:
parent
f7720d7232
commit
e710494bea
4 changed files with 7 additions and 9 deletions
|
|
@ -1,11 +1,8 @@
|
||||||
|
use crate::ToHash;
|
||||||
use pallas_codec::utils::KeepRaw;
|
use pallas_codec::utils::KeepRaw;
|
||||||
use pallas_crypto::hash::{Hash, Hasher};
|
use pallas_crypto::hash::{Hash, Hasher};
|
||||||
use pallas_primitives::{alonzo, babbage, byron};
|
use pallas_primitives::{alonzo, babbage, byron};
|
||||||
|
|
||||||
pub(crate) trait ToHash<const BYTES: usize> {
|
|
||||||
fn to_hash(&self) -> pallas_crypto::hash::Hash<BYTES>;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ToHash<32> for byron::EbbHead {
|
impl ToHash<32> for byron::EbbHead {
|
||||||
fn to_hash(&self) -> Hash<32> {
|
fn to_hash(&self) -> Hash<32> {
|
||||||
// hash expects to have a prefix for the type of block
|
// hash expects to have a prefix for the type of block
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,8 @@ use pallas_codec::minicbor;
|
||||||
use pallas_crypto::hash::{Hash, Hasher};
|
use pallas_crypto::hash::{Hash, Hasher};
|
||||||
use pallas_primitives::{alonzo, babbage, byron};
|
use pallas_primitives::{alonzo, babbage, byron};
|
||||||
|
|
||||||
use crate::hashes::ToHash;
|
|
||||||
use crate::time;
|
use crate::time;
|
||||||
use crate::{Era, Error, MultiEraHeader};
|
use crate::{Era, Error, MultiEraHeader, ToHash};
|
||||||
|
|
||||||
impl<'b> MultiEraHeader<'b> {
|
impl<'b> MultiEraHeader<'b> {
|
||||||
pub fn decode(tag: u8, subtag: Option<u8>, cbor: &'b [u8]) -> Result<Self, Error> {
|
pub fn decode(tag: u8, subtag: Option<u8>, cbor: &'b [u8]) -> Result<Self, Error> {
|
||||||
|
|
|
||||||
|
|
@ -171,3 +171,7 @@ impl Error {
|
||||||
Error::InvalidUtxoRef(str.to_owned())
|
Error::InvalidUtxoRef(str.to_owned())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub trait ToHash<const BYTES: usize> {
|
||||||
|
fn to_hash(&self) -> pallas_crypto::hash::Hash<BYTES>;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,9 @@ use pallas_codec::{minicbor, utils::KeepRaw};
|
||||||
use pallas_crypto::hash::Hash;
|
use pallas_crypto::hash::Hash;
|
||||||
use pallas_primitives::{alonzo, babbage, byron};
|
use pallas_primitives::{alonzo, babbage, byron};
|
||||||
|
|
||||||
use crate::hashes::ToHash;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
Era, MultiEraCert, MultiEraInput, MultiEraMeta, MultiEraMint, MultiEraOutput, MultiEraSigners,
|
Era, MultiEraCert, MultiEraInput, MultiEraMeta, MultiEraMint, MultiEraOutput, MultiEraSigners,
|
||||||
MultiEraTx, MultiEraWithdrawals, MultiEraWitnesses,
|
MultiEraTx, MultiEraWithdrawals, MultiEraWitnesses, ToHash,
|
||||||
};
|
};
|
||||||
|
|
||||||
impl<'b> MultiEraTx<'b> {
|
impl<'b> MultiEraTx<'b> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue