From ccf56f58d1f367af79f081eeb2d842fe67b4f41a Mon Sep 17 00:00:00 2001 From: fanghr Date: Fri, 20 May 2022 17:09:22 +0800 Subject: [PATCH] add min ada to both stake input and output --- agora-sample/Sample/Proposal.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/agora-sample/Sample/Proposal.hs b/agora-sample/Sample/Proposal.hs index 8e00803..de52379 100644 --- a/agora-sample/Sample/Proposal.hs +++ b/agora-sample/Sample/Proposal.hs @@ -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. } ---