Fix collecting withdrawal scripts in eval_phase_one
The current implementation assumed that ALL withdrawals present in a transaction had to be locked by a script and failed otherwise. But a transaction can actually be composed of both. So instead of failing, we should rather just ignore withdrawals that can't be referenced by redeemers.
This commit is contained in:
parent
251aa756d9
commit
34596b3084
|
@ -283,15 +283,13 @@ fn build_redeemer_ptr(
|
|||
for (idx, x) in reward_accounts.iter().enumerate() {
|
||||
let cred = match Address::from_bytes(x).unwrap() {
|
||||
Address::Stake(a) => match a.payload() {
|
||||
StakePayload::Script(sh) => StakeCredential::Scripthash(*sh),
|
||||
StakePayload::Stake(_) => {
|
||||
return Err(Error::ScriptKeyHash);
|
||||
}
|
||||
StakePayload::Script(sh) => Some(StakeCredential::Scripthash(*sh)),
|
||||
StakePayload::Stake(_) => None,
|
||||
},
|
||||
_ => return Err(Error::BadWithdrawalAddress),
|
||||
};
|
||||
|
||||
if cred == *racnt {
|
||||
if cred == Some(racnt.to_owned()) {
|
||||
maybe_idx = Some(idx);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue