Add script context translation for new Conway certificates
This commit is contained in:
@@ -108,17 +108,24 @@ pub fn scripts_needed(tx: &MintedTx, utxos: &[ResolvedInput]) -> Result<ScriptsN
|
||||
.map(|m| {
|
||||
m.iter()
|
||||
.enumerate()
|
||||
.filter_map(|(ix, cert)| {
|
||||
// only Dereg and Deleg certs can require scripts
|
||||
match cert {
|
||||
Certificate::StakeDeregistration(StakeCredential::Scripthash(h)) => {
|
||||
Some((ScriptPurpose::Certifying(ix, cert.clone()), *h))
|
||||
}
|
||||
Certificate::StakeDelegation(StakeCredential::Scripthash(h), _) => {
|
||||
Some((ScriptPurpose::Certifying(ix, cert.clone()), *h))
|
||||
}
|
||||
_ => None,
|
||||
.filter_map(|(ix, cert)| match cert {
|
||||
Certificate::StakeDeregistration(StakeCredential::Scripthash(h))
|
||||
| Certificate::UnReg(StakeCredential::Scripthash(h), _)
|
||||
| Certificate::VoteDeleg(StakeCredential::Scripthash(h), _)
|
||||
| Certificate::VoteRegDeleg(StakeCredential::Scripthash(h), _, _)
|
||||
| Certificate::StakeVoteDeleg(StakeCredential::Scripthash(h), _, _)
|
||||
| Certificate::StakeRegDeleg(StakeCredential::Scripthash(h), _, _)
|
||||
| Certificate::StakeVoteRegDeleg(StakeCredential::Scripthash(h), _, _, _)
|
||||
| Certificate::RegDRepCert(StakeCredential::Scripthash(h), _, _)
|
||||
| Certificate::UnRegDRepCert(StakeCredential::Scripthash(h), _)
|
||||
| Certificate::UpdateDRepCert(StakeCredential::Scripthash(h), _)
|
||||
| Certificate::AuthCommitteeHot(StakeCredential::Scripthash(h), _)
|
||||
| Certificate::ResignCommitteeCold(StakeCredential::Scripthash(h), _)
|
||||
| Certificate::StakeDelegation(StakeCredential::Scripthash(h), _) => {
|
||||
Some((ScriptPurpose::Certifying(ix, cert.clone()), *h))
|
||||
}
|
||||
|
||||
_ => None,
|
||||
})
|
||||
.collect::<ScriptsNeeded>()
|
||||
})
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
use super::{to_plutus_data::MintValue, Error};
|
||||
use itertools::Itertools;
|
||||
use pallas_addresses::{Address, StakePayload};
|
||||
use pallas_codec::utils::{KeyValuePairs, NonEmptyKeyValuePairs, NonEmptySet, Nullable};
|
||||
use pallas_codec::utils::{
|
||||
KeyValuePairs, NonEmptyKeyValuePairs, NonEmptySet, Nullable, PositiveCoin,
|
||||
};
|
||||
use pallas_crypto::hash::Hash;
|
||||
use pallas_primitives::{
|
||||
alonzo,
|
||||
@@ -310,10 +312,10 @@ pub struct TxInfoV3 {
|
||||
pub data: KeyValuePairs<DatumHash, PlutusData>,
|
||||
pub proposal_procedures: Vec<ProposalProcedure>,
|
||||
pub id: Hash<32>,
|
||||
pub current_treasury_amount: Option<Coin>,
|
||||
pub treasury_donation: Option<PositiveCoin>,
|
||||
// TODO:
|
||||
// votes : KeyValuePairs<Voter, KeyValuePairs<GovernanceActionId, Vote>>
|
||||
// currentTreasuryAmount : Option<Coin>
|
||||
// treasuryDonation : Option<Coin>
|
||||
}
|
||||
|
||||
impl TxInfoV3 {
|
||||
@@ -366,6 +368,10 @@ impl TxInfoV3 {
|
||||
data: KeyValuePairs::from(get_data_info(&tx.transaction_witness_set)),
|
||||
redeemers,
|
||||
proposal_procedures,
|
||||
current_treasury_amount: get_current_treasury_amount_info(
|
||||
&tx.transaction_body.treasury_value,
|
||||
),
|
||||
treasury_donation: get_treasury_donation_info(&tx.transaction_body.donation),
|
||||
id: tx.transaction_body.original_hash(),
|
||||
}))
|
||||
}
|
||||
@@ -594,6 +600,14 @@ pub fn get_fee_info(fee: &Coin) -> Coin {
|
||||
*fee
|
||||
}
|
||||
|
||||
pub fn get_current_treasury_amount_info(amount: &Option<Coin>) -> Option<Coin> {
|
||||
*amount
|
||||
}
|
||||
|
||||
pub fn get_treasury_donation_info(amount: &Option<PositiveCoin>) -> Option<PositiveCoin> {
|
||||
*amount
|
||||
}
|
||||
|
||||
pub fn get_certificates_info(certificates: &Option<NonEmptySet<Certificate>>) -> Vec<Certificate> {
|
||||
certificates.clone().map(|s| s.to_vec()).unwrap_or_default()
|
||||
}
|
||||
@@ -807,20 +821,26 @@ pub fn find_script(
|
||||
.get(redeemer.index as usize)
|
||||
.ok_or(Error::MissingScriptForRedeemer)
|
||||
.and_then(|cert| match cert {
|
||||
Certificate::StakeDeregistration(stake_credential) => match stake_credential {
|
||||
Certificate::StakeDeregistration(stake_credential)
|
||||
| Certificate::UnReg(stake_credential, _)
|
||||
| Certificate::VoteDeleg(stake_credential, _)
|
||||
| Certificate::VoteRegDeleg(stake_credential, _, _)
|
||||
| Certificate::StakeVoteDeleg(stake_credential, _, _)
|
||||
| Certificate::StakeRegDeleg(stake_credential, _, _)
|
||||
| Certificate::StakeVoteRegDeleg(stake_credential, _, _, _)
|
||||
| Certificate::RegDRepCert(stake_credential, _, _)
|
||||
| Certificate::UnRegDRepCert(stake_credential, _)
|
||||
| Certificate::UpdateDRepCert(stake_credential, _)
|
||||
| Certificate::AuthCommitteeHot(stake_credential, _)
|
||||
| Certificate::ResignCommitteeCold(stake_credential, _)
|
||||
| Certificate::StakeDelegation(stake_credential, _) => match stake_credential {
|
||||
StakeCredential::Scripthash(hash) => Ok(hash),
|
||||
_ => Err(Error::NonScriptStakeCredential),
|
||||
},
|
||||
Certificate::StakeDelegation(stake_credential, _) => match stake_credential {
|
||||
StakeCredential::Scripthash(hash) => Ok(hash),
|
||||
_ => Err(Error::NonScriptStakeCredential),
|
||||
},
|
||||
Certificate::PoolRetirement { .. } | Certificate::PoolRegistration { .. } => {
|
||||
Err(Error::UnsupportedCertificateType)
|
||||
}
|
||||
_ => {
|
||||
todo!("remaining certificate types")
|
||||
}
|
||||
Certificate::StakeRegistration { .. }
|
||||
| Certificate::PoolRetirement { .. }
|
||||
| Certificate::Reg { .. }
|
||||
| Certificate::PoolRegistration { .. } => Err(Error::UnsupportedCertificateType),
|
||||
})
|
||||
.and_then(lookup_script),
|
||||
|
||||
@@ -1256,4 +1276,74 @@ mod tests {
|
||||
// from the Haskell ledger / cardano node.
|
||||
insta::assert_debug_snapshot!(script_context.to_plutus_data());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn script_context_certificates() {
|
||||
let redeemer = Redeemer {
|
||||
tag: RedeemerTag::Cert,
|
||||
index: 20,
|
||||
data: Data::constr(0, vec![]),
|
||||
ex_units: ExUnits {
|
||||
mem: 1000000,
|
||||
steps: 100000000,
|
||||
},
|
||||
};
|
||||
|
||||
// NOTE: The transaction also contains treasury donation and current treasury amount
|
||||
let script_context = fixture_tx_info(
|
||||
"84a6008182582000000000000000000000000000000000000000000000000000\
|
||||
00000000000000000180049582008201581c2222222222222222222222222222\
|
||||
222222222222222222222222222282008200581c000000000000000000000000\
|
||||
0000000000000000000000000000000082018200581c00000000000000000000\
|
||||
0000000000000000000000000000000000008a03581c11111111111111111111\
|
||||
1111111111111111111111111111111111115820999999999999999999999999\
|
||||
99999999999999999999999999999999999999991a000f4240190154d81e8201\
|
||||
1864581de0000000000000000000000000000000000000000000000000000000\
|
||||
00d901028080f68304581c111111111111111111111111111111111111111111\
|
||||
1111111111111119053983078200581c00000000000000000000000000000000\
|
||||
0000000000000000000000001a002dc6c083088200581c000000000000000000\
|
||||
000000000000000000000000000000000000001a002dc6c083098200581c0000\
|
||||
00000000000000000000000000000000000000000000000000008200581c0000\
|
||||
000000000000000000000000000000000000000000000000000083098200581c\
|
||||
000000000000000000000000000000000000000000000000000000008201581c\
|
||||
0000000000000000000000000000000000000000000000000000000083098200\
|
||||
581c000000000000000000000000000000000000000000000000000000008102\
|
||||
83098200581c0000000000000000000000000000000000000000000000000000\
|
||||
00008103840a8200581c00000000000000000000000000000000000000000000\
|
||||
000000000000581c111111111111111111111111111111111111111111111111\
|
||||
111111118103840b8200581c0000000000000000000000000000000000000000\
|
||||
0000000000000000581c11111111111111111111111111111111111111111111\
|
||||
1111111111111a002dc6c0840c8200581c000000000000000000000000000000\
|
||||
0000000000000000000000000081031a002dc6c0850d8200581c000000000000\
|
||||
00000000000000000000000000000000000000000000581c1111111111111111\
|
||||
111111111111111111111111111111111111111181031a002dc6c0830e820058\
|
||||
1c00000000000000000000000000000000000000000000000000000000820058\
|
||||
1c22222222222222222222222222222222222222222222222222222222830f82\
|
||||
00581c00000000000000000000000000000000000000000000000000000000f6\
|
||||
84108200581c0000000000000000000000000000000000000000000000000000\
|
||||
00001a002dc6c0f683118200581c000000000000000000000000000000000000\
|
||||
000000000000000000001a002dc6c083128200581c0000000000000000000000\
|
||||
0000000000000000000000000000000000f683028201581c9b24324046544393\
|
||||
443e1fb35c8b72c3c39e18a516a95df5f6654101581c11111111111111111111\
|
||||
11111111111111111111111111111111111102182a151a00989680160ea20581\
|
||||
840214d87980821a000f42401a05f5e1000781587d587b010100323232323232\
|
||||
3225333333008001153330033370e900018029baa00115333007300637540022\
|
||||
4a66600894452615330054911856616c696461746f722072657475726e656420\
|
||||
66616c73650013656002002002002002002153300249010b5f746d70313a2056\
|
||||
6f696400165734ae7155ceaab9e5573eae91f5f6",
|
||||
"8182582000000000000000000000000000000000000000000000000000000000\
|
||||
0000000000",
|
||||
"81a200581d600000000000000000000000000000000000000000000000000000\
|
||||
0000011a000f4240",
|
||||
)
|
||||
.into_script_context(&redeemer, None)
|
||||
.unwrap();
|
||||
|
||||
// NOTE: The initial snapshot has been generated using the Haskell
|
||||
// implementation of the ledger library for that same serialized
|
||||
// transactions. It is meant to control that our construction of the
|
||||
// script context and its serialization matches exactly those
|
||||
// from the Haskell ledger / cardano node.
|
||||
insta::assert_debug_snapshot!(script_context.to_plutus_data());
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,11 +10,13 @@ use num_integer::Integer;
|
||||
use pallas_addresses::{
|
||||
Address, ShelleyDelegationPart, ShelleyPaymentPart, StakeAddress, StakePayload,
|
||||
};
|
||||
use pallas_codec::utils::{AnyUInt, Bytes, Int, KeyValuePairs, NonEmptyKeyValuePairs, Nullable};
|
||||
use pallas_codec::utils::{
|
||||
AnyUInt, Bytes, Int, KeyValuePairs, NonEmptyKeyValuePairs, Nullable, PositiveCoin,
|
||||
};
|
||||
use pallas_crypto::hash::Hash;
|
||||
use pallas_primitives::conway::{
|
||||
AssetName, BigInt, Certificate, Coin, Constitution, Constr, DRepVotingThresholds, DatumOption,
|
||||
ExUnitPrices, ExUnits, GovAction, GovActionId, Mint, PlutusData, PolicyId,
|
||||
AssetName, BigInt, Certificate, Coin, Constitution, Constr, DRep, DRepVotingThresholds,
|
||||
DatumOption, ExUnitPrices, ExUnits, GovAction, GovActionId, Mint, PlutusData, PolicyId,
|
||||
PoolVotingThresholds, ProposalProcedure, ProtocolParamUpdate, PseudoScript, RationalNumber,
|
||||
Redeemer, ScriptRef, StakeCredential, TransactionInput, TransactionOutput, Value,
|
||||
};
|
||||
@@ -47,6 +49,8 @@ struct WithOptionDatum<'a, T>(&'a T);
|
||||
|
||||
struct WithArrayRational<'a, T>(&'a T);
|
||||
|
||||
struct WithPartialCertificates<'a, T>(&'a T);
|
||||
|
||||
pub trait ToPlutusData {
|
||||
fn to_plutus_data(&self) -> PlutusData;
|
||||
}
|
||||
@@ -268,6 +272,12 @@ impl ToPlutusData for usize {
|
||||
}
|
||||
}
|
||||
|
||||
impl ToPlutusData for PositiveCoin {
|
||||
fn to_plutus_data(&self) -> PlutusData {
|
||||
u64::from(self).to_plutus_data()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> ToPlutusData for WithZeroAdaAsset<'a, Value> {
|
||||
fn to_plutus_data(&self) -> PlutusData {
|
||||
match self.0 {
|
||||
@@ -487,15 +497,27 @@ impl ToPlutusData for StakeCredential {
|
||||
}
|
||||
}
|
||||
|
||||
impl ToPlutusData for Certificate {
|
||||
impl<'a> ToPlutusData for WithPartialCertificates<'a, Vec<Certificate>> {
|
||||
fn to_plutus_data(&self) -> PlutusData {
|
||||
match self {
|
||||
self.0
|
||||
.iter()
|
||||
.map(WithPartialCertificates)
|
||||
.collect::<Vec<_>>()
|
||||
.to_plutus_data()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> ToPlutusData for WithPartialCertificates<'a, Certificate> {
|
||||
fn to_plutus_data(&self) -> PlutusData {
|
||||
match self.0 {
|
||||
Certificate::StakeRegistration(stake_credential) => {
|
||||
wrap_with_constr(0, stake_credential.to_plutus_data())
|
||||
}
|
||||
|
||||
Certificate::StakeDeregistration(stake_credential) => {
|
||||
wrap_with_constr(1, stake_credential.to_plutus_data())
|
||||
}
|
||||
|
||||
Certificate::StakeDelegation(stake_credential, pool_keyhash) => {
|
||||
wrap_multiple_with_constr(
|
||||
2,
|
||||
@@ -505,6 +527,7 @@ impl ToPlutusData for Certificate {
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
Certificate::PoolRegistration {
|
||||
operator,
|
||||
vrf_keyhash,
|
||||
@@ -519,22 +542,181 @@ impl ToPlutusData for Certificate {
|
||||
3,
|
||||
vec![operator.to_plutus_data(), vrf_keyhash.to_plutus_data()],
|
||||
),
|
||||
|
||||
Certificate::PoolRetirement(pool_keyhash, epoch) => wrap_multiple_with_constr(
|
||||
4,
|
||||
vec![pool_keyhash.to_plutus_data(), epoch.to_plutus_data()],
|
||||
),
|
||||
_ => todo!("other certificates"), // Reg(StakeCredential, Coin),
|
||||
// UnReg(StakeCredential, Coin),
|
||||
// VoteDeleg(StakeCredential, DRep),
|
||||
// StakeVoteDeleg(StakeCredential, PoolKeyhash, DRep),
|
||||
// StakeRegDeleg(StakeCredential, PoolKeyhash, Coin),
|
||||
// VoteRegDeleg(StakeCredential, DRep, Coin),
|
||||
// StakeVoteRegDeleg(StakeCredential, PoolKeyhash, DRep, Coin),
|
||||
// AuthCommitteeHot(CommitteeColdCredential, CommitteeHotCredential),
|
||||
// ResignCommitteeCold(CommitteeColdCredential, Nullable<Anchor>),
|
||||
// RegDRepCert(DRepCredential, Coin, Nullable<Anchor>),
|
||||
// UnRegDRepCert(DRepCredential, Coin),
|
||||
// UpdateDRepCert(StakeCredential, Nullable<Anchor>),
|
||||
|
||||
certificate => unreachable!("unexpected in V1/V2 script context: {certificate:?}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToPlutusData for Certificate {
|
||||
fn to_plutus_data(&self) -> PlutusData {
|
||||
match self {
|
||||
Certificate::StakeRegistration(stake_credential) => wrap_multiple_with_constr(
|
||||
0,
|
||||
vec![
|
||||
stake_credential.to_plutus_data(),
|
||||
None::<PlutusData>.to_plutus_data(),
|
||||
],
|
||||
),
|
||||
|
||||
Certificate::Reg(stake_credential, deposit) => wrap_multiple_with_constr(
|
||||
0,
|
||||
vec![
|
||||
stake_credential.to_plutus_data(),
|
||||
Some(*deposit).to_plutus_data(),
|
||||
],
|
||||
),
|
||||
|
||||
Certificate::StakeDeregistration(stake_credential) => wrap_multiple_with_constr(
|
||||
1,
|
||||
vec![
|
||||
stake_credential.to_plutus_data(),
|
||||
None::<PlutusData>.to_plutus_data(),
|
||||
],
|
||||
),
|
||||
|
||||
Certificate::UnReg(stake_credential, deposit) => wrap_multiple_with_constr(
|
||||
1,
|
||||
vec![
|
||||
stake_credential.to_plutus_data(),
|
||||
Some(*deposit).to_plutus_data(),
|
||||
],
|
||||
),
|
||||
|
||||
Certificate::StakeDelegation(stake_credential, pool_id) => wrap_multiple_with_constr(
|
||||
2,
|
||||
vec![
|
||||
stake_credential.to_plutus_data(),
|
||||
wrap_with_constr(0, pool_id.to_plutus_data()),
|
||||
],
|
||||
),
|
||||
|
||||
Certificate::VoteDeleg(stake_credential, drep) => wrap_multiple_with_constr(
|
||||
2,
|
||||
vec![
|
||||
stake_credential.to_plutus_data(),
|
||||
wrap_with_constr(1, drep.to_plutus_data()),
|
||||
],
|
||||
),
|
||||
|
||||
Certificate::StakeVoteDeleg(stake_credential, pool_id, drep) => {
|
||||
wrap_multiple_with_constr(
|
||||
2,
|
||||
vec![
|
||||
stake_credential.to_plutus_data(),
|
||||
wrap_multiple_with_constr(
|
||||
2,
|
||||
vec![pool_id.to_plutus_data(), drep.to_plutus_data()],
|
||||
),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
Certificate::StakeRegDeleg(stake_credential, pool_id, deposit) => {
|
||||
wrap_multiple_with_constr(
|
||||
3,
|
||||
vec![
|
||||
stake_credential.to_plutus_data(),
|
||||
wrap_multiple_with_constr(0, vec![pool_id.to_plutus_data()]),
|
||||
deposit.to_plutus_data(),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
Certificate::VoteRegDeleg(stake_credential, drep, deposit) => {
|
||||
wrap_multiple_with_constr(
|
||||
3,
|
||||
vec![
|
||||
stake_credential.to_plutus_data(),
|
||||
wrap_multiple_with_constr(1, vec![drep.to_plutus_data()]),
|
||||
deposit.to_plutus_data(),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
Certificate::StakeVoteRegDeleg(stake_credential, pool_id, drep, deposit) => {
|
||||
wrap_multiple_with_constr(
|
||||
3,
|
||||
vec![
|
||||
stake_credential.to_plutus_data(),
|
||||
wrap_multiple_with_constr(
|
||||
2,
|
||||
vec![pool_id.to_plutus_data(), drep.to_plutus_data()],
|
||||
),
|
||||
deposit.to_plutus_data(),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
Certificate::RegDRepCert(drep_credential, deposit, _anchor) => {
|
||||
wrap_multiple_with_constr(
|
||||
4,
|
||||
vec![drep_credential.to_plutus_data(), deposit.to_plutus_data()],
|
||||
)
|
||||
}
|
||||
|
||||
Certificate::UpdateDRepCert(drep_credential, _anchor) => {
|
||||
wrap_multiple_with_constr(5, vec![drep_credential.to_plutus_data()])
|
||||
}
|
||||
|
||||
Certificate::UnRegDRepCert(drep_credential, deposit) => wrap_multiple_with_constr(
|
||||
6,
|
||||
vec![drep_credential.to_plutus_data(), deposit.to_plutus_data()],
|
||||
),
|
||||
|
||||
Certificate::PoolRegistration {
|
||||
operator,
|
||||
vrf_keyhash,
|
||||
pledge: _,
|
||||
cost: _,
|
||||
margin: _,
|
||||
reward_account: _,
|
||||
pool_owners: _,
|
||||
relays: _,
|
||||
pool_metadata: _,
|
||||
} => wrap_multiple_with_constr(
|
||||
7,
|
||||
vec![operator.to_plutus_data(), vrf_keyhash.to_plutus_data()],
|
||||
),
|
||||
|
||||
Certificate::PoolRetirement(pool_keyhash, epoch) => wrap_multiple_with_constr(
|
||||
8,
|
||||
vec![pool_keyhash.to_plutus_data(), epoch.to_plutus_data()],
|
||||
),
|
||||
|
||||
Certificate::AuthCommitteeHot(cold_credential, hot_credential) => {
|
||||
wrap_multiple_with_constr(
|
||||
9,
|
||||
vec![
|
||||
cold_credential.to_plutus_data(),
|
||||
hot_credential.to_plutus_data(),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
Certificate::ResignCommitteeCold(cold_credential, _anchor) => {
|
||||
wrap_multiple_with_constr(10, vec![cold_credential.to_plutus_data()])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToPlutusData for DRep {
|
||||
fn to_plutus_data(&self) -> PlutusData {
|
||||
match self {
|
||||
DRep::Key(hash) => {
|
||||
wrap_with_constr(0, StakeCredential::AddrKeyhash(*hash).to_plutus_data())
|
||||
}
|
||||
DRep::Script(hash) => {
|
||||
wrap_with_constr(0, StakeCredential::Scripthash(*hash).to_plutus_data())
|
||||
}
|
||||
DRep::Abstain => empty_constr(1),
|
||||
DRep::NoConfidence => empty_constr(2),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1147,7 +1329,7 @@ impl ToPlutusData for TxInfo {
|
||||
WithOptionDatum(&WithZeroAdaAsset(&tx_info.outputs)).to_plutus_data(),
|
||||
WithZeroAdaAsset(&tx_info.fee).to_plutus_data(),
|
||||
WithZeroAdaAsset(&tx_info.mint).to_plutus_data(),
|
||||
tx_info.certificates.to_plutus_data(),
|
||||
WithPartialCertificates(&tx_info.certificates).to_plutus_data(),
|
||||
WithWrappedStakeCredential(&tx_info.withdrawals).to_plutus_data(),
|
||||
tx_info.valid_range.to_plutus_data(),
|
||||
tx_info.signatories.to_plutus_data(),
|
||||
@@ -1164,7 +1346,7 @@ impl ToPlutusData for TxInfo {
|
||||
WithZeroAdaAsset(&tx_info.outputs).to_plutus_data(),
|
||||
WithZeroAdaAsset(&tx_info.fee).to_plutus_data(),
|
||||
WithZeroAdaAsset(&tx_info.mint).to_plutus_data(),
|
||||
tx_info.certificates.to_plutus_data(),
|
||||
WithPartialCertificates(&tx_info.certificates).to_plutus_data(),
|
||||
WithWrappedStakeCredential(&tx_info.withdrawals).to_plutus_data(),
|
||||
tx_info.valid_range.to_plutus_data(),
|
||||
tx_info.signatories.to_plutus_data(),
|
||||
@@ -1190,8 +1372,8 @@ impl ToPlutusData for TxInfo {
|
||||
tx_info.id.to_plutus_data(),
|
||||
Data::map(vec![]), // TODO tx_info.votes :: Map Voter (Map GovernanceActionId Vote)
|
||||
tx_info.proposal_procedures.to_plutus_data(),
|
||||
empty_constr(1), // TODO tx_info.current_treasury_amount :: Haskell.Maybe V2.Lovelace
|
||||
empty_constr(1), // TODO tx_info.treasury_donation :: Haskell.Maybe V2.Lovelace
|
||||
tx_info.current_treasury_amount.to_plutus_data(),
|
||||
tx_info.treasury_donation.to_plutus_data(),
|
||||
],
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user