File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed
cardano-db-sync/src/Cardano/DbSync
cardano-db/src/Cardano/Db Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ module Cardano.DbSync.Era.Universal.Insert.GovAction (
28
28
)
29
29
where
30
30
31
- import Cardano.BM.Trace (Trace , logInfo , logWarning )
31
+ import Cardano.BM.Trace (Trace , logWarning )
32
32
import qualified Cardano.Crypto as Crypto
33
33
import Cardano.Db (DbWord64 (.. ))
34
34
import qualified Cardano.Db as DB
Original file line number Diff line number Diff line change @@ -323,6 +323,8 @@ fetchOffChainVoteData _tracer manager time oVoteWorkQ =
323
323
, DB. offChainVoteDrepDataObjectives = Vote. textValue <$> Vote. objectives (Vote. body dt)
324
324
, DB. offChainVoteDrepDataMotivations = Vote. textValue <$> Vote. motivations (Vote. body dt)
325
325
, DB. offChainVoteDrepDataQualifications = Vote. textValue <$> Vote. qualifications (Vote. body dt)
326
+ , DB. offChainVoteDrepDataImageUrl = Vote. textValue . Vote. contentUrl <$> Vote. image (Vote. body dt)
327
+ , DB. offChainVoteDrepDataImageHash = Vote. textValue . Vote. sha256 <$> Vote. image (Vote. body dt)
326
328
}
327
329
_ -> Nothing
328
330
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ getRationale = \case
59
59
eitherDecodeOffChainVoteData :: LBS. ByteString -> DB. AnchorType -> Either String OffChainVoteData
60
60
eitherDecodeOffChainVoteData lbs = \ case
61
61
DB. GovActionAnchor -> OffChainVoteDataGa <$> eitherDecode' lbs
62
- DB. DrepAnchor -> Left " unimplemented "
62
+ DB. DrepAnchor -> OffChainVoteDataDr <$> eitherDecode' lbs
63
63
DB. OtherAnchor -> OffChainVoteDataOther <$> eitherDecode' lbs
64
64
65
65
getAuthors :: OffChainVoteData -> [Author ]
@@ -158,8 +158,8 @@ data DrepBody = DrepBody
158
158
deriving (Show , Generic )
159
159
160
160
data Image = Image
161
- { contentUrl :: Text
162
- , sha256 :: Text
161
+ { contentUrl :: TextValue
162
+ , sha256 :: TextValue
163
163
}
164
164
deriving (Show , Generic , FromJSON )
165
165
@@ -276,11 +276,11 @@ instance FromJSON DrepBody where
276
276
DrepBody mBody
277
277
<$> o .:? " paymentAddress"
278
278
<*> parseTextLimit 80 " givenName" o
279
- <*> o .: " image"
279
+ <*> o .:? " image"
280
280
<*> parseTextLimitMaybe 1000 " objectives" o
281
281
<*> parseTextLimitMaybe 1000 " motivations" o
282
282
<*> parseTextLimitMaybe 1000 " qualifications" o
283
- <*> o .: " doNotList"
283
+ <*> o .:? " doNotList"
284
284
where
285
285
withObjectV v' s p = withObject s p v'
286
286
Original file line number Diff line number Diff line change @@ -711,6 +711,8 @@ share
711
711
objectives Text Maybe
712
712
motivations Text Maybe
713
713
qualifications Text Maybe
714
+ imageUrl Text Maybe
715
+ imageHash Text Maybe
714
716
715
717
OffChainVoteAuthor
716
718
offChainVoteDataId OffChainVoteDataId noreference
You can’t perform that action at this time.
0 commit comments