Skip to content

Commit

Permalink
MetaData -> Metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed Jan 11, 2021
1 parent 2fa6f55 commit 2f340d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/core/src/Cardano/Wallet/DB/Sqlite.hs
Expand Up @@ -1651,7 +1651,7 @@ mkTxMetaEntity wid txid mfee meta derived = TxMeta
, txMetaAmount = getQuantity (derived ^. #amount)
, txMetaFee = fromIntegral . W.unCoin <$> mfee
, txMetaSlotExpires = derived ^. #expiry
, txMetaData = meta
, txMetadata = meta
}

-- note: TxIn records must already be sorted by order
Expand All @@ -1669,7 +1669,7 @@ txHistoryFromEntity ti tip metas ins outs ws =
mapM mkItem metas
where
startTime' = interpretQuery ti . slotToUTCTime
mkItem m = mkTxWith (txMetaTxId m) (txMetaFee m) (txMetaData m) (mkTxDerived m)
mkItem m = mkTxWith (txMetaTxId m) (txMetaFee m) (txMetadata m) (mkTxDerived m)
mkTxWith txid mfee meta derived = do
t <- startTime' (derived ^. #slotNo)
return $ W.TransactionInfo
Expand Down
2 changes: 1 addition & 1 deletion lib/core/src/Cardano/Wallet/DB/Sqlite/TH.hs
Expand Up @@ -108,7 +108,7 @@ TxMeta
txMetaSlot SlotNo sql=slot
txMetaBlockHeight Word32 sql=block_height
txMetaAmount Natural sql=amount
txMetaData W.TxMetadata Maybe sql=data
txMetadata W.TxMetadata Maybe sql=data
txMetaSlotExpires SlotNo Maybe sql=slot_expires
txMetaFee Natural Maybe sql=fee

Expand Down
12 changes: 6 additions & 6 deletions lib/shelley/src/Cardano/Wallet/Shelley/Compatibility.hs
Expand Up @@ -936,9 +936,9 @@ fromShelleyWdrl (SL.Wdrl wdrl) = Map.fromList $
bimap (fromStakeCredential . SL.getRwdCred) fromShelleyCoin
<$> Map.toList wdrl

fromShelleyMD :: SL.MetaData -> Cardano.TxMetadata
fromShelleyMD (SL.MetaData m) =
Cardano.makeTransactionMetadata . fromShelleyMetaData $ m
fromShelleyMD :: SL.Metadata -> Cardano.TxMetadata
fromShelleyMD (SL.Metadata m) =
Cardano.makeTransactionMetadata . fromShelleyMetadata $ m

-- Convert & filter Shelley certificate into delegation certificate. Returns
-- 'Nothing' if certificates aren't delegation certificate.
Expand Down Expand Up @@ -973,7 +973,7 @@ fromShelleyRegistrationCert = \case
, W.poolMargin = fromUnitInterval (SL._poolMargin pp)
, W.poolCost = lovelaceFromCoin (SL._poolCost pp)
, W.poolPledge = lovelaceFromCoin (SL._poolPledge pp)
, W.poolMetadata = fromPoolMetaData <$> strictMaybeToMaybe (SL._poolMD pp)
, W.poolMetadata = fromPoolMetadata <$> strictMaybeToMaybe (SL._poolMD pp)
}
)

Expand All @@ -995,8 +995,8 @@ toWalletCoin = W.Coin . unsafeCoinToWord64
unsafeCoinToWord64 :: SL.Coin -> Word64
unsafeCoinToWord64 (SL.Coin c) = fromIntegral c

fromPoolMetaData :: SL.PoolMetaData -> (W.StakePoolMetadataUrl, W.StakePoolMetadataHash)
fromPoolMetaData meta =
fromPoolMetadata :: SL.PoolMetadata -> (W.StakePoolMetadataUrl, W.StakePoolMetadataHash)
fromPoolMetadata meta =
( W.StakePoolMetadataUrl (urlToText (SL._poolMDUrl meta))
, W.StakePoolMetadataHash (SL._poolMDHash meta)
)
Expand Down

0 comments on commit 2f340d0

Please sign in to comment.