Skip to content

Commit

Permalink
Add root for Hydra.Model.Payment.IsTx and remove unused Payment insta…
Browse files Browse the repository at this point in the history
…nces
  • Loading branch information
locallycompact committed Dec 31, 2024
1 parent a889e65 commit 05e7721
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 0 additions & 8 deletions hydra-node/test/Hydra/Model/Payment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import Hydra.Tx.IsTx (IsTx (..))
import Test.Hydra.Tx.Fixture (testNetworkId)
import Test.Hydra.Tx.Gen (genKeyPair)
import Test.QuickCheck (choose)
import Test.QuickCheck.StateModel (HasVariables)
import Test.QuickCheck.StateModel.Variables (HasVariables (..))
import Prelude qualified

-- NOTE: New type wrapper to add Ord and Eq instances to signing keys
Expand Down Expand Up @@ -72,18 +70,12 @@ instance Show Payment where
<> show value
<> " }"

instance Arbitrary Payment where
arbitrary = error "don't use"

instance ToCBOR Payment where
toCBOR = error "don't use"

instance FromCBOR Payment where
fromCBOR = error "don't use"

instance HasVariables Payment where
getAllVariables _ = mempty

-- | Making `Payment` an instance of `IsTx` allows us to use it with `HeadLogic'`s messages.
instance IsTx Payment where
type TxIdType Payment = Int
Expand Down
2 changes: 2 additions & 0 deletions weeder.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ root-instances = [
, { module = "Hydra.Contract.MintAction", instance = "FromData MintAction" }
# This one is odd.
, { module = "Hydra.Network.Ouroboros.Type", instance = "Protocol" }
# TODO: Remove this
, { module = "Hydra.Model.Payment", instance = "IsTx" }
# These are used for debugging.
, { module = "Hydra.Chain.Direct.TxTraceSpec", instance = "HasVariables" }
, { module = "Hydra.Chain.Direct.TxTraceSpec", instance = "MonadFail AppM" }
Expand Down

0 comments on commit 05e7721

Please sign in to comment.