-
Notifications
You must be signed in to change notification settings - Fork 629
[CDEC-505] Move Pos.Core.Genesis to Pos.Chain.Genesis #3593
Conversation
94cde4b
to
130880f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'll let @parsonsmatt give the official approval, since he's doing a more in-depth review.
-- StaticConfig | ||
-------------------------------------------------------------------------------- | ||
|
||
data StaticConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this new name. GenesisConfiguration
was fairly misleading because plenty of stuff in there isn't Genesis related per se. We still have that issue with GenesisSpec
, I suppose. But this seems like progress.
@@ -1,6 +1,6 @@ | |||
{-# LANGUAGE Rank2Types #-} | |||
|
|||
module Pos.Core.Configuration.GenesisHash | |||
module Pos.Chain.Genesis.Hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
deriving instance Hashable Address => Semigroup GenesisNonAvvmBalances | ||
deriving instance Hashable Address => Monoid GenesisNonAvvmBalances | ||
deriving instance Semigroup GenesisNonAvvmBalances | ||
deriving instance Monoid GenesisNonAvvmBalances |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
hasKnownFeePolicy BlockVersionData {bvdTxFeePolicy = TxFeePolicyTxSizeLinear {}} = | ||
True | ||
hasKnownFeePolicy _ = False | ||
arbitraryVssCerts = mkVssCertificatesMapLossy <$> arbitrary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from here
hexToBS :: Text -> ByteString | ||
hexToBS ts = case B16.decode ts of | ||
Left err -> error $ "decode failed: " <> show err | ||
Right bs -> bs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
As a side note, I like *.Example
module naming idiom much better than my *.ExampleHelpers
. Even if the module contains helpers.
130880f
to
3530b64
Compare
|
||
instance Monad m => ToJSON m GenesisNonAvvmBalances where | ||
toJSON = toJSON . getGenesisNonAvvmBalances | ||
|
||
instance ReportSchemaErrors m => FromJSON m GenesisNonAvvmBalances where | ||
instance | ||
(Monad m, Applicative m, MonadError SchemaError m) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Monad and Applicatve are redundant here as MonadError implies them
@@ -42,7 +43,10 @@ instance Monad m => ToJSON m GenesisProtocolConstants where | |||
, ("vssMinTTL", toJSON gpcVssMinTTL) | |||
] | |||
|
|||
instance ReportSchemaErrors m => FromJSON m GenesisProtocolConstants where | |||
instance | |||
(Monad m, MonadError SchemaError m) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Monad is redudant here
@@ -39,7 +39,10 @@ instance Buildable GenesisWStakeholders where | |||
instance Monad m => ToJSON m GenesisWStakeholders where | |||
toJSON (GenesisWStakeholders stks) = toJSON stks | |||
|
|||
instance ReportSchemaErrors m => FromJSON m GenesisWStakeholders where | |||
instance | |||
(Monad m, MonadError SchemaError m) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant monad
3530b64
to
c3c5955
Compare
c3c5955
to
0ba276e
Compare
[CDEC-505] Move Pos.Core.Genesis to Pos.Chain.Genesis
…hk/ruhatch/CDEC-505 [CDEC-505] Move Pos.Core.Genesis to Pos.Chain.Genesis
Description
This moves the
Pos.Core.Genesis
module group into thechain
package. This is also involves movingCore.Config
type toGenesis.Config
, so touches all the site where thatConfig
was propagated. This is laying the foundation for aChain.Config
type that will combineGenesis.Config
,Txp.Config
, etc.Linked issue
CDEC-505
Type of change
Developer checklist
Testing checklist
QA Steps
Screenshots (if available)