Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused Semigroup instance for AddressPool #120

Merged
merged 1 commit into from
Mar 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/Cardano/Wallet/Primitive/AddressDiscovery.hs
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ data AddressPool = AddressPool

instance NFData AddressPool

instance Semigroup AddressPool where
(AddressPool !pubKey !g !change !a1) <> (AddressPool _ _ _ !a2) =
AddressPool pubKey g change (a1 <> a2)

-- | Get all addresses in the pool, sorted from the first address discovered,
-- up until the next one.
--
Expand Down Expand Up @@ -232,7 +228,7 @@ nextAddresses !key (AddressPoolGap !g) !cc !fromIx =

newtype SeqState = SeqState (AddressPool, AddressPool)
deriving stock (Generic, Show)
deriving newtype (NFData, Semigroup)
deriving newtype (NFData)

-- NOTE
-- We have to scan both the internal and external chain. Note that, the
Expand Down
4 changes: 2 additions & 2 deletions src/Cardano/Wallet/Primitive/Model.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ import qualified Data.Text as T
-- - TODO: Known & used addresses
data Wallet s where
Wallet
:: (IsOurs s, Semigroup s, NFData s, Show s)
:: (IsOurs s, NFData s, Show s)
=> UTxO
-> Set Tx
-> SlotId
Expand All @@ -138,7 +138,7 @@ instance NFData (Wallet s) where

-- | Create an empty wallet from an initial state
initWallet
:: (IsOurs s, Semigroup s, NFData s, Show s)
:: (IsOurs s, NFData s, Show s)
=> s
-> Wallet s
initWallet = Wallet mempty mempty (SlotId 0 0)
Expand Down