-
Notifications
You must be signed in to change notification settings - Fork 142
How CosmWasm's SnapshotMap Works
We would like to create a map such that
CosmWasm's SnapshotMap is implemented as two maps. The first is called
The second, called
That is, for each height it stores the value the key contained before that height.
Our save function saves the old value to
Our load function checks if the provided height has a snapshotted value at the provided height, and if not returns the current value.
Locating a key that satisfies the requirement for the first branch of
This is how CosmWasm's SnapshotMap works.