Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Rename StorageMap::exists to ::contains_key (Resolves #4839) #4847

Merged
merged 2 commits into from
Feb 8, 2020

Conversation

apopiak
Copy link
Contributor

@apopiak apopiak commented Feb 6, 2020

As mentioned in #4839 it would be nice to align the StorageMap interface with the ones provided by Rusts HashMap and BTreeMap.

This PR renames StorageMap::exists(key) to StorageMap::contains_key(key) (and adjusts usage in pallets).

As I don't have a good overview of substrate, yet, please let me know which documentation needs to change.

See paritytech/polkadot#827 and polkadot-developers/substrate-developer-hub.github.io#445 for the companion PRs.

@apopiak apopiak added the A3-in_progress Pull request is in progress. No review needed at this stage. label Feb 6, 2020
@parity-cla-bot
Copy link

It looks like @apopiak hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
Wikipedia

You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io

Once you've signed, please reply to this thread with [clabot:check] to prove it.

Many thanks,

Parity Technologies CLA Bot

@apopiak
Copy link
Contributor Author

apopiak commented Feb 6, 2020

[clabot:check]

@parity-cla-bot
Copy link

It looks like @apopiak signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@apopiak apopiak force-pushed the apopiak-rename-exists-to-contains-key branch from 16540a4 to 83d1128 Compare February 7, 2020 09:31
@apopiak apopiak self-assigned this Feb 7, 2020
@apopiak apopiak requested a review from bkchr February 7, 2020 09:59
@bkchr bkchr merged commit f123c29 into master Feb 8, 2020
@bkchr bkchr deleted the apopiak-rename-exists-to-contains-key branch February 8, 2020 19:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants