diff --git a/projects/trails/src/Mirza/Trails/Handlers/Trails.hs b/projects/trails/src/Mirza/Trails/Handlers/Trails.hs index 73bb4aab..c935eb8c 100644 --- a/projects/trails/src/Mirza/Trails/Handlers/Trails.hs +++ b/projects/trails/src/Mirza/Trails/Handlers/Trails.hs @@ -159,7 +159,7 @@ trailEntryToEntriesT :: TrailEntry -> EntriesT Identity trailEntryToEntriesT trailEntry = EntriesT (trailEntrySignature trailEntry) (toDbTimestamp $ getEntryTime $ trailEntryTimestamp trailEntry) (trailEntryGS1CompanyPrefix trailEntry) - (unEventId $ trailEntryEventID trailEntry) + (unEventId $ trailEntryEventId trailEntry) Nothing diff --git a/projects/trails/src/Mirza/Trails/Types.hs b/projects/trails/src/Mirza/Trails/Types.hs index 0891ee25..b1addbba 100644 --- a/projects/trails/src/Mirza/Trails/Types.hs +++ b/projects/trails/src/Mirza/Trails/Types.hs @@ -87,7 +87,7 @@ data TrailEntry = TrailEntry { trailEntryVersion :: Integer , trailEntryTimestamp :: EntryTime , trailEntryGS1CompanyPrefix :: GS1CompanyPrefix - , trailEntryEventID :: EventId + , trailEntryEventId :: EventId , trailEntryParentSignatures :: [SignaturePlaceholder] , trailEntrySignature :: SignaturePlaceholder } deriving (Show, Generic, Eq) diff --git a/projects/trails/test/Mirza/Trails/Tests/Client.hs b/projects/trails/test/Mirza/Trails/Tests/Client.hs index c58d902e..e263cc7a 100644 --- a/projects/trails/test/Mirza/Trails/Tests/Client.hs +++ b/projects/trails/test/Mirza/Trails/Tests/Client.hs @@ -75,7 +75,7 @@ clientSpec = do getSingleEntryBySignatureResult `shouldMatchTrail` [singleEntry] step "That getting a single entry trail by eventId works." - getSingleEntryByEventIdResult <- http $ getTrailByEventId (trailEntryEventID singleEntry) + getSingleEntryByEventIdResult <- http $ getTrailByEventId (trailEntryEventId singleEntry) getSingleEntryByEventIdResult `shouldMatchTrail` [singleEntry] @@ -323,7 +323,7 @@ buildEntry = do -- This is a hack for now untril we implement signatures properly. buildSignature :: TrailEntry -> SignaturePlaceholder -buildSignature entry = SignaturePlaceholder $ "SignaturePlaceholder-" <> (toText $ unEventId $ trailEntryEventID entry) +buildSignature entry = SignaturePlaceholder $ "SignaturePlaceholder-" <> (toText $ unEventId $ trailEntryEventId entry) -- This function is just designed to simplify expression, see addNextEntry comment. @@ -387,7 +387,7 @@ updateFirstEventId _ [] = error "Error: There is a logic error in the tests. Can -- Updates the eventId of the entry. updateEventId :: EventId -> TrailEntry -> TrailEntry -updateEventId eventId entry = entry{trailEntryEventID = eventId} -- TODO: Need to resign at this point... +updateEventId eventId entry = entry{trailEntryEventId = eventId} -- TODO: Need to resign at this point... -- This function is just designed to simplify expression. @@ -399,7 +399,7 @@ firstSignature = firstField trailEntrySignature -- This function is just designed to simplify expression. -- Gets the eventId of the first entry in the trail list. firstEventId :: [TrailEntry] -> EventId -firstEventId = firstField trailEntryEventID +firstEventId = firstField trailEntryEventId -- This function is just designed to simplify expression. @@ -446,7 +446,7 @@ shouldMatchEntry (TrailEntry actual_version (EntryTime actual_timestamp) a -- Test the 3 end points (addTrail, getTrailBySignature, getTrailByEventId) for the specified trail. checkTrail :: (String -> IO()) -> (forall a. ClientM a -> IO (Either ServantError a)) -> String -> [TrailEntry] -> IO () -checkTrail step http differentator trail = checkPartialTrail step http differentator trail trail (trailEntrySignature <$> trail) (trailEntryEventID <$> trail) +checkTrail step http differentator trail = checkPartialTrail step http differentator trail trail (trailEntrySignature <$> trail) (trailEntryEventId <$> trail) checkPartialTrail :: (String -> IO()) -> (forall a. ClientM a -> IO (Either ServantError a)) -> String -> [TrailEntry] -> [TrailEntry] -> [SignaturePlaceholder] -> [EventId] -> IO () @@ -468,7 +468,7 @@ checkPartialTrail step http differentator inputTrail expectedTrail sigs eventIds checkDistinctTrailsCommonEventId :: (String -> IO()) -> (forall a. ClientM a -> IO (Either ServantError a)) -> String -> [TrailEntry] -> [TrailEntry] -> EventId -> IO () checkDistinctTrailsCommonEventId step http differentator topTrail bottomTrail commonEventId = do - let filterNotMatchingTrailId matchingTrailId trail = filter (/= matchingTrailId) $ trailEntryEventID <$> trail + let filterNotMatchingTrailId matchingTrailId trail = filter (/= matchingTrailId) $ trailEntryEventId <$> trail let completeTrail = topTrail <> bottomTrail -- traceM $ "\nCompleteTrail: " <> (prettyTrail completeTrail)