Skip to content

Commit

Permalink
Bump to latest Atlas commit to use upstreamed types/utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabhxyz committed Jan 11, 2024
1 parent 92f3195 commit 94ffee0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 32 deletions.
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/geniusyield/atlas
tag: 80ce2b5ecab27388c1093cf9f5d4f48fa30fd9bf
--sha256: sha256-WM/G0dlSuRD7oZZxwir4InpD+hxoLHhwHeEW0tKS12M=
tag: b64a026631be19c9cc8448c7a0670b0ad24b9b51
--sha256: sha256-CdXih/AGDelOqrvNPzJXMrH/EYL1T9cZjNVoQqoQmDI=

source-repository-package
type: git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ data MakerBotConfig = MakerBotConfig
mbcPriceConfig !PriceConfig
}
deriving stock (Show, Generic)
deriving (FromJSON, ToJSON) via CustomJSON '[FieldLabelModifier '[CamelToSnake]] MakerBotConfig
deriving (FromJSON) via CustomJSON '[FieldLabelModifier '[CamelToSnake]] MakerBotConfig

instance FromEnv MakerBotConfig where
fromEnv _ =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

module GeniusYield.MarketMaker.Orphans where

import Deriving.Aeson
import GeniusYield.Api.Dex.PartialOrder (PORefs (..))
import GeniusYield.GYConfig (Confidential (..))
import Deriving.Aeson
import GeniusYield.Api.Dex.PartialOrder (PORefs (..))

deriving stock instance Generic PORefs

deriving via CustomJSON '[FieldLabelModifier '[CamelToSnake]] PORefs instance (FromJSON PORefs)

deriving via CustomJSON '[FieldLabelModifier '[CamelToSnake]] PORefs instance (ToJSON PORefs)

deriving newtype instance ToJSON a ToJSON (Confidential a)
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ data PriceConfig = PriceConfig
pcOverride !(Maybe MaestroPairOverride)
}
deriving stock (Show, Generic)
deriving (FromJSON, ToJSON) via CustomJSON '[FieldLabelModifier '[CamelToSnake]] PriceConfig
deriving (FromJSON) via CustomJSON '[FieldLabelModifier '[CamelToSnake]] PriceConfig

data MaestroPP = MaestroPP
{ mppEnv !(MaestroEnv 'V1),
Expand Down
21 changes: 0 additions & 21 deletions geniusyield-market-maker/src/GeniusYield/MarketMaker/User.hs
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
module GeniusYield.MarketMaker.User where

import Data.Aeson (withText)
import Deriving.Aeson
import GeniusYield.Imports
import GeniusYield.Types

-- TODO: Move to Atlas.
newtype GYStakeAddressBech32 = GYStakeAddressBech32 GYStakeAddress
deriving newtype (Show, Eq, Ord)

stakeAddressToBech32 :: GYStakeAddress -> GYStakeAddressBech32
stakeAddressToBech32 = coerce

stakeAddressFromBech32 :: GYStakeAddressBech32 -> GYStakeAddress
stakeAddressFromBech32 = coerce

instance ToJSON GYStakeAddressBech32 where
toJSON (GYStakeAddressBech32 addr) = toJSON $ stakeAddressToText addr

instance FromJSON GYStakeAddressBech32 where
parseJSON = withText "GYStakeAddressBech32" $ \t ->
case stakeAddressFromTextMaybe t of
Just addr -> pure $ GYStakeAddressBech32 addr
Nothing -> fail "cannot deserialise stake address"

data UserRaw = UserRaw
{ urSKeyPath :: !FilePath,
urColl :: !(Maybe GYTxOutRef),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ module GeniusYield.MarketMaker.Utils where
import qualified Data.Text as Text
import GeniusYield.Api.Dex.PartialOrder (PORefs)
import GeniusYield.Imports (coerce, first)
import GeniusYield.MarketMaker.User (User (..),
stakeAddressFromBech32)
import GeniusYield.MarketMaker.User (User (..))
import GeniusYield.Providers.Common (SomeDeserializeError (DeserializeErrorAssetClass))
import GeniusYield.Scripts (HasPartialOrderConfigAddr (..),
HasPartialOrderNftScript (..),
Expand Down

0 comments on commit 94ffee0

Please sign in to comment.