cosmos-sdk/x/capability/spec/02_state.md
Facundo Medica 137c758d57
chore: Add x/capability docs (#11922)
* chore: Add x/capability docs

* bad ident
2022-05-11 13:23:54 +02:00

27 lines
715 B
Markdown

<!--
order: 2
-->
# State
## In persisted KV store
1. Global unique capability index
2. Capability owners
Indexes:
* Unique index: `[]byte("index") -> []byte(currentGlobalIndex)`
* Capability Index: `[]byte("capability_index") | []byte(index) -> ProtocolBuffer(CapabilityOwners)`
## In-memory KV store
1. Initialized flag
2. Mapping between the module and capability tuple and the capability name
3. Mapping between the module and capability name and its index
Indexes:
* Initialized flag: `[]byte("mem_initialized")`
* RevCapabilityKey: `[]byte(moduleName + "/rev/" + capabilityName) -> []byte(index)`
* FwdCapabilityKey: `[]byte(moduleName + "/fwd/" + capabilityPointerAddress) -> []byte(capabilityName)`