Skip to content

Implement try_append for StorageNMap#5745

Merged
shawntabrizi merged 12 commits into
paritytech:masterfrom
CJ13th:try-append-nmap
Sep 23, 2024
Merged

Implement try_append for StorageNMap#5745
shawntabrizi merged 12 commits into
paritytech:masterfrom
CJ13th:try-append-nmap

Conversation

@CJ13th

@CJ13th CJ13th commented Sep 18, 2024

Copy link
Copy Markdown
Contributor

Description

Closes #5722

Added an implementation of the try_append functionality which is present on the other storage map types but currently missing from StorageNMap.

polkadot address: 12VNFoH4iy4227mpTPvUbUbAnYv7of6LhWcD6EUik3VfFHbD

@CJ13th CJ13th requested a review from a team as a code owner September 18, 2024 01:16
@rainbow-promise

Copy link
Copy Markdown
Contributor

LGTM

assert_ok!(FooQuadMap::try_append((2, 1, 1, 1), 5));
assert_eq!(
FooQuadMap::get((2, 1, 1, 1)).unwrap(),
BoundedVec::<u32, ConstU32<7>>::try_from(vec![4, 5]).unwrap(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

code above uses the same syntax, so i think this is fine

@shawntabrizi

shawntabrizi commented Sep 23, 2024

Copy link
Copy Markdown
Member

/tip medium

@CJ13th follow the instructions below to receive a tip

@substrate-tip-bot

Copy link
Copy Markdown

@CJ13th Contributor did not properly post their account address.

Make sure the pull request description (or user bio) has: "{network} address: {address}".

@shawntabrizi shawntabrizi added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Sep 23, 2024
@shawntabrizi shawntabrizi added this pull request to the merge queue Sep 23, 2024
Merged via the queue into paritytech:master with commit e0766bb Sep 23, 2024
@CJ13th

CJ13th commented Sep 24, 2024

Copy link
Copy Markdown
Contributor Author

Thanks all for reviewing and merging. @shawntabrizi I have updated the pull request description and my bio to include my DOT address.

@ggwpez

ggwpez commented Sep 24, 2024

Copy link
Copy Markdown
Member

/tip medium

@substrate-tip-bot

Copy link
Copy Markdown

@ggwpez A referendum for a medium (80 DOT) tip was successfully submitted for @CJ13th (12VNFoH4iy4227mpTPvUbUbAnYv7of6LhWcD6EUik3VfFHbD on polkadot).

Referendum number: 1181.
tip

@substrate-tip-bot

Copy link
Copy Markdown

The referendum has appeared on Polkassembly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T1-FRAME This PR/Issue is related to core FRAME, the framework.

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

API fn try_append is missing for StorageNMap

6 participants