take collaterals into account

This commit is contained in:
Seungheon Oh 2022-04-25 08:46:58 -04:00
parent 75f5e83bcf
commit 35b862153c
3 changed files with 32 additions and 8 deletions

View file

@ -9,6 +9,7 @@ module Spec.Sample.Effect.TreasuryWithdrawal (
inputTreasury,
inputUser,
inputGAT,
inputCollateral,
outputTreasury,
outputUser,
buildReceiversOutputFromDatum,
@ -106,6 +107,16 @@ inputUser indx val =
, txOutDatumHash = Just (DatumHash "")
}
inputCollateral :: Int -> TxInInfo
inputCollateral indx =
TxInInfo -- Initiator
(TxOutRef "" 1)
TxOut
{ txOutAddress = Address (users !! indx) Nothing
, txOutValue = Value.singleton "" "" 2000000
, txOutDatumHash = Just (DatumHash "")
}
outputTreasury :: Int -> Value -> TxOut
outputTreasury indx val =
TxOut