diff --git a/crates/uplc/src/tx/to_plutus_data.rs b/crates/uplc/src/tx/to_plutus_data.rs index aab608809..d3d7aaae9 100644 --- a/crates/uplc/src/tx/to_plutus_data.rs +++ b/crates/uplc/src/tx/to_plutus_data.rs @@ -872,9 +872,10 @@ impl<'a> ToPlutusData for WithWrappedTransactionId<'a, ScriptPurpose> { ScriptPurpose::Spending(out_ref, ()) => { wrap_with_constr(1, WithWrappedTransactionId(out_ref).to_plutus_data()) } - ScriptPurpose::Rewarding(stake_credential) => { - wrap_with_constr(2, stake_credential.to_plutus_data()) - } + ScriptPurpose::Rewarding(stake_credential) => wrap_with_constr( + 2, + WithWrappedStakeCredential(stake_credential).to_plutus_data(), + ), ScriptPurpose::Certifying(_, dcert) => { wrap_with_constr(3, WithPartialCertificates(dcert).to_plutus_data()) } @@ -1243,6 +1244,12 @@ impl<'a> ToPlutusData for WithWrappedStakeCredential<'a, KeyValuePairs ToPlutusData for WithWrappedStakeCredential<'a, StakeCredential> { + fn to_plutus_data(&self) -> PlutusData { + wrap_with_constr(0, self.0.to_plutus_data()) + } +} + impl ToPlutusData for Voter { fn to_plutus_data(&self) -> PlutusData { match self {