Skip to content

Commit

Permalink
Fix broken master
Browse files Browse the repository at this point in the history
PR #797 was recently merged, which no longer compiled after merging with
master because of PR #810.

CI did not signal this because there were no merge conflicts and it never
rebuilt PR #797 against the updated master.

To avoid this in the future, use `bors r+`, which first tries to build the
merged PR (as opposed to the unmerged PR branch) before actually pushing to
master.
  • Loading branch information
mrBliss committed Jul 26, 2019
1 parent f3fdb0c commit 8149b1a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ mkImmDB :: ImmutableDB (HeaderHash blk) m
-> (blk -> Encoding)
-> EpochInfo m
-> (blk -> Maybe (HeaderHash blk))
-> ErrorHandling ImmDB.ImmutableDBError m
-> ImmDB m blk
mkImmDB immDB decBlock encBlock immEpochInfo isEBB = ImmDB {..}
mkImmDB immDB decBlock encBlock immEpochInfo isEBB err = ImmDB {..}

{-------------------------------------------------------------------------------
Getting and parsing blocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ implIteratorClose varItState itrId IteratorEnv{..} = do
mbImmIt <- iteratorStateImmIt <$> readTVar varItState
writeTVar varItState Closed
return mbImmIt
mapM_ (ImmDB.iteratorClose cdbImmDB) mbImmIt
mapM_ (ImmDB.iteratorClose itImmDB) mbImmIt

-- | Possible states of an iterator.
--
Expand Down Expand Up @@ -569,8 +569,8 @@ implIteratorNext varItState IteratorEnv{..} =
-> InImmDBEnd blk
-> m (IteratorResult blk)
nextInImmDB continueFrom immIt immEnd = do
immRes <- selectResult immEnd <$> ImmDB.iteratorNext cdbImmDB immIt
<*> ImmDB.iteratorHasNext cdbImmDB immIt
immRes <- selectResult immEnd <$> ImmDB.iteratorNext itImmDB immIt
<*> ImmDB.iteratorHasNext itImmDB immIt
case immRes of
NotDone blk -> do
let continueFrom' = StreamFromExclusive (blockPoint blk)
Expand Down Expand Up @@ -605,8 +605,8 @@ implIteratorNext varItState IteratorEnv{..} =
-> NonEmpty (HeaderHash blk)
-> m (IteratorResult blk)
nextInImmDBRetry mbContinueFrom immIt (hash NE.:| hashes) =
selectResult StreamAll <$> ImmDB.iteratorNext cdbImmDB immIt
<*> ImmDB.iteratorHasNext cdbImmDB immIt >>= \case
selectResult StreamAll <$> ImmDB.iteratorNext itImmDB immIt
<*> ImmDB.iteratorHasNext itImmDB immIt >>= \case
NotDone blk | blockHash blk == hash -> do
trace $ BlockWasCopiedToImmDB hash
let continueFrom' = StreamFromExclusive (blockPoint blk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ openDB args@VolDbArgs{..} = do
mkVolDB :: VolatileDB (HeaderHash blk) m
-> (forall s. Decoder s blk)
-> (blk -> Encoding)
-> ErrorHandling (VolatileDBError (HeaderHash blk)) m
-> ThrowCantCatch (VolatileDBError (HeaderHash blk)) (STM m)
-> VolDB m blk
mkVolDB volDB decBlock encBlock = VolDB {..}
mkVolDB volDB decBlock encBlock err errSTM = VolDB {..}

{-------------------------------------------------------------------------------
Wrappers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ initIteratorEnv TestSetup { immutable, volatile } tracer = do
(_volDBModel, volDB) <- VolDB.openDBMock EH.throwSTM 1
forM_ blocks $ \block ->
VolDB.putBlock volDB (blockInfo block) (serialiseIncremental block)
return $ mkVolDB volDB decode encode
return $ mkVolDB volDB decode encode EH.monadCatch EH.throwSTM

blockInfo :: TestBlock -> VolDB.BlockInfo (HeaderHash TestBlock)
blockInfo tb = VolDB.BlockInfo
Expand All @@ -295,4 +295,5 @@ initIteratorEnv TestSetup { immutable, volatile } tracer = do
ImmDB.appendBinaryBlob immDB (blockSlot block)
(serialiseIncremental block)
let epochInfo = fixedSizeEpochInfo epochSize
return $ mkImmDB immDB decode encode epochInfo (const Nothing)
isEBB = const Nothing
return $ mkImmDB immDB decode encode epochInfo isEBB EH.monadCatch

0 comments on commit 8149b1a

Please sign in to comment.