Skip to content

Commit

Permalink
Add stake address constraints to Jormungandr and Byron
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Jul 10, 2020
1 parent 002e52f commit c947ed4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/byron/src/Cardano/Wallet/Byron.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import Cardano.Wallet.Api
import Cardano.Wallet.Api.Server
( HostPreference, Listen (..), ListenError (..), TlsConfiguration )
import Cardano.Wallet.Api.Types
( ApiStakePool, DecodeAddress, EncodeAddress )
( ApiStakePool, DecodeAddress, EncodeAddress, EncodeStakeAddress )
import Cardano.Wallet.Byron.Api.Server
( server )
import Cardano.Wallet.Byron.Compatibility
Expand Down Expand Up @@ -157,6 +157,7 @@ data SomeNetworkDiscriminant where
, PaymentAddress n ByronKey
, DecodeAddress n
, EncodeAddress n
, EncodeStakeAddress n
, MaxSizeOf Address n IcarusKey
, MaxSizeOf Address n ByronKey
)
Expand Down Expand Up @@ -242,6 +243,7 @@ serveWallet
, PaymentAddress n ByronKey
, DecodeAddress n
, EncodeAddress n
, EncodeStakeAddress n
)
=> Proxy n
-> Socket
Expand Down
4 changes: 2 additions & 2 deletions lib/byron/src/Cardano/Wallet/Byron/Compatibility.hs
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,11 @@ fromProtocolMagicId = W.ProtocolMagic . fromIntegral . unProtocolMagicId
Address Encoding / Decoding
-------------------------------------------------------------------------------}

instance EncodeStakeAddress n where
instance {-# OVERLAPS #-} EncodeStakeAddress n where
encodeStakeAddress = error
"encodeStakeAddress: there's no such thing as stake address in Byron"

instance DecodeStakeAddress n where
instance {-# OVERLAPS #-} DecodeStakeAddress n where
decodeStakeAddress = error
"decodeStakeAddress: there's no such thing as stake address in Byron"

Expand Down
3 changes: 3 additions & 0 deletions lib/byron/src/Cardano/Wallet/Byron/Launch.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
Expand Down Expand Up @@ -37,6 +38,8 @@ import Cardano.Crypto.ProtocolMagic
( ProtocolMagicId (..) )
import Cardano.Launcher
( Command (..), StdStream (..), withBackendProcess )
import Cardano.Wallet.Api.Types
( EncodeStakeAddress (..) )
import Cardano.Wallet.Byron
( SomeNetworkDiscriminant (..) )
import Cardano.Wallet.Byron.Compatibility
Expand Down
2 changes: 1 addition & 1 deletion lib/core/test/bench/db/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ benchReadTxHistory sortOrder (inf, sup) mstatus DBLayer{..} =
mkTxHistory :: Int -> Int -> Int -> [Word64] -> [(Tx, TxMeta)]
mkTxHistory numTx numInputs numOutputs range =
[ force
( (Tx (mkTxId inps outs) inps outs)
( (Tx (mkTxId inps outs mempty) inps outs mempty)
, TxMeta
{ status = [InLedger, Pending] !! (i `mod` 2)
, direction = Incoming
Expand Down
3 changes: 2 additions & 1 deletion lib/jormungandr/src/Cardano/Wallet/Jormungandr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import Cardano.Wallet.Api
import Cardano.Wallet.Api.Server
( HostPreference, Listen (..), ListenError (..) )
import Cardano.Wallet.Api.Types
( DecodeAddress, EncodeAddress )
( DecodeAddress, EncodeAddress, EncodeStakeAddress )
import Cardano.Wallet.DB.Sqlite
( DefaultFieldValues (..), PersistState )
import Cardano.Wallet.Jormungandr.Api.Server
Expand Down Expand Up @@ -196,6 +196,7 @@ serveWallet
( t ~ Jormungandr
, NetworkDiscriminantVal n
, DecodeAddress n
, EncodeStakeAddress n
, EncodeAddress n
, DelegationAddress n JormungandrKey
)
Expand Down

0 comments on commit c947ed4

Please sign in to comment.