Skip to content

Commit

Permalink
Remove unused Semigroup instance for AddressPool
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Stachyra committed Mar 25, 2019
1 parent 063d9b4 commit 038d6c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
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

0 comments on commit 038d6c5

Please sign in to comment.