Skip to content

Commit

Permalink
no more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
silky committed Jun 8, 2021
1 parent 5c47477 commit d4107b8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions plutus-pab/src/Plutus/PAB/Db/Beam/ContractStore.hs
Expand Up @@ -61,13 +61,15 @@ mkContracts
mkContracts xs =
Map.fromList xs'
where
xs' = map f xs
toId = ContractInstanceId . fromMaybe (error "Couldn't convert String to UUID") . fromText
f ci = ( toId . _contractInstanceId $ ci
, ContractActivationArgs
(ContractExe . Text.unpack . _contractInstanceContractPath $ ci)
(Wallet . read . Text.unpack . _contractInstanceWallet $ ci)
)
-- Silently drop those items that failed to decode to UUIDs (shouldn't
-- ever happen ....)
xs' = [ (k, v) | (Just k, v) <- map f xs ]
toId i = ContractInstanceId <$> fromText i
f ci = ( toId . _contractInstanceId $ ci
, ContractActivationArgs
(ContractExe . Text.unpack . _contractInstanceContractPath $ ci)
(Wallet . read . Text.unpack . _contractInstanceWallet $ ci)
)

uuidStr :: ContractInstanceId -> Text
uuidStr = toText . unContractInstanceId
Expand Down

0 comments on commit d4107b8

Please sign in to comment.