summaryrefslogtreecommitdiff
path: root/src/Identity.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Identity.hs')
-rw-r--r--src/Identity.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Identity.hs b/src/Identity.hs
index 76d0c97..65fec8a 100644
--- a/src/Identity.hs
+++ b/src/Identity.hs
@@ -1,22 +1,28 @@
module Identity (
- Identity(..),
+ Identity, IdentityData(..),
) where
import Data.Text (Text)
+import PubKey
import Storage
-data Identity = Identity
+type Identity = Signed IdentityData
+
+data IdentityData = Identity
{ idName :: Text
, idPrev :: Maybe (Stored Identity)
+ , idKeyIdentity :: Stored PublicKey
}
deriving (Show)
-instance Storable Identity where
+instance Storable IdentityData where
store' idt = storeRec $ do
storeText "name" $ idName idt
storeMbRef "prev" $ idPrev idt
+ storeRef "key-id" $ idKeyIdentity idt
load' = loadRec $ Identity
<$> loadText "name"
<*> loadMbRef "prev"
+ <*> loadRef "key-id"