@@ -239,10 +239,11 @@ data PartialOrderInfo = PartialOrderInfo
239
239
-- | Caching the CS to avoid recalculating for it.
240
240
poiNFTCS ∷ ! GYMintingPolicyId ,
241
241
-- | Version of the partial order.
242
- poiVersion ∷ ! POCVersion
242
+ poiVersion ∷ ! POCVersion ,
243
+ -- | Raw datum.
244
+ poiRawDatum ∷ ! GYDatum
243
245
}
244
246
deriving stock (Show , Eq , Generic )
245
- deriving anyclass (Swagger.ToSchema )
246
247
247
248
poiContainedFeeToPlutus ∷ POIContainedFee → PartialOrderContainedFee
248
249
poiContainedFeeToPlutus POIContainedFee {.. } =
@@ -405,8 +406,8 @@ partialOrdersHavingAsset pors hasAsset = do
405
406
utxosWithDatumsV1_1 ← utxosAtPaymentCredentialWithDatums pV1_1 hasAsset
406
407
policyIdV1 ← partialOrderNftPolicyId (porV1 pors)
407
408
policyIdV1_1 ← partialOrderNftPolicyId (porV1_1 pors)
408
- let datumsV1 = utxosDatumsPure utxosWithDatumsV1
409
- datumsV1_1 = utxosDatumsPure utxosWithDatumsV1_1
409
+ let datumsV1 = utxosDatumsPureWithOriginalDatum utxosWithDatumsV1
410
+ datumsV1_1 = utxosDatumsPureWithOriginalDatum utxosWithDatumsV1_1
410
411
m1 ←
411
412
iwither
412
413
( \ oref vod →
@@ -465,7 +466,7 @@ getPartialOrderInfo pors orderRef = do
465
466
utxoWithDatum ← utxoAtTxOutRefWithDatum' orderRef
466
467
let utxo = fst utxoWithDatum
467
468
pocVersion ← getPartialOrderVersion pors (utxoAddress utxo :!: utxoRef utxo)
468
- vod ← utxoDatumPure ' utxoWithDatum
469
+ vod ← utxoDatumPureWithOriginalDatum ' utxoWithDatum
469
470
policyId ← withSomePORef (selectPor pors pocVersion) partialOrderNftPolicyId
470
471
471
472
runExceptT (makePartialOrderInfo policyId orderRef vod pocVersion) >>= liftEither
@@ -478,9 +479,9 @@ getPartialOrdersInfos
478
479
getPartialOrdersInfos pors orderRefs = do
479
480
utxosWithDatums ← utxosAtTxOutRefsWithDatums orderRefs
480
481
ps ← applyToBoth addressToPaymentCredential <$> partialOrderAddrTuple pors
481
- let vod = utxosDatumsPure utxosWithDatums
482
+ let vod = utxosDatumsPureWithOriginalDatum utxosWithDatums
482
483
when (Map. size vod /= length orderRefs) $ throwAppError $ PodNotAllOrderRefsPresent $ Set. fromList orderRefs `Set.difference` Map. keysSet vod
483
- let makePartialOrderInfo' oref v@ (addr, _, _) = do
484
+ let makePartialOrderInfo' oref v@ (addr, _, _, _ ) = do
484
485
pocVersion ← getPartialOrderVersion' ps (addr :!: oref)
485
486
policyId ← withSomePORef (selectPor pors pocVersion) partialOrderNftPolicyId
486
487
makePartialOrderInfo policyId oref v pocVersion
@@ -497,10 +498,10 @@ makePartialOrderInfo
497
498
∷ GYDexApiQueryMonad m a
498
499
⇒ GYMintingPolicyId
499
500
→ GYTxOutRef
500
- → (GYAddress , GYValue , PartialOrderDatum )
501
+ → (GYAddress , GYValue , PartialOrderDatum , GYDatum )
501
502
→ POCVersion
502
503
→ ExceptT GYTxMonadException m PartialOrderInfo
503
- makePartialOrderInfo policyId orderRef (utxoAddr, v, PartialOrderDatum {.. }) pocVersion = do
504
+ makePartialOrderInfo policyId orderRef (utxoAddr, v, PartialOrderDatum {.. }, origDatum ) pocVersion = do
504
505
addr ← addressFromPlutus' podOwnerAddr
505
506
506
507
key ← pubKeyHashFromPlutus' podOwnerKey
@@ -533,7 +534,8 @@ makePartialOrderInfo policyId orderRef (utxoAddr, v, PartialOrderDatum {..}) poc
533
534
poiUTxOValue = v,
534
535
poiUTxOAddr = utxoAddr,
535
536
poiNFTCS = policyId,
536
- poiVersion = pocVersion
537
+ poiVersion = pocVersion,
538
+ poiRawDatum = origDatum
537
539
}
538
540
539
541
-------------------------------------------------------------------------------
0 commit comments