cardano-rpc
Safe HaskellNone
LanguageHaskell2010

Cardano.Rpc.Server.Internal.UtxoRpc.Type.ChainPoint

Synopsis

Documentation

utxoRpcChainPointMsgToChainPoint :: (HasCallStack, MonadThrow m) => Proto ChainPoint -> m (ChainPoint, WithOrigin BlockNo, UTCTime) Source #

Inverse of mkChainPointMsg. Note: Origin and At (BlockNo 0) both encode to height=0, so the decode always maps 0 back to Origin.

mkTipBlockRef Source #

Arguments

:: Header (CardanoBlock StandardCrypto) 
-> UTCTime

Slot wall-clock time; encoded as milliseconds since the Unix epoch

-> Proto BlockRef 

Project a ChainDB header and a slot timestamp into a BlockRef: slot, header hash, block height and timestamp.

chainPointToBlockRef :: ChainPoint -> Proto BlockRef Source #

Project a ChainPoint into a BlockRef with slot and hash only - a rollback reference has no height or timestamp, so those are left at their proto defaults. ChainPointAtGenesis becomes the default message (origin).

utcTimeToMs :: UTCTime -> Word64 Source #

Milliseconds since the Unix epoch, the timestamp encoding UTxO RPC uses.