Skip to content

Commit 0466e16

Browse files
committed
feat: brings update to geniusyield-dex-api to consider original datum bytes when providing for witness
1 parent f1c9905 commit 0466e16

File tree

7 files changed

+27
-15
lines changed

7 files changed

+27
-15
lines changed

cabal.project

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ package strict-containers
3535
source-repository-package
3636
type: git
3737
location: https://github.com/geniusyield/atlas
38-
tag: 105ff78b32935ae5c18c53ccf4fb8462b8c1ca03
39-
--sha256: sha256-Ee/UIoJ8OYBxgdnSv61hN8DH7CrIOPn4DjqOBxFL3Js=
38+
tag: 1c20f2a65de8e087b495d1f3ad524d6e659167ad
39+
--sha256: sha256-mvzqgLwKHhIJdeHfUoIdapN0t2K85DoehgSkfm/ddIw=
4040

4141
source-repository-package
4242
type: git

geniusyield-dex-api/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Revision history for geniusyield-dex-api
22

3+
## 0.3.0.0 -- 2024-06-05
4+
5+
* Updates to make use of latest Atlas commit, `1c20f2a65de8e087b495d1f3ad524d6e659167ad`.
6+
* Uses original UTxO's datum to provide for witness to prevent for round-trip issues.
7+
38
## 0.2.1.0 -- 2024-05-07
49

510
* Adds `placePartialOrder''`, `placePartialOrderWithVersion''` to also return for order's NFT token.

geniusyield-dex-api/geniusyield-dex-api.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: geniusyield-dex-api
44
-- PVP summary: +-+------- breaking API changes
55
-- | | +----- non-breaking API additions
66
-- | | | +--- code changes with no API change
7-
version: 0.2.1.0
7+
version: 0.3.0.0
88
synopsis: API code to interact with GeniusYield DEX.
99
description:
1010
API code to interact with GeniusYield DEX. Learn more about GeniusYield by visiting https://www.geniusyield.co/.

geniusyield-dex-api/src/GeniusYield/Api/Dex/PartialOrder.hs

+12-10
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,11 @@ data PartialOrderInfo = PartialOrderInfo
239239
-- | Caching the CS to avoid recalculating for it.
240240
poiNFTCS !GYMintingPolicyId,
241241
-- | Version of the partial order.
242-
poiVersion !POCVersion
242+
poiVersion !POCVersion,
243+
-- | Raw datum.
244+
poiRawDatum !GYDatum
243245
}
244246
deriving stock (Show, Eq, Generic)
245-
deriving anyclass (Swagger.ToSchema)
246247

247248
poiContainedFeeToPlutus POIContainedFee PartialOrderContainedFee
248249
poiContainedFeeToPlutus POIContainedFee {..} =
@@ -405,8 +406,8 @@ partialOrdersHavingAsset pors hasAsset = do
405406
utxosWithDatumsV1_1 utxosAtPaymentCredentialWithDatums pV1_1 hasAsset
406407
policyIdV1 partialOrderNftPolicyId (porV1 pors)
407408
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
410411
m1
411412
iwither
412413
( \oref vod
@@ -465,7 +466,7 @@ getPartialOrderInfo pors orderRef = do
465466
utxoWithDatum utxoAtTxOutRefWithDatum' orderRef
466467
let utxo = fst utxoWithDatum
467468
pocVersion getPartialOrderVersion pors (utxoAddress utxo :!: utxoRef utxo)
468-
vod utxoDatumPure' utxoWithDatum
469+
vod utxoDatumPureWithOriginalDatum' utxoWithDatum
469470
policyId withSomePORef (selectPor pors pocVersion) partialOrderNftPolicyId
470471

471472
runExceptT (makePartialOrderInfo policyId orderRef vod pocVersion) >>= liftEither
@@ -478,9 +479,9 @@ getPartialOrdersInfos
478479
getPartialOrdersInfos pors orderRefs = do
479480
utxosWithDatums utxosAtTxOutRefsWithDatums orderRefs
480481
ps applyToBoth addressToPaymentCredential <$> partialOrderAddrTuple pors
481-
let vod = utxosDatumsPure utxosWithDatums
482+
let vod = utxosDatumsPureWithOriginalDatum utxosWithDatums
482483
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
484485
pocVersion getPartialOrderVersion' ps (addr :!: oref)
485486
policyId withSomePORef (selectPor pors pocVersion) partialOrderNftPolicyId
486487
makePartialOrderInfo policyId oref v pocVersion
@@ -497,10 +498,10 @@ makePartialOrderInfo
497498
GYDexApiQueryMonad m a
498499
GYMintingPolicyId
499500
GYTxOutRef
500-
(GYAddress, GYValue, PartialOrderDatum)
501+
(GYAddress, GYValue, PartialOrderDatum, GYDatum)
501502
POCVersion
502503
ExceptT GYTxMonadException m PartialOrderInfo
503-
makePartialOrderInfo policyId orderRef (utxoAddr, v, PartialOrderDatum {..}) pocVersion = do
504+
makePartialOrderInfo policyId orderRef (utxoAddr, v, PartialOrderDatum {..}, origDatum) pocVersion = do
504505
addr addressFromPlutus' podOwnerAddr
505506

506507
key pubKeyHashFromPlutus' podOwnerKey
@@ -533,7 +534,8 @@ makePartialOrderInfo policyId orderRef (utxoAddr, v, PartialOrderDatum {..}) poc
533534
poiUTxOValue = v,
534535
poiUTxOAddr = utxoAddr,
535536
poiNFTCS = policyId,
536-
poiVersion = pocVersion
537+
poiVersion = pocVersion,
538+
poiRawDatum = origDatum
537539
}
538540

539541
-------------------------------------------------------------------------------

geniusyield-server-lib/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Revision history for geniusyield-server-lib
22

3+
## 0.5.0 -- 2024-06-05
4+
5+
* Makes use of latest `geniusyield-dex-api` version, namely, v0.3.0.0. It includes a fix where original UTxO's datum bytes are used to provide for witness.
6+
37
## 0.4.1 -- 2024-05-28
48

59
* Fix `/v0/orders/fill` endpoint to account for case when percent taker fees is zero.

geniusyield-server-lib/geniusyield-server-lib.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.6
22
name: geniusyield-server-lib
3-
version: 0.4.1
3+
version: 0.5.0
44
synopsis: GeniusYield server library
55
description: Library for GeniusYield server.
66
license: Apache-2.0

geniusyield-server-lib/src/GeniusYield/Server/Config.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ coreConfigFromServerConfig ServerConfig {..} =
9898
GYCoreConfig
9999
{ cfgCoreProvider = scCoreProvider,
100100
cfgNetworkId = scNetworkId,
101-
cfgLogging = scLogging
101+
cfgLogging = scLogging,
102+
cfgLogTiming = Nothing
102103
}
103104

104105
optionalSigningKeyFromServerConfig ServerConfig IO (Maybe (Pair GYSomePaymentSigningKey GYAddress))

0 commit comments

Comments
 (0)