Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
[CDEC-484] Reunite orphans from Pos.Chain.Ssc.Error.Verify
Browse files Browse the repository at this point in the history
  • Loading branch information
intricate committed Aug 7, 2018
1 parent 46104c0 commit a6036e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 2 additions & 6 deletions chain/src/Pos/Chain/Ssc/Error/Verify.hs
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}

-- | Possible failures during SSC verification.

module Pos.Chain.Ssc.Error.Verify
( SscVerifyError (..)
, sscIsCriticalVerifyError
) where

import Universum

import Formatting (bprint, build, ords, stext, (%))
import qualified Formatting.Buildable
import Serokell.Util (listJson)
import Universum

import Pos.Core (EpochIndex, SlotId, StakeholderId)
import Pos.Core.Ssc (VssCertificate)

instance Buildable (StakeholderId, VssCertificate) where
build (a, b) = bprint ("(id: "%build%" , cert: "%build%")") a b

type NEStIds = NonEmpty StakeholderId

-- | Type for verification error
Expand Down
5 changes: 4 additions & 1 deletion core/src/Pos/Core/Ssc/VssCertificate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import Data.Hashable (Hashable (..))
import Data.SafeCopy (base, deriveSafeCopySimple)
import Formatting (bprint, build, int, (%))
import qualified Formatting.Buildable as Buildable
import Pos.Core.Common (StakeholderId, addressHash)
import Text.JSON.Canonical (FromJSON (..), Int54, JSValue (..),
ReportSchemaErrors, ToJSON (..), fromJSField, mkObject)

import Pos.Binary.Class (AsBinary, Bi (..), encodeListLen,
enforceSize)
import Pos.Core.Common (StakeholderId, addressHash)
import Pos.Core.Genesis.Canonical ()
import Pos.Core.Slotting (EpochIndex)
import Pos.Crypto (ProtocolMagic, PublicKey, SecretKey,
Expand Down Expand Up @@ -75,6 +75,9 @@ instance Buildable VssCertificate where
build UnsafeVssCertificate {..} = bprint
("vssCert:"%build%":"%int) vcSigningKey vcExpiryEpoch

instance Buildable (StakeholderId, VssCertificate) where
build (a, b) = bprint ("(id: "%build%" , cert: "%build%")") a b

instance Hashable VssCertificate where
hashWithSalt s UnsafeVssCertificate{..} =
hashWithSalt s (vcExpiryEpoch, vcVssKey, vcSigningKey, vcSignature)
Expand Down

0 comments on commit a6036e0

Please sign in to comment.