Skip to content

Commit

Permalink
Use identifier names that are consistent with types.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Jul 6, 2020
1 parent 61b23f0 commit 9af7eac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
10 changes: 6 additions & 4 deletions lib/core/src/Cardano/Pool/DB/MVar.hs
Expand Up @@ -81,14 +81,16 @@ newDBLayer = do
, readPoolProductionCursor =
readPoolDB db . mReadCursor

, putPoolRegistration = \a0 a1 ->
void $ alterPoolDB (const Nothing) db $ mPutPoolRegistration a0 a1
, putPoolRegistration = \cpt cert -> void
$ alterPoolDB (const Nothing) db
$ mPutPoolRegistration cpt cert

, readPoolRegistration =
readPoolDB db . mReadPoolRegistration

, putPoolRetirement = \slot cert ->
void $ alterPoolDB (const Nothing) db $ mPutPoolRetirement slot cert
, putPoolRetirement = \cpt cert -> void
$ alterPoolDB (const Nothing) db
$ mPutPoolRetirement cpt cert

, readPoolRetirement =
readPoolDB db . mReadPoolRetirement
Expand Down
17 changes: 9 additions & 8 deletions lib/core/src/Cardano/Pool/DB/Model.hs
Expand Up @@ -196,15 +196,16 @@ mPutPoolRegistration
:: CertificatePublicationTime
-> PoolRegistrationCertificate
-> ModelPoolOp ()
mPutPoolRegistration sp registration db =
mPutPoolRegistration cpt cert db =
( Right ()
, db { owners = Map.insert poolId poolOwners owners
, registrations = Map.insert (sp, poolId) registration registrations
}
, db
{ owners = Map.insert poolId poolOwners owners
, registrations = Map.insert (cpt, poolId) cert registrations
}
)
where
PoolDatabase {owners, registrations} = db
PoolRegistrationCertificate {poolId, poolOwners} = registration
PoolRegistrationCertificate {poolId, poolOwners} = cert

mReadPoolRegistration
:: PoolId
Expand All @@ -225,13 +226,13 @@ mPutPoolRetirement
:: CertificatePublicationTime
-> PoolRetirementCertificate
-> ModelPoolOp ()
mPutPoolRetirement sp retirement db =
mPutPoolRetirement cpt cert db =
( Right ()
, db { retirements = Map.insert (sp, poolId) retirement retirements }
, db {retirements = Map.insert (cpt, poolId) cert retirements}
)
where
PoolDatabase {retirements} = db
PoolRetirementCertificate poolId _retiredIn = retirement
PoolRetirementCertificate poolId _retiredIn = cert

mReadPoolRetirement
:: PoolId
Expand Down
4 changes: 2 additions & 2 deletions lib/shelley/src/Cardano/Wallet/Shelley/Pools.hs
Expand Up @@ -500,8 +500,8 @@ instance ToText StakePoolLog where
]
MsgRollingBackTo point ->
"Rolling back to " <> pretty point
MsgStakePoolRegistration pool ->
"Discovered stake pool registration: " <> pretty pool
MsgStakePoolRegistration cert ->
"Discovered stake pool registration: " <> pretty cert
MsgStakePoolRetirement cert ->
"Discovered stake pool retirement: " <> pretty cert
MsgErrProduction (ErrPointAlreadyExists blk) -> mconcat
Expand Down

0 comments on commit 9af7eac

Please sign in to comment.