From 483cc9e1fe40899c7f045d71d75aaa5ca99db3fb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 12 Sep 2016 15:10:18 -0400 Subject: new module --- HTTP/Client.hs | 1 + HTTP/ProofOfWork.hs | 22 ++++++++++++++++++++++ HTTP/Server.hs | 1 + 3 files changed, 24 insertions(+) create mode 100644 HTTP/ProofOfWork.hs (limited to 'HTTP') diff --git a/HTTP/Client.hs b/HTTP/Client.hs index 0a79ba0..0c28005 100644 --- a/HTTP/Client.hs +++ b/HTTP/Client.hs @@ -6,6 +6,7 @@ module HTTP.Client where import HTTP +import HTTP.ProofOfWork import Types import Types.Storage import Servant.API diff --git a/HTTP/ProofOfWork.hs b/HTTP/ProofOfWork.hs new file mode 100644 index 0000000..45cc96d --- /dev/null +++ b/HTTP/ProofOfWork.hs @@ -0,0 +1,22 @@ +{- Copyright 2016 Joey Hess + - + - Licensed under the GNU AGPL version 3 or higher. + -} + +{-# LANGUAGE DeriveGeneric #-} + +module HTTP.ProofOfWork where + +import Types +import qualified Data.Text as T +import GHC.Generics + +data ProofOfWorkRequirement t + = Result t + | ProofOfWorkRequirement + { leadingZeros :: Int + , argon2Iterations :: Int + } + deriving (Generic) + +newtype ProofOfWork = ProofOfWork T.Text diff --git a/HTTP/Server.hs b/HTTP/Server.hs index 5d5c87f..ab27aaa 100644 --- a/HTTP/Server.hs +++ b/HTTP/Server.hs @@ -8,6 +8,7 @@ module HTTP.Server (runServer) where import HTTP +import HTTP.ProofOfWork import Types import Types.Storage import Tunables -- cgit v1.2.3