Skip to content

Commit

Permalink
wip - adding new haskell module for plugin.
Browse files Browse the repository at this point in the history
it does not compile, but apparently nix/cabal have spoken together and conspired against me by refusing
to even look at the file until I've done a 'git add' on it.
  • Loading branch information
Matthew Eric Bassett committed Jul 8, 2020
1 parent 25fbc46 commit 4b5be26
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cardano-db-sync/cardano-db-sync.cabal
Expand Up @@ -30,8 +30,10 @@ library
-Wincomplete-record-updates
-Wincomplete-uni-patterns

exposed-modules: Cardano.DbSync
exposed-modules:
Cardano.DbSync
Cardano.DbSync.Plugin.Epoch
Cardano.DbSync.Plugin.TxBody

other-modules: Cardano.DbSync.Config
Cardano.DbSync.Database
Expand Down
20 changes: 20 additions & 0 deletions cardano-db-sync/src/Cardano/DbSync/Plugin/TxBody.hs
@@ -0,0 +1,20 @@
module Cardano.DbSync.Plugin.TxBody
( insertTxBody
) where
import Cardano.Binary (serialize')
import Control.Monad.Logger (LoggingT)
import Control.Monad.Trans.Except.Extra (runExceptT)

import qualified Cardano.Chain.Block as Ledger
import qualified Cardano.Chain.Common as Ledger
import qualified Cardano.Chain.UTxO as Ledger


insertTxBody :: Trace IO Text -> ByronBlock -> Tip ByronBlock
-> ReadterT SqlBackend (LoggingT IO) (Either DBSyncNodeError ())
insertTxBody tracer blk tip = do
runExceptT $
case byronBlockRaw blk of
Ledger.ABOBBlock ablk -> insert
_ -> return ()

0 comments on commit 4b5be26

Please sign in to comment.