diff --git a/src/Tahoe/Capability/Internal/Capability.hs b/src/Tahoe/Capability/Internal/Capability.hs index ed2f2e580feebf0df27bc35a6fb256cfe8fa0688..b77ef2636e8b48d7a6cbdea5a1f03c3fac94d3d5 100644 --- a/src/Tahoe/Capability/Internal/Capability.hs +++ b/src/Tahoe/Capability/Internal/Capability.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} module Tahoe.Capability.Internal.Capability where @@ -17,19 +16,17 @@ class Verifiable verifyCap where -- | Represent the type of share to operate on. type ShareT verifyCap - -- | Represent the type of server we can retrieve the associated shares from. - -- XXX No, this is wrong. - type ServerT verifyCap - -- | Ask a storage server which share numbers related to this capability it -- is holding. This is an unverified result and the storage server could -- present incorrect information. Even if it correctly reports that it -- holds a share, it could decline to give it out when asked. - getShareNumbers :: MonadIO m => verifyCap -> ServerT verifyCap -> m (Set.Set ShareNum) + getShareNumbers :: MonadIO m => verifyCap -> (StorageIndex -> m (Set.Set ShareNum)) -> m (Set.Set ShareNum) -- | Get the encoding parameters used for the shares of this capability. -- The information is presented as a tuple of (required, total). - getRequiredTotal :: MonadIO m => verifyCap -> ServerT verifyCap -> m (Maybe (Int, Int)) + -- + -- XXX Remove this, replace it with + getRequiredTotal :: MonadIO m => verifyCap -> (StorageIndex -> m LB.ByteString) -> m (Maybe (Int, Int)) -- | Get the location information for shares of this capability. getStorageIndex :: verifyCap -> StorageIndex @@ -60,6 +57,6 @@ class Readable r where -- shareToCipherText :: r -> [(ShareNum, ShareT r)] -> LB.ByteString -- -- cipherTextToPlainText :: r -> LB.ByteString -> LB.ByteString - decodeShare :: MonadIO m => r -> [(ShareNum, ShareT (VerifierT r))] -> m (Either DownloadError LB.ByteString) + decodeShares :: MonadIO m => r -> [(ShareNum, ShareT (VerifierT r))] -> m (Either DownloadError LB.ByteString) data DownloadError = DownloadError