Skip to content

Commit

Permalink
[2.0.0] feat: LookupMap and LookupSet (#217)
Browse files Browse the repository at this point in the history
## `2.0.0`

### Contract changes

* Updated `status-message-collections` to use `LookupMap`
* **BREAKING** Updated `fungible-token` implementation to use `LookupMap`. It changes storage layout.

### API changes

* Introduce `LookupMap` and `LookupSet` that are faster implementations of `UnorderedMap` and `UnorderedSet`, but without support for iterators.
Most read/lookup/write are done in 1 storage access instead of 2 or 3 for `Unordered*` implementations.
* **BREAKING** `Default` is removed from `near_sdk::collections` to avoid implicit state conflicts.
Collections should be initialized by explicitly specifying prefix using `new` method.
* **BREAKING** `TreeMap` implementation was updated to use `LookupMap`.
Previous `TreeMap` implementation was renamed to `LegacyTreeMap` and was deprecated.
It should only be used if the contract was already deployed and state has to be compatible with the previous implementation.
  • Loading branch information
Evgeny Kuzyakov authored Aug 24, 2020
1 parent 740ab12 commit c4c8a7f
Show file tree
Hide file tree
Showing 34 changed files with 3,039 additions and 797 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## `2.0.0`

### Contract changes

* Updated `status-message-collections` to use `LookupMap`
* **BREAKING** Updated `fungible-token` implementation to use `LookupMap`. It changes storage layout.

### API changes

* Introduce `LookupMap` and `LookupSet` that are faster implementations of `UnorderedMap` and `UnorderedSet`, but without support for iterators.
Most read/lookup/write are done in 1 storage access instead of 2 or 3 for `Unordered*` implementations.
* **BREAKING** `Default` is removed from `near_sdk::collections` to avoid implicit state conflicts.
Collections should be initialized by explicitly specifying prefix using `new` method.
* **BREAKING** `TreeMap` implementation was updated to use `LookupMap`.
Previous `TreeMap` implementation was renamed to `LegacyTreeMap` and was deprecated.
It should only be used if the contract was already deployed and state has to be compatible with the previous implementation.

## `1.0.1`

### Other changes
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 57 additions & 47 deletions examples/cross-contract-high-level/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Loading

0 comments on commit c4c8a7f

Please sign in to comment.