add min ada to both stake input and output

This commit is contained in:
fanghr 2022-05-20 17:09:22 +08:00
parent db92986c6d
commit ccf56f58d1
No known key found for this signature in database
GPG key ID: 35CD9A71CD5D5870

View file

@ -331,7 +331,12 @@ voteOnProposal params =
stakeInput =
TxOut
{ txOutAddress = stakeAddress
, txOutValue = sst <> Value.assetClassValue (untag stake.gtClassRef) params.voteCount
, txOutValue =
mconcat
[ sst
, Value.assetClassValue (untag stake.gtClassRef) params.voteCount
, minAda
]
, txOutDatumHash = Just $ toDatumHash stakeInputDatum
}
@ -374,10 +379,6 @@ voteOnProposal params =
stakeOutput =
stakeInput
{ txOutDatumHash = Just $ toDatumHash stakeOutputDatum
-- We won't include the minimum Ada in the output value
-- due to how we check the output value in the stake validator.
-- The implementation is correct though, it should work in a
-- real on-chain environment.
}
---