Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Sep 24, 2020
1 parent 405c745 commit b4b2a12
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
9 changes: 4 additions & 5 deletions lib/cli/test/unit/Cardano/CLISpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import Cardano.Wallet.Api.Client
import Cardano.Wallet.Api.Types
( ApiT (..), ApiTxMetadata (..) )
import Cardano.Wallet.Primitive.Types
( TxMetadata (..), TxMetadataValue (..) )
( PoolMetadataSource, TxMetadata (..), TxMetadataValue (..) )
import Control.Concurrent
( forkFinally )
import Control.Concurrent.MVar
Expand All @@ -54,8 +54,6 @@ import Data.Text
( Text )
import Data.Text.Class
( FromText (..), TextDecodingError (..), toText )
import Network.URI
( parseURI )
import Options.Applicative
( ParserInfo
, ParserPrefs
Expand Down Expand Up @@ -652,8 +650,9 @@ spec = do

describe "SMASH URL option" $ do
let parse arg = execParserPure defaultPrefs
(info smashURLOption mempty) ["--smash-url", arg]
let ok arg (Success url) = Just url == parseURI arg
(info smashURLOption mempty) ["--pool-metadata-fetching", arg]
let ok arg (Success url) = Right url == fromText @PoolMetadataSource
(T.pack arg)
ok _ _ = False
let err _ (Failure _) = True
err _ _ = False
Expand Down
2 changes: 1 addition & 1 deletion lib/core/test/unit/Cardano/Wallet/Api/Malformed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ instance Malformed (BodyParam SettingsPutData) where
"pool_metadata_source": "not_a_uri"
}
}|]
, "Error in $['pool_metadata_source]: Not a valid sync setting value"
, "Error in $.settings['pool_metadata_source']: Could not parse URI: not_a_uri"
)
]

Expand Down
3 changes: 3 additions & 0 deletions lib/core/test/unit/Cardano/Wallet/Api/TypesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,9 @@ instance ToSchema WalletPutData where
instance ToSchema SettingsPutData where
declareNamedSchema _ = declareSchemaForDefinition "ApiSettingsPutData"

instance ToSchema (ApiT Settings) where
declareNamedSchema _ = declareSchemaForDefinition "ApiGetSettings"

instance ToSchema WalletPutPassphraseData where
declareNamedSchema _ =
declareSchemaForDefinition "ApiWalletPutPassphraseData"
Expand Down
12 changes: 10 additions & 2 deletions lib/jormungandr/src/Cardano/Wallet/Jormungandr/Api/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import Cardano.Wallet.Api
, Network
, Proxy_
, ShelleyMigrations
, Settings
, StakePools
, Transactions
, Wallets
Expand Down Expand Up @@ -88,7 +89,10 @@ import Cardano.Wallet.Api.Server
, withLegacyLayer'
)
import Cardano.Wallet.Api.Types
( ApiErrorCode (..), ApiT (..), SomeByronWalletPostData (..) )
( ApiErrorCode (..)
, ApiT (..)
, SomeByronWalletPostData (..)
)
import Cardano.Wallet.Primitive.AddressDerivation
( DelegationAddress (..), NetworkDiscriminant (..), PaymentAddress )
import Cardano.Wallet.Primitive.AddressDerivation.Byron
Expand Down Expand Up @@ -118,7 +122,7 @@ import Fmt
import Network.Ntp
( NtpClient )
import Servant
( (:<|>) (..), Handler, Server, err501, err503, throwError )
( (:<|>) (..), Handler (..), Server, err501, err503, throwError )
import Type.Reflection
( Typeable )

Expand Down Expand Up @@ -153,6 +157,7 @@ server byron icarus jormungandr spl ntp =
:<|> byronMigrations
:<|> network
:<|> proxy
:<|> settingS
where
wallets :: Server Wallets
wallets = deleteWallet jormungandr
Expand Down Expand Up @@ -285,6 +290,9 @@ server byron icarus jormungandr spl ntp =
proxy :: Server Proxy_
proxy = postExternalTransaction jormungandr

settingS :: Server Settings
settingS = (\_ -> throwError err501) :<|> throwError err501


--------------------------------------------------------------------------------
-- List stake pools API handler
Expand Down

0 comments on commit b4b2a12

Please sign in to comment.