diff --git a/daml/Marketplace/Issuance/AssetDescription.daml b/daml/Marketplace/Issuance/AssetDescription.daml index b990ddc2..bd73e500 100644 --- a/daml/Marketplace/Issuance/AssetDescription.daml +++ b/daml/Marketplace/Issuance/AssetDescription.daml @@ -64,12 +64,15 @@ template AssetDescription do return $ snd <$> payoffs (C.deserialize claims) - nonconsuming choice Multipliers : [Observation Date Decimal] + nonconsuming choice Multipliers : [Decimal] with party : Party controller party do - return $ fst <$> payoffs (C.deserialize claims) + let getConst : (Observation Date Decimal, b) -> [Decimal] + getConst (Const x, _) = [x] + getConst _ = [] + return $ concatMap getConst $ payoffs (C.deserialize claims) -- Used to do a reverse lookup of the version # given the claims (passed-in from the API) template Index diff --git a/daml/Tests/Clearing/Setup.daml b/daml/Tests/Clearing/Setup.daml index e8e2c173..738ae6ea 100644 --- a/daml/Tests/Clearing/Setup.daml +++ b/daml/Tests/Clearing/Setup.daml @@ -3,7 +3,6 @@ module Tests.Clearing.Setup where import Daml.Script import Common import ContingentClaims.Claim (Claim(Zero)) -import ContingentClaims.Observation (Observation(Const)) import DA.Assert ((===)) import DA.Finance.Types import DA.Date (date, Month(..)) @@ -75,9 +74,9 @@ clearedTradingTest = do (_,h2oQ322DerId) <- mkSimpleH2OFuture "H2OQ322" "H2O Q3 22" $ date 2022 Jul 1 (_,h2oQ422DerId) <- mkSimpleH2OFuture "H2OQ422" "H2O Q4 22" $ date 2022 Oct 1 - (Some expiry) <- submit issuer.customer $ exerciseCmd q122Cid AssetDescription.Expiry with party = issuer.customer - (underlying::_) <- submit issuer.customer $ exerciseCmd q122Cid AssetDescription.Underlying with party = issuer.customer - ((Const mult)::_) <- submit issuer.customer $ exerciseCmd q122Cid AssetDescription.Multipliers with party = issuer.customer + (Some expiry) <- submit issuer.customer $ exerciseCmd q122Cid AssetDescription.Expiry with party = issuer.customer + (underlying::_) <- submit issuer.customer $ exerciseCmd q122Cid AssetDescription.Underlying with party = issuer.customer + (mult::_) <- submit issuer.customer $ exerciseCmd q122Cid AssetDescription.Multipliers with party = issuer.customer expiry === (date 2022 Jan 1) underlying === h2oId