Skip to content

Commit

Permalink
even more logic in toMetadataEncrypted
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Apr 25, 2024
1 parent 323b16c commit fe8ae47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/api/src/Cardano/Wallet/Api/Http/Shelley/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3167,7 +3167,7 @@ toMetadataEncrypted
toMetadataEncrypted apiEncrypt payload = do
msgValues <- findMsgValues
msgValues' <- mapM encryptingMsg msgValues
undefined
pure $ updateTxMetadata msgValues'
where
pwd = BA.convert $ unPassphrase $ getApiT $ apiEncrypt ^. #passphrase
(secretKey, iv) = PBKDF2.generateKey PBKDF2Config
Expand Down Expand Up @@ -3230,6 +3230,9 @@ toMetadataEncrypted apiEncrypt payload = do
pairs' <- mapM encryptPairIfQualifies pairs
pure (key, Cardano.TxMetaMap $ concat pairs')
encryptingMsg _ = error "encryptingMsg should have TxMetaMap value"
updateTxMetadata =
let (Cardano.TxMetadata themap) = payload ^. #txMetadataWithSchema_metadata
in Cardano.TxMetadata . foldr (\(k,v) -> Map.insert k v) themap

toUsignedTxWdrl
:: c -> ApiWithdrawalGeneral n -> Maybe (RewardAccount, Coin, c)
Expand Down

0 comments on commit fe8ae47

Please sign in to comment.