Splice.Amulet.CryptoHash
Splice.Amulet.CryptoHash
Utilities to compute cryptographic hashes of Daml data structures. We use this for computing compact commitments for reflecting off-ledger data shared by the SV nodes on-ledger.
Note that the hashes are based on viewing all scalar values as strings and taking
a structural view of Daml records; i.e., the hashes do not include a unique type
tag by default. Make sure to include a type tag using hashVariant if you
want to hash different data structures in the same scope.
Typeclasses
class Hashable a where
Data Types
data Hash
Field
Type
Description
value
instance GetField "batchHash" ProcessRewardsV2 Hash
instance GetField "batchHash" AmuletRules_StartProcessingRewardsV2 Hash
instance GetField "value" Hash Text
instance SetField "batchHash" ProcessRewardsV2 Hash
instance SetField "batchHash" AmuletRules_StartProcessingRewardsV2 Hash
Functions
hashRecordCompute the hash of a record.
hashUpgradedRecord: [Hash] -> [Optional Hash] -> Hash
Compute the hash of an upgraded record so that it agrees with the old record hash when ignoring trailing None fields.
hashVariantCompute the hash of a variant.
hashUpgradedVariant: Text -> [Hash] -> [Optional Hash] -> Hash
Compute the hash of an upgraded variant so that it agrees with the old variant hash when ignoring trailing None fields.
Comments