From 5fb7d44d685f02819b2d0aefade983964146ecf1 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Mon, 23 Sep 2019 14:42:19 -0700 Subject: [PATCH] Dump before going off to work on 0w0 what is this parsing code. --- pkg/king/lib/Vere/Dawn.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/king/lib/Vere/Dawn.hs b/pkg/king/lib/Vere/Dawn.hs index 27b584f8b..f987b85dd 100644 --- a/pkg/king/lib/Vere/Dawn.hs +++ b/pkg/king/lib/Vere/Dawn.hs @@ -65,6 +65,9 @@ passFromEth enc aut sut = clanFromShip :: Ship -> Ob.Class clanFromShip = Ob.clan . Ob.patp . fromIntegral +shipSein :: Ship -> Ship +shipSein = Ship . fromIntegral . Ob.fromPatp . Ob.sein . Ob.patp . fromIntegral + -- Data Validation ------------------------------------------------------------- -- Validates the keys, life, discontinuity, etc. If everything is ok, return @@ -74,12 +77,20 @@ validateAndGetSponsor (Seed ship life ring mo) EthPoint{..} = do let clan = clanFromShip ship case clan of - Ob.Comet -> Left "todo: comet" + Ob.Comet -> do + -- A comet address is the fingerprint of the keypair + -- when (ship /= (x ring.seed)) (Left "todo: key mismatch") + -- A comet can never be breached + -- when live Left "comet already booted" + -- TODO: the parent must be launched check? + Right $ shipSein ship + -- When the ship is a moon, the only requirement is that the parent is -- launched. Ob.Moon -> do Left "todo: moon's parent must be launched" + -- For Galaxies, Stars and Planets, we do the full checks. _ -> case epNet of Nothing -> Left "ship not keyed" Just (life, pass, contNum, _, _) -> do