| Copyright | Aleksandr Krupenkin 2016-2024 |
|---|---|
| License | Apache-2.0 |
| Maintainer | mail@akru.me |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Network.Polkadot.Storage.Key
Description
When you use the Substrate RPC to access a storage item, you only need to provide the key associated with that item.
Synopsis
- data Argument where
- type Hasher = Argument -> ByteString
- data StorageEntry
- = PlainEntry ByteString
- | MapEntry (Argument -> ByteString)
- | DoubleMapEntry (Argument -> Argument -> ByteString)
- | NMapEntry ([Argument] -> ByteString)
- newEntry :: Text -> StorageEntryMetadata -> StorageEntry
- getHasher :: StorageHasher -> Hasher
Documentation
General type wrapper for SCALE encodable storage index argument.
type Hasher = Argument -> ByteString Source #
Hasher is a function that hash given argument.
data StorageEntry Source #
Entry type describe storage prefix for different storage entity types.
Constructors
| PlainEntry ByteString | Simple storage type without arguments. |
| MapEntry (Argument -> ByteString) | Mapping with hashing for arguments. |
| DoubleMapEntry (Argument -> Argument -> ByteString) | Double map with two different hashers. |
| NMapEntry ([Argument] -> ByteString) | Map with array of hashers. |
Instances
| Show StorageEntry Source # | |
Defined in Network.Polkadot.Storage.Key Methods showsPrec :: Int -> StorageEntry -> ShowS # show :: StorageEntry -> String # showList :: [StorageEntry] -> ShowS # | |
Arguments
| :: Text | Storage prefix (module name). |
| -> StorageEntryMetadata | Storage key metadata, includes entry type, name, etc. |
| -> StorageEntry | Storage key generator. |
Create storage key generator from metadata description.
getHasher :: StorageHasher -> Hasher Source #