Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mapping::take() #1461

Merged
merged 8 commits into from
Nov 4, 2022
Merged

Add Mapping::take() #1461

merged 8 commits into from
Nov 4, 2022

Conversation

SkymanOne
Copy link
Contributor

This PR adds a new function Mapping::take() which retrieves and removed a value under the given key from the storage.

Copy link
Contributor

@HCastano HCastano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small things, but generally looks good.

Also, do you know what the version of the contracts pallet introduced seal_take? We'll need to know so we can mention it in the release notes (oh btw, can you add an entry to the CHANGELOG for this)

crates/storage/src/lazy/mapping.rs Outdated Show resolved Hide resolved
crates/storage/src/lazy/mapping.rs Outdated Show resolved Hide resolved
crates/storage/src/lazy/mapping.rs Outdated Show resolved Hide resolved
crates/storage/src/lazy/mapping.rs Outdated Show resolved Hide resolved
crates/storage/src/lazy/mapping.rs Outdated Show resolved Hide resolved
crates/env/src/backend.rs Outdated Show resolved Hide resolved
crates/env/src/api.rs Outdated Show resolved Hide resolved
crates/engine/src/ext.rs Outdated Show resolved Hide resolved
@SkymanOne
Copy link
Contributor Author

Some small things, but generally looks good.

Also, do you know what the version of the contracts pallet introduced seal_take? We'll need to know so we can mention it in the release notes (oh btw, can you add an entry to the CHANGELOG for this)

Yes.
https://github.com/paritytech/substrate/blob/master/frame/contracts/CHANGELOG.md#v300-2021-02-25

@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2022

Codecov Report

Merging #1461 (6af6b9e) into master (60ba345) will increase coverage by 1.19%.
The diff coverage is 91.30%.

@@            Coverage Diff             @@
##           master    #1461      +/-   ##
==========================================
+ Coverage   45.77%   46.97%   +1.19%     
==========================================
  Files         201      201              
  Lines        6187     6210      +23     
==========================================
+ Hits         2832     2917      +85     
+ Misses       3355     3293      -62     
Impacted Files Coverage Δ
crates/env/src/backend.rs 83.33% <ø> (ø)
crates/storage/src/lazy/mapping.rs 70.83% <66.66%> (-0.60%) ⬇️
crates/env/src/engine/off_chain/impls.rs 47.64% <87.50%> (+13.69%) ⬆️
crates/engine/src/ext.rs 67.97% <100.00%> (+9.98%) ⬆️
crates/env/src/api.rs 36.92% <100.00%> (+12.72%) ⬆️
crates/allocator/src/bump.rs 87.39% <0.00%> (+0.84%) ⬆️
crates/env/src/engine/off_chain/test_api.rs 64.70% <0.00%> (+5.88%) ⬆️
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@HCastano HCastano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nits with the wrapping, but otherwise looks good

crates/env/src/api.rs Outdated Show resolved Hide resolved
crates/env/src/backend.rs Outdated Show resolved Hide resolved
German and others added 2 commits November 4, 2022 14:38
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
@SkymanOne SkymanOne merged commit 1deebaa into master Nov 4, 2022
@SkymanOne SkymanOne deleted the gn/mapping-take branch November 4, 2022 15:03
@ascjones ascjones mentioned this pull request Nov 7, 2022
@ascjones ascjones mentioned this pull request Nov 22, 2022
1 task
@ascjones ascjones mentioned this pull request Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants