Skip to content

Instantly share code, notes, and snippets.

View voidlizard's full-sized avatar

Dmitry Zuikov voidlizard

View GitHub Profile
withState do
transactional do
sz <- getDataSizeFromMeta
ref <- getStateRefFromMeta
withState $ insertProcessed htx
rdb <- withState (selectRank rv)
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# Language AllowAmbiguousTypes #-}
{-# Language UndecidableInstances #-}
{-# Language TemplateHaskell #-}
module HBS2Share.State
( module DBPipe.SQLite
, withState
, insertProcessed
, isProcessed
, updateReceived
{-# Language AllowAmbiguousTypes #-}
{-# Language UndecidableInstances #-}
{-# Language TypeFamilyDependencies #-}
{-# Language MultiWayIf #-}
module Main where
import Data.Word
import Data.Bits
import Data.ByteString (ByteString)
import Data.ByteString qualified as BS
{-# OPTIONS_GHC -fno-warn-orphans #-}
module RPC2.Storage where
import HBS2.Actors.Peer.Types
import HBS2.Prelude.Plated
import HBS2.Data.Types.Refs (HashRef(..),RefAlias(..))
import HBS2.Storage
import HBS2.Net.Proto.Service
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE TypeOperators #-}
module PrototypeGenericService where
import Data.Kind
import Data.List qualified as List
data Method1
data Method2
instance ( MonadIO m
, MonadError OperationError m
, Storage sto h ByteString m
, Storage sto h ByteString IO
, h ~ HbSync
, ForGroupKeySymm s
) => MerkleWriter (ToEncrypt 'Symm s ByteString) h sto m where
type instance ToBlockW (ToEncrypt 'Symm s ByteString) = ByteString
{-# Language TemplateHaskell #-}
{-# Language AllowAmbiguousTypes #-}
{-# Language UndecidableInstances #-}
{-# Language MultiWayIf #-}
module QBLF.Proto where
import HBS2.Prelude.Plated
import HBS2.System.Logger.Simple
import HBS2.Clock
import HBS2.Hash
module Main where
import HBS2.Prelude
import HBS2.Base58
import HBS2.OrDie
import HBS2.Net.Proto.Types
import HBS2.Actors.Peer
import HBS2.Net.Proto.RefChan
import HBS2.Net.Messaging.Unix
import HBS2.Net.Proto.Definition()
import Streaming.Prelude qualified as S
import Streaming qualified as S
-- FIXME: move-to-library
readBlob :: forall m . ( MonadIO m
, HasStorage m
, Block ByteString ~ ByteString
)
=> HashRef
-> m (Maybe ByteString)
{-# Language TemplateHaskell #-}
module Main where
import HBS2.Prelude.Plated
import HBS2.Net.Proto.Types
import HBS2.Clock
import HBS2.Net.Messaging.TCP
import HBS2.Actors.Peer
import HBS2.System.Logger.Simple