fix(traverse): use Conway types in places they are meant to (#499)
This commit is contained in:
parent
2758cc5a2c
commit
afc93b2c3c
8 changed files with 78 additions and 22 deletions
|
|
@ -175,6 +175,22 @@ where
|
||||||
Indef(Vec<(K, V)>),
|
Indef(Vec<(K, V)>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<K, V> IntoIterator for NonEmptyKeyValuePairs<K, V>
|
||||||
|
where
|
||||||
|
K: Clone,
|
||||||
|
V: Clone,
|
||||||
|
{
|
||||||
|
type Item = (K, V);
|
||||||
|
type IntoIter = std::vec::IntoIter<Self::Item>;
|
||||||
|
|
||||||
|
fn into_iter(self) -> Self::IntoIter {
|
||||||
|
match self {
|
||||||
|
NonEmptyKeyValuePairs::Def(pairs) => pairs.into_iter(),
|
||||||
|
NonEmptyKeyValuePairs::Indef(pairs) => pairs.into_iter(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<K, V> NonEmptyKeyValuePairs<K, V>
|
impl<K, V> NonEmptyKeyValuePairs<K, V>
|
||||||
where
|
where
|
||||||
K: Clone,
|
K: Clone,
|
||||||
|
|
@ -911,6 +927,12 @@ impl From<PositiveCoin> for u64 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<&PositiveCoin> for u64 {
|
||||||
|
fn from(x: &PositiveCoin) -> Self {
|
||||||
|
u64::from(*x)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'b, C> minicbor::decode::Decode<'b, C> for PositiveCoin {
|
impl<'b, C> minicbor::decode::Decode<'b, C> for PositiveCoin {
|
||||||
fn decode(d: &mut minicbor::Decoder<'b>, ctx: &mut C) -> Result<Self, minicbor::decode::Error> {
|
fn decode(d: &mut minicbor::Decoder<'b>, ctx: &mut C) -> Result<Self, minicbor::decode::Error> {
|
||||||
let n = d.decode_with(ctx)?;
|
let n = d.decode_with(ctx)?;
|
||||||
|
|
|
||||||
|
|
@ -370,24 +370,25 @@ impl<'b> From<MintedTransactionOutput<'b>> for TransactionOutput {
|
||||||
|
|
||||||
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
|
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
|
||||||
#[cbor(map)]
|
#[cbor(map)]
|
||||||
pub struct PseudoPostAlonzoTransactionOutput<T1, T2> {
|
pub struct PseudoPostAlonzoTransactionOutput<T1, T2, T3> {
|
||||||
#[n(0)]
|
#[n(0)]
|
||||||
pub address: Bytes,
|
pub address: Bytes,
|
||||||
|
|
||||||
#[n(1)]
|
#[n(1)]
|
||||||
pub value: Value,
|
pub value: T1,
|
||||||
|
|
||||||
#[n(2)]
|
#[n(2)]
|
||||||
pub datum_option: Option<T1>,
|
pub datum_option: Option<T2>,
|
||||||
|
|
||||||
#[n(3)]
|
#[n(3)]
|
||||||
pub script_ref: Option<CborWrap<T2>>,
|
pub script_ref: Option<CborWrap<T3>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type PostAlonzoTransactionOutput = PseudoPostAlonzoTransactionOutput<DatumOption, ScriptRef>;
|
pub type PostAlonzoTransactionOutput =
|
||||||
|
PseudoPostAlonzoTransactionOutput<Value, DatumOption, ScriptRef>;
|
||||||
|
|
||||||
pub type MintedPostAlonzoTransactionOutput<'b> =
|
pub type MintedPostAlonzoTransactionOutput<'b> =
|
||||||
PseudoPostAlonzoTransactionOutput<MintedDatumOption<'b>, MintedScriptRef<'b>>;
|
PseudoPostAlonzoTransactionOutput<Value, MintedDatumOption<'b>, MintedScriptRef<'b>>;
|
||||||
|
|
||||||
impl<'b> From<MintedPostAlonzoTransactionOutput<'b>> for PostAlonzoTransactionOutput {
|
impl<'b> From<MintedPostAlonzoTransactionOutput<'b>> for PostAlonzoTransactionOutput {
|
||||||
fn from(value: MintedPostAlonzoTransactionOutput<'b>) -> Self {
|
fn from(value: MintedPostAlonzoTransactionOutput<'b>) -> Self {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ pub use crate::alonzo::AssetName;
|
||||||
|
|
||||||
pub type Multiasset<A> = NonEmptyKeyValuePairs<PolicyId, NonEmptyKeyValuePairs<AssetName, A>>;
|
pub type Multiasset<A> = NonEmptyKeyValuePairs<PolicyId, NonEmptyKeyValuePairs<AssetName, A>>;
|
||||||
|
|
||||||
pub use crate::alonzo::Mint;
|
pub type Mint = Multiasset<NonZeroInt>;
|
||||||
|
|
||||||
pub use crate::alonzo::Coin;
|
pub use crate::alonzo::Coin;
|
||||||
|
|
||||||
|
|
@ -720,7 +720,7 @@ pub struct PseudoTransactionBody<T1> {
|
||||||
pub certificates: Option<NonEmptySet<Certificate>>,
|
pub certificates: Option<NonEmptySet<Certificate>>,
|
||||||
|
|
||||||
#[n(5)]
|
#[n(5)]
|
||||||
pub withdrawals: Option<KeyValuePairs<RewardAccount, Coin>>, // TODO: NON EMPTY
|
pub withdrawals: Option<NonEmptyKeyValuePairs<RewardAccount, Coin>>,
|
||||||
|
|
||||||
#[n(7)]
|
#[n(7)]
|
||||||
pub auxiliary_data_hash: Option<Bytes>,
|
pub auxiliary_data_hash: Option<Bytes>,
|
||||||
|
|
@ -1220,7 +1220,8 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub use crate::babbage::PseudoPostAlonzoTransactionOutput;
|
pub type PostAlonzoTransactionOutput =
|
||||||
|
crate::babbage::PseudoPostAlonzoTransactionOutput<Value, DatumOption, ScriptRef>;
|
||||||
|
|
||||||
pub type TransactionOutput = PseudoTransactionOutput<PostAlonzoTransactionOutput>;
|
pub type TransactionOutput = PseudoTransactionOutput<PostAlonzoTransactionOutput>;
|
||||||
|
|
||||||
|
|
@ -1236,10 +1237,11 @@ impl<'b> From<MintedTransactionOutput<'b>> for TransactionOutput {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type PostAlonzoTransactionOutput = PseudoPostAlonzoTransactionOutput<DatumOption, ScriptRef>;
|
pub type MintedPostAlonzoTransactionOutput<'b> = crate::babbage::PseudoPostAlonzoTransactionOutput<
|
||||||
|
Value,
|
||||||
pub type MintedPostAlonzoTransactionOutput<'b> =
|
MintedDatumOption<'b>,
|
||||||
PseudoPostAlonzoTransactionOutput<MintedDatumOption<'b>, MintedScriptRef<'b>>;
|
MintedScriptRef<'b>,
|
||||||
|
>;
|
||||||
|
|
||||||
impl<'b> From<MintedPostAlonzoTransactionOutput<'b>> for PostAlonzoTransactionOutput {
|
impl<'b> From<MintedPostAlonzoTransactionOutput<'b>> for PostAlonzoTransactionOutput {
|
||||||
fn from(value: MintedPostAlonzoTransactionOutput<'b>) -> Self {
|
fn from(value: MintedPostAlonzoTransactionOutput<'b>) -> Self {
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ impl<'b> MultiEraPolicyAssets<'b> {
|
||||||
MultiEraPolicyAssets::AlonzoCompatibleMint(x, _) => x,
|
MultiEraPolicyAssets::AlonzoCompatibleMint(x, _) => x,
|
||||||
MultiEraPolicyAssets::AlonzoCompatibleOutput(x, _) => x,
|
MultiEraPolicyAssets::AlonzoCompatibleOutput(x, _) => x,
|
||||||
MultiEraPolicyAssets::ConwayMint(x, _) => x,
|
MultiEraPolicyAssets::ConwayMint(x, _) => x,
|
||||||
|
MultiEraPolicyAssets::ConwayOutput(x, _) => x,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -16,6 +17,7 @@ impl<'b> MultiEraPolicyAssets<'b> {
|
||||||
MultiEraPolicyAssets::AlonzoCompatibleMint(_, _) => false,
|
MultiEraPolicyAssets::AlonzoCompatibleMint(_, _) => false,
|
||||||
MultiEraPolicyAssets::AlonzoCompatibleOutput(_, _) => true,
|
MultiEraPolicyAssets::AlonzoCompatibleOutput(_, _) => true,
|
||||||
MultiEraPolicyAssets::ConwayMint(_, _) => false,
|
MultiEraPolicyAssets::ConwayMint(_, _) => false,
|
||||||
|
MultiEraPolicyAssets::ConwayOutput(_, _) => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -24,6 +26,7 @@ impl<'b> MultiEraPolicyAssets<'b> {
|
||||||
MultiEraPolicyAssets::AlonzoCompatibleMint(_, _) => true,
|
MultiEraPolicyAssets::AlonzoCompatibleMint(_, _) => true,
|
||||||
MultiEraPolicyAssets::AlonzoCompatibleOutput(_, _) => false,
|
MultiEraPolicyAssets::AlonzoCompatibleOutput(_, _) => false,
|
||||||
MultiEraPolicyAssets::ConwayMint(_, _) => true,
|
MultiEraPolicyAssets::ConwayMint(_, _) => true,
|
||||||
|
MultiEraPolicyAssets::ConwayOutput(_, _) => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,6 +44,10 @@ impl<'b> MultiEraPolicyAssets<'b> {
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(k, v)| MultiEraAsset::ConwayMint(p, k, *v))
|
.map(|(k, v)| MultiEraAsset::ConwayMint(p, k, *v))
|
||||||
.collect(),
|
.collect(),
|
||||||
|
MultiEraPolicyAssets::ConwayOutput(p, x) => x
|
||||||
|
.iter()
|
||||||
|
.map(|(k, v)| MultiEraAsset::ConwayOutput(p, k, *v))
|
||||||
|
.collect(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,7 +64,11 @@ impl<'b> MultiEraPolicyAssets<'b> {
|
||||||
}
|
}
|
||||||
MultiEraPolicyAssets::ConwayMint(_, x) => x
|
MultiEraPolicyAssets::ConwayMint(_, x) => x
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(k, v)| (k.as_slice(), i64::from(v) as i128))
|
.map(|(k, v)| (k.as_slice(), i64::from(*v) as i128))
|
||||||
|
.collect(),
|
||||||
|
MultiEraPolicyAssets::ConwayOutput(_, x) => x
|
||||||
|
.iter()
|
||||||
|
.map(|(k, v)| (k.as_slice(), u64::from(*v) as i128))
|
||||||
.collect(),
|
.collect(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -69,6 +80,7 @@ impl<'b> MultiEraAsset<'b> {
|
||||||
MultiEraAsset::AlonzoCompatibleMint(x, ..) => x,
|
MultiEraAsset::AlonzoCompatibleMint(x, ..) => x,
|
||||||
MultiEraAsset::AlonzoCompatibleOutput(x, ..) => x,
|
MultiEraAsset::AlonzoCompatibleOutput(x, ..) => x,
|
||||||
MultiEraAsset::ConwayMint(x, ..) => x,
|
MultiEraAsset::ConwayMint(x, ..) => x,
|
||||||
|
MultiEraAsset::ConwayOutput(x, ..) => x,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,6 +89,7 @@ impl<'b> MultiEraAsset<'b> {
|
||||||
MultiEraAsset::AlonzoCompatibleMint(_, x, _) => x,
|
MultiEraAsset::AlonzoCompatibleMint(_, x, _) => x,
|
||||||
MultiEraAsset::AlonzoCompatibleOutput(_, x, _) => x,
|
MultiEraAsset::AlonzoCompatibleOutput(_, x, _) => x,
|
||||||
MultiEraAsset::ConwayMint(_, x, _) => x,
|
MultiEraAsset::ConwayMint(_, x, _) => x,
|
||||||
|
MultiEraAsset::ConwayOutput(_, x, _) => x,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,6 +98,7 @@ impl<'b> MultiEraAsset<'b> {
|
||||||
MultiEraAsset::AlonzoCompatibleMint(..) => false,
|
MultiEraAsset::AlonzoCompatibleMint(..) => false,
|
||||||
MultiEraAsset::AlonzoCompatibleOutput(..) => true,
|
MultiEraAsset::AlonzoCompatibleOutput(..) => true,
|
||||||
MultiEraAsset::ConwayMint(..) => false,
|
MultiEraAsset::ConwayMint(..) => false,
|
||||||
|
MultiEraAsset::ConwayOutput(..) => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,6 +107,7 @@ impl<'b> MultiEraAsset<'b> {
|
||||||
MultiEraAsset::AlonzoCompatibleMint(..) => true,
|
MultiEraAsset::AlonzoCompatibleMint(..) => true,
|
||||||
MultiEraAsset::AlonzoCompatibleOutput(..) => false,
|
MultiEraAsset::AlonzoCompatibleOutput(..) => false,
|
||||||
MultiEraAsset::ConwayMint(..) => true,
|
MultiEraAsset::ConwayMint(..) => true,
|
||||||
|
MultiEraAsset::ConwayOutput(..) => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -101,6 +116,7 @@ impl<'b> MultiEraAsset<'b> {
|
||||||
MultiEraAsset::AlonzoCompatibleMint(_, _, x) => Some(*x),
|
MultiEraAsset::AlonzoCompatibleMint(_, _, x) => Some(*x),
|
||||||
MultiEraAsset::AlonzoCompatibleOutput(_, _, _) => None,
|
MultiEraAsset::AlonzoCompatibleOutput(_, _, _) => None,
|
||||||
MultiEraAsset::ConwayMint(_, _, x) => Some(x.into()),
|
MultiEraAsset::ConwayMint(_, _, x) => Some(x.into()),
|
||||||
|
MultiEraAsset::ConwayOutput(_, _, _) => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,6 +125,7 @@ impl<'b> MultiEraAsset<'b> {
|
||||||
MultiEraAsset::AlonzoCompatibleMint(_, _, _) => None,
|
MultiEraAsset::AlonzoCompatibleMint(_, _, _) => None,
|
||||||
MultiEraAsset::AlonzoCompatibleOutput(_, _, x) => Some(*x),
|
MultiEraAsset::AlonzoCompatibleOutput(_, _, x) => Some(*x),
|
||||||
MultiEraAsset::ConwayMint(_, _, _) => None,
|
MultiEraAsset::ConwayMint(_, _, _) => None,
|
||||||
|
MultiEraAsset::ConwayOutput(_, _, x) => Some(u64::from(x)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,6 +134,7 @@ impl<'b> MultiEraAsset<'b> {
|
||||||
MultiEraAsset::AlonzoCompatibleMint(_, _, x) => *x as i128,
|
MultiEraAsset::AlonzoCompatibleMint(_, _, x) => *x as i128,
|
||||||
MultiEraAsset::AlonzoCompatibleOutput(_, _, x) => *x as i128,
|
MultiEraAsset::AlonzoCompatibleOutput(_, _, x) => *x as i128,
|
||||||
MultiEraAsset::ConwayMint(_, _, x) => i64::from(x) as i128,
|
MultiEraAsset::ConwayMint(_, _, x) => i64::from(x) as i128,
|
||||||
|
MultiEraAsset::ConwayOutput(_, _, x) => u64::from(x) as i128,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
//! Utilities to traverse over multi-era block data
|
//! Utilities to traverse over multi-era block data
|
||||||
|
|
||||||
|
use pallas_codec::utils::NonZeroInt;
|
||||||
|
use pallas_codec::utils::PositiveCoin;
|
||||||
use std::{borrow::Cow, fmt::Display, hash::Hash as StdHash};
|
use std::{borrow::Cow, fmt::Display, hash::Hash as StdHash};
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
use pallas_codec::utils::{KeepRaw, KeyValuePairs, NonEmptyKeyValuePairs, NonZeroInt};
|
use pallas_codec::utils::{KeepRaw, KeyValuePairs, NonEmptyKeyValuePairs};
|
||||||
use pallas_crypto::hash::Hash;
|
use pallas_crypto::hash::Hash;
|
||||||
use pallas_primitives::{alonzo, babbage, byron, conway};
|
use pallas_primitives::{alonzo, babbage, byron, conway};
|
||||||
|
|
||||||
|
|
@ -145,6 +147,10 @@ pub enum MultiEraPolicyAssets<'b> {
|
||||||
&'b alonzo::PolicyId,
|
&'b alonzo::PolicyId,
|
||||||
&'b NonEmptyKeyValuePairs<alonzo::AssetName, NonZeroInt>,
|
&'b NonEmptyKeyValuePairs<alonzo::AssetName, NonZeroInt>,
|
||||||
),
|
),
|
||||||
|
ConwayOutput(
|
||||||
|
&'b alonzo::PolicyId,
|
||||||
|
&'b NonEmptyKeyValuePairs<alonzo::AssetName, PositiveCoin>,
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
@ -152,6 +158,7 @@ pub enum MultiEraPolicyAssets<'b> {
|
||||||
pub enum MultiEraAsset<'b> {
|
pub enum MultiEraAsset<'b> {
|
||||||
AlonzoCompatibleOutput(&'b alonzo::PolicyId, &'b alonzo::AssetName, u64),
|
AlonzoCompatibleOutput(&'b alonzo::PolicyId, &'b alonzo::AssetName, u64),
|
||||||
AlonzoCompatibleMint(&'b alonzo::PolicyId, &'b alonzo::AssetName, i64),
|
AlonzoCompatibleMint(&'b alonzo::PolicyId, &'b alonzo::AssetName, i64),
|
||||||
|
ConwayOutput(&'b alonzo::PolicyId, &'b alonzo::AssetName, PositiveCoin),
|
||||||
ConwayMint(&'b alonzo::PolicyId, &'b alonzo::AssetName, NonZeroInt),
|
ConwayMint(&'b alonzo::PolicyId, &'b alonzo::AssetName, NonZeroInt),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -161,6 +168,7 @@ pub enum MultiEraWithdrawals<'b> {
|
||||||
NotApplicable,
|
NotApplicable,
|
||||||
Empty,
|
Empty,
|
||||||
AlonzoCompatible(&'b alonzo::Withdrawals),
|
AlonzoCompatible(&'b alonzo::Withdrawals),
|
||||||
|
Conway(&'b conway::Withdrawals),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
|
||||||
|
|
@ -188,8 +188,8 @@ impl<'b> MultiEraOutput<'b> {
|
||||||
babbage::Value::Multiasset(c, _) => c,
|
babbage::Value::Multiasset(c, _) => c,
|
||||||
},
|
},
|
||||||
conway::MintedTransactionOutput::PostAlonzo(x) => match x.value {
|
conway::MintedTransactionOutput::PostAlonzo(x) => match x.value {
|
||||||
babbage::Value::Coin(c) => c,
|
conway::Value::Coin(c) => c,
|
||||||
babbage::Value::Multiasset(c, _) => c,
|
conway::Value::Multiasset(c, _) => c,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -235,10 +235,10 @@ impl<'b> MultiEraOutput<'b> {
|
||||||
.collect(),
|
.collect(),
|
||||||
},
|
},
|
||||||
conway::MintedTransactionOutput::PostAlonzo(x) => match &x.value {
|
conway::MintedTransactionOutput::PostAlonzo(x) => match &x.value {
|
||||||
babbage::Value::Coin(_) => vec![],
|
conway::Value::Coin(_) => vec![],
|
||||||
babbage::Value::Multiasset(_, x) => x
|
conway::Value::Multiasset(_, x) => x
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(k, v)| MultiEraPolicyAssets::AlonzoCompatibleOutput(k, v))
|
.map(|(k, v)| MultiEraPolicyAssets::ConwayOutput(k, v))
|
||||||
.collect(),
|
.collect(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,11 @@ impl<'b> MultiEraTx<'b> {
|
||||||
.map(|(k, v)| (k.as_slice(), *v))
|
.map(|(k, v)| (k.as_slice(), *v))
|
||||||
.sorted_by_key(|(k, _)| *k)
|
.sorted_by_key(|(k, _)| *k)
|
||||||
.collect(),
|
.collect(),
|
||||||
|
MultiEraWithdrawals::Conway(x) => x
|
||||||
|
.iter()
|
||||||
|
.map(|(k, v)| (k.as_slice(), *v))
|
||||||
|
.sorted_by_key(|(k, _)| *k)
|
||||||
|
.collect(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -463,9 +468,8 @@ impl<'b> MultiEraTx<'b> {
|
||||||
None => MultiEraWithdrawals::Empty,
|
None => MultiEraWithdrawals::Empty,
|
||||||
},
|
},
|
||||||
MultiEraTx::Byron(_) => MultiEraWithdrawals::NotApplicable,
|
MultiEraTx::Byron(_) => MultiEraWithdrawals::NotApplicable,
|
||||||
// TODO: non empty still compatible?
|
|
||||||
MultiEraTx::Conway(x) => match &x.transaction_body.withdrawals {
|
MultiEraTx::Conway(x) => match &x.transaction_body.withdrawals {
|
||||||
Some(x) => MultiEraWithdrawals::AlonzoCompatible(x),
|
Some(x) => MultiEraWithdrawals::Conway(x),
|
||||||
None => MultiEraWithdrawals::Empty,
|
None => MultiEraWithdrawals::Empty,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ impl<'b> MultiEraWithdrawals<'b> {
|
||||||
MultiEraWithdrawals::AlonzoCompatible(x) => {
|
MultiEraWithdrawals::AlonzoCompatible(x) => {
|
||||||
x.iter().map(|(k, v)| (k.as_slice(), *v)).collect()
|
x.iter().map(|(k, v)| (k.as_slice(), *v)).collect()
|
||||||
}
|
}
|
||||||
|
MultiEraWithdrawals::Conway(x) => x.iter().map(|(k, v)| (k.as_slice(), *v)).collect(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue