Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
af6e388
Add migration guide from ink! 4.x to 5.0
cmichi Jan 24, 2024
abed487
Add Krest to compatible production chains
cmichi Jan 24, 2024
062b65d
Merge remote-tracking branch 'origin/master' into cmichi-add-migratio…
cmichi Jan 24, 2024
c90d2ba
Add screenshot of `cargo contract storage`
cmichi Jan 24, 2024
29980d7
Add steps to upgrade
cmichi Jan 25, 2024
95e84b1
Add breaking decode behavior change
cmichi Jan 25, 2024
1d6e623
Add note for `StorageVec`
cmichi Jan 25, 2024
1beaff2
Add note on support for multiple chain extensions
cmichi Jan 25, 2024
c39589e
Add note on stabilized `call_runtime`
cmichi Jan 25, 2024
0d4876a
Add note on chain extension syntax change
cmichi Jan 25, 2024
3a969d7
Move `StorageVec` section up
cmichi Jan 25, 2024
04125e5
Add note on new fallible methods
cmichi Jan 25, 2024
d314a0a
Move `StorageVec` and fallible methods to important section
cmichi Jan 25, 2024
d46d35b
Improve docs on fallible methods
cmichi Jan 25, 2024
7b37142
Improve `StorageVec` text
cmichi Jan 25, 2024
fecf707
Mention `non_fallible_api` lint
cmichi Jan 25, 2024
c55baa0
Update list of fallible `StorageVec` methods
cmichi Jan 25, 2024
95d2498
Update text on recommendations
cmichi Jan 29, 2024
b0c4455
Update section on chain extensions
cmichi Jan 29, 2024
9ff89d4
Mention contract verification
cmichi Jan 29, 2024
31309ed
Add note on fallible methods
cmichi Jan 29, 2024
48c822d
Apply suggestions from code review
Jan 30, 2024
47d2005
Explain reason for data migration better
cmichi Jan 30, 2024
4710bae
Move custom signature topics to Events 2.0
cmichi Jan 30, 2024
bd3f1a9
Added E2E builder API changes
cmichi Jan 30, 2024
b4e161f
Link to more infos about safe math in Rust
cmichi Jan 30, 2024
d69be1d
Improve text on safe math
cmichi Jan 30, 2024
2a7b82d
Clarify text
cmichi Jan 30, 2024
d550fba
Improve text
cmichi Jan 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve docs on fallible methods
  • Loading branch information
cmichi committed Jan 25, 2024
commit d46d35b36862454de8161076b92073e43a6688e1
15 changes: 11 additions & 4 deletions versioned_docs/version-5.x/faq/migrating-from-ink-4-to-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,16 +289,23 @@ attacker can fill the `Vec`, making it very costly to access it or write to it.
You can find verbatim documentation on `StorageVec` [here](/5.x/datastructures/storagevec),
the Rust docs can be found [here](https://docs.rs/ink/5.0.0-rc/ink/storage/struct.StorageVec.html).

## Fallible `get` and `set` methods for `Lazy` and `Mapping`
## We added fallible methods for `Lazy`, `Mapping`, `StorageVec`

In [#1910](https://github.com/paritytech/ink/pull/1910) we added `try_*` methods for
reading and writing `Lazy` and `Mapping` values to and from storage.
For `Mapping`, the encoded size of the key is also accounted for.
Please see the individual Rust docs for these new methods:

We recommend transitioning usages of `Mapping::{set, get}` and `Lazy::{set, get}` to
these new methods. You will thereby have to think of how to handle failure cases that
* [`StorageVec`](https://docs.rs/ink/5.0.0-rc/ink/storage/struct.StorageVec.html)
* [`Lazy`](https://docs.rs/ink/5.0.0-rc/ink/storage/struct.Lazy.html)
* [`Mapping`](https://docs.rs/ink/5.0.0-rc/ink/storage/struct.Mapping.html). For `Mapping`, the encoded size of the key is also accounted for.

We recommend transitioning usages of `Mapping::{insert, get, take}`, `Lazy::{set, get}`,
`StorageVec::get` to these new methods.
You will thereby be forced to think about how to handle failure cases that
can occur, but have so far not been reflected in the API.

Possible failure cases are described in the individual Rust docs.

## Interesting New Features

### End-To-End testing with a chain snapshot
Expand Down