-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #272 from dcSpark/multi-era-tx
Multi-Era expanded functionality + Shelley Metadata set fix
- Loading branch information
Showing
30 changed files
with
2,621 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use cml_chain::{auxdata::AuxiliaryData, transaction::TransactionWitnessSet}; | ||
|
||
use super::{AllegraAuxiliaryData, AllegraTransactionWitnessSet}; | ||
|
||
impl From<AllegraAuxiliaryData> for AuxiliaryData { | ||
fn from(aux: AllegraAuxiliaryData) -> Self { | ||
match aux { | ||
AllegraAuxiliaryData::Shelley(md) => AuxiliaryData::new_shelley(md), | ||
AllegraAuxiliaryData::ShelleyMA(md) => AuxiliaryData::new_shelley_m_a(md), | ||
} | ||
} | ||
} | ||
|
||
impl From<AllegraTransactionWitnessSet> for TransactionWitnessSet { | ||
fn from(wits: AllegraTransactionWitnessSet) -> Self { | ||
let mut new_wits = TransactionWitnessSet::new(); | ||
new_wits.vkeywitnesses = wits.vkeywitnesses; | ||
new_wits.native_scripts = wits.native_scripts; | ||
new_wits.bootstrap_witnesses = wits.bootstrap_witnesses; | ||
new_wits | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use cml_chain::{ | ||
auxdata::{AuxiliaryData, ConwayFormatAuxData}, | ||
transaction::TransactionWitnessSet, | ||
}; | ||
|
||
use super::{AlonzoAuxiliaryData, AlonzoTransactionWitnessSet}; | ||
|
||
impl From<AlonzoAuxiliaryData> for AuxiliaryData { | ||
fn from(aux: AlonzoAuxiliaryData) -> Self { | ||
match aux { | ||
AlonzoAuxiliaryData::Shelley(md) => AuxiliaryData::new_shelley(md.clone()), | ||
AlonzoAuxiliaryData::ShelleyMA(md) => AuxiliaryData::new_shelley_m_a(md.clone()), | ||
AlonzoAuxiliaryData::Alonzo(md) => AuxiliaryData::new_conway({ | ||
let mut conway = ConwayFormatAuxData::new(); | ||
conway.metadata = md.metadata.clone(); | ||
conway.native_scripts = md.native_scripts.clone(); | ||
conway.plutus_v1_scripts = md.plutus_v1_scripts.clone(); | ||
conway | ||
}), | ||
} | ||
} | ||
} | ||
|
||
impl From<AlonzoTransactionWitnessSet> for TransactionWitnessSet { | ||
fn from(wits: AlonzoTransactionWitnessSet) -> Self { | ||
let mut new_wits = TransactionWitnessSet::new(); | ||
new_wits.vkeywitnesses = wits.vkeywitnesses; | ||
new_wits.native_scripts = wits.native_scripts; | ||
new_wits.bootstrap_witnesses = wits.bootstrap_witnesses; | ||
new_wits.redeemers = wits.redeemers; | ||
new_wits.plutus_datums = wits.plutus_datums; | ||
new_wits.plutus_v1_scripts = wits.plutus_v1_scripts; | ||
new_wits | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
use cml_chain::{ | ||
auxdata::{AuxiliaryData, ConwayFormatAuxData}, | ||
transaction::TransactionWitnessSet, | ||
Script, | ||
}; | ||
|
||
use super::{BabbageAuxiliaryData, BabbageScript, BabbageTransactionWitnessSet}; | ||
|
||
impl From<BabbageScript> for Script { | ||
fn from(script: BabbageScript) -> Script { | ||
match script { | ||
BabbageScript::Native { | ||
script, | ||
len_encoding, | ||
tag_encoding, | ||
} => Script::Native { | ||
script, | ||
len_encoding, | ||
tag_encoding, | ||
}, | ||
BabbageScript::PlutusV1 { | ||
script, | ||
len_encoding, | ||
tag_encoding, | ||
} => Script::PlutusV1 { | ||
script, | ||
len_encoding, | ||
tag_encoding, | ||
}, | ||
BabbageScript::PlutusV2 { | ||
script, | ||
len_encoding, | ||
tag_encoding, | ||
} => Script::PlutusV2 { | ||
script, | ||
len_encoding, | ||
tag_encoding, | ||
}, | ||
} | ||
} | ||
} | ||
|
||
impl From<BabbageAuxiliaryData> for AuxiliaryData { | ||
fn from(aux: BabbageAuxiliaryData) -> Self { | ||
match aux { | ||
BabbageAuxiliaryData::Shelley(md) => AuxiliaryData::new_shelley(md.clone()), | ||
BabbageAuxiliaryData::ShelleyMA(md) => AuxiliaryData::new_shelley_m_a(md.clone()), | ||
BabbageAuxiliaryData::Babbage(md) => AuxiliaryData::new_conway({ | ||
let mut conway = ConwayFormatAuxData::new(); | ||
conway.metadata = md.metadata.clone(); | ||
conway.native_scripts = md.native_scripts.clone(); | ||
conway.plutus_v1_scripts = md.plutus_v1_scripts.clone(); | ||
conway.plutus_v2_scripts = md.plutus_v2_scripts.clone(); | ||
conway | ||
}), | ||
} | ||
} | ||
} | ||
|
||
impl From<BabbageTransactionWitnessSet> for TransactionWitnessSet { | ||
fn from(wits: BabbageTransactionWitnessSet) -> Self { | ||
let mut new_wits = TransactionWitnessSet::new(); | ||
new_wits.vkeywitnesses = wits.vkeywitnesses; | ||
new_wits.native_scripts = wits.native_scripts; | ||
new_wits.bootstrap_witnesses = wits.bootstrap_witnesses; | ||
new_wits.redeemers = wits.redeemers; | ||
new_wits.plutus_datums = wits.plutus_datums; | ||
new_wits.plutus_v1_scripts = wits.plutus_v1_scripts; | ||
new_wits.plutus_v2_scripts = wits.plutus_v2_scripts; | ||
new_wits | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.