Skip to content

Commit 20b6fe1

Browse files
committed
fix: fixed validate_output_amount funtion, where the ada amount was compare against the input and not the expected output, so if there was an ada voucher or transfer stuff wouldn't add up
1 parent 4d05a0a commit 20b6fe1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cardano/onchain/validators/spending_transfer_module.ak

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@ fn validate_output_amount(
117117
locked_input.output.value
118118
|> assets.merge(additional_value)
119119
trace @"expected_output": expected_output
120+
121+
let expected_lovelace_output = assets.lovelace_of(expected_output)
122+
trace @"expected_lovelace_output": expected_lovelace_output
120123
and {
121-
(lovelace_output - lovelace_input >= 0)?,
124+
(lovelace_output - expected_lovelace_output >= 0)?,
122125
(assets.without_lovelace(output.value) == assets.without_lovelace(
123126
expected_output,
124127
))?,

0 commit comments

Comments
 (0)