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

Explain usage of <T: Config> in FRAME storage + Update parachain pallet template #4941

Merged
merged 27 commits into from
Jul 10, 2024

Conversation

kianenigma
Copy link
Contributor

@kianenigma kianenigma commented Jul 4, 2024

Explains one of the annoying parts of FRAME storage that we have seen multiple times in PBA everyone gets stuck on.

I have not updated the other two templates for now, and only reflected it in the parachain template. That can happen in a follow-up.

  • Update possible answers in SE about the same topic.

@kianenigma kianenigma added R0-silent Changes should not be mentioned in any release notes T11-documentation This PR/Issue is related to documentation. labels Jul 4, 2024
@kianenigma kianenigma requested review from cheme and a team as code owners July 4, 2024 10:17
@kianenigma kianenigma changed the title Kiz update tempalates and t in storage Explain usage of <T: Config> in FRAME storage + Update parachain pallet template Jul 4, 2024
@kianenigma kianenigma requested review from koute and a team as code owners July 5, 2024 08:59
@command-bot
Copy link

command-bot bot commented Jul 5, 2024

@kianenigma Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6632431 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6632431/artifacts/download.

@@ -755,7 +755,13 @@ pub mod pallet {
// We ignore this error as it just means the amount we're trying to deposit is
// dust and the beneficiary account doesn't exist.
.or_else(
|e| if e == TokenError::CannotCreate.into() { Ok(()) } else { Err(e) },
|e| {
if e == TokenError::CannotCreate.into() {
Copy link
Member

Choose a reason for hiding this comment

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

New formatter 🙈 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah shit :D

@kianenigma
Copy link
Contributor Author

bot fmt

@command-bot
Copy link

command-bot bot commented Jul 10, 2024

"$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" was queued.

Comment bot cancel 3-e454f776-9833-4266-a5ce-ae8e3eaf24f7 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Jul 10, 2024

@kianenigma Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result:

Error: remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.parity.io/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied
fatal: Authentication failed for 'https://gitlab.parity.io/parity/mirrors/polkadot-sdk.git/'
Error: remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.parity.io/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied
fatal: Authentication failed for 'https://gitlab.parity.io/parity/mirrors/polkadot-sdk.git/'
    at ChildProcess.<anonymous> (/app/build/shell.js:73:39)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1098:16)
    at ChildProcess._handle.onexit (node:internal/child_process:303:5)

@@ -1,4 +1,7 @@
//! A shell pallet built with [`frame`].
//!
//! To get started with this pallet, try implementing the guide in
//! <https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
//! <https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html>
//! <https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html>.

@kianenigma kianenigma added this pull request to the merge queue Jul 10, 2024
Merged via the queue into master with commit 02e50ad Jul 10, 2024
157 of 163 checks passed
@kianenigma kianenigma deleted the kiz-update-tempalates-and-t-in-storage branch July 10, 2024 17:14
@@ -25,10 +25,13 @@ frame-benchmarking = { optional = true, workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }

# primitive deps
sp-runtime = { workspace = true }
sp-std = { workspace = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

Was sp-std be proposed to soft deprecate?
#2101

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm I see, a mistake indeed. Would you like to open a PR that reverts this + added a deprecation warning to sp-std, preventing this from happening?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I can make a following PR to remove the usage of sp-std here.
I don't know how to warn deprecation for a crate...

Copy link
Contributor

Choose a reason for hiding this comment

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

#5001
Following PR is here

github-merge-queue bot pushed a commit that referenced this pull request Jul 12, 2024
Following PR for #4941
that removes usage of `sp-std` on templates

`sp-std` crate was proposed to deprecate on
#2101

@kianenigma

---------

Co-authored-by: Kian Paimani <[email protected]>
TomaszWaszczyk pushed a commit to TomaszWaszczyk/polkadot-sdk that referenced this pull request Jul 13, 2024
…llet template (paritytech#4941)

Explains one of the annoying parts of FRAME storage that we have seen
multiple times in PBA everyone gets stuck on.

I have not updated the other two templates for now, and only reflected
it in the parachain template. That can happen in a follow-up.

- [x] Update possible answers in SE about the same topic.

---------

Co-authored-by: Serban Iorga <[email protected]>
Co-authored-by: command-bot <>
TomaszWaszczyk pushed a commit to TomaszWaszczyk/polkadot-sdk that referenced this pull request Jul 13, 2024
Following PR for paritytech#4941
that removes usage of `sp-std` on templates

`sp-std` crate was proposed to deprecate on
paritytech#2101

@kianenigma

---------

Co-authored-by: Kian Paimani <[email protected]>
ordian added a commit that referenced this pull request Jul 15, 2024
* master: (120 commits)
  network/tx: Ban peers with tx that fail to decode (#5002)
  Try State Hook for Bounties (#4563)
  [statement-distribution] Add metrics for distributed statements in V2 (#4554)
  added sync command (#4818)
  Bridges V2 refactoring backport and `pallet_bridge_messages` simplifications (#4935)
  xcm-executor: Improve logging (#4996)
  Remove usage of `sp-std` on templates (#5001)
  fixed cmd bot commenting not working (#5000)
  Explain usage of `<T: Config>` in FRAME storage + Update parachain pallet template  (#4941)
  Expose metadata-hash feature from polkadot crate (#4886)
  Add `MAX_INSTRUCTIONS_TO_DECODE` to XCMv2 (#4978)
  add notices to the implementer's guide docs that changed for elastic scaling (#4983)
  `polkadot-parachain` simplifications and deduplications (#4916)
  Update Templates README docs (#4980)
  allow clear_origin in safe xcm builder (#4777)
  litep2p/peerstore: Fix bump last updated time (#4971)
  Make `tracing::log` work in the runtime (#4863)
  sp-core: Improve docs generated by `generate_feature_enabled_macro` (#4968)
  [Backport] Version bumps  and  prdocs reordering from 1.14.0 (#4955)
  Assets: can_decrease/increase for destroying asset is not successful (#3286)
  ...
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
…llet template (paritytech#4941)

Explains one of the annoying parts of FRAME storage that we have seen
multiple times in PBA everyone gets stuck on.

I have not updated the other two templates for now, and only reflected
it in the parachain template. That can happen in a follow-up.

- [x] Update possible answers in SE about the same topic.

---------

Co-authored-by: Serban Iorga <[email protected]>
Co-authored-by: command-bot <>
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
Following PR for paritytech#4941
that removes usage of `sp-std` on templates

`sp-std` crate was proposed to deprecate on
paritytech#2101

@kianenigma

---------

Co-authored-by: Kian Paimani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T11-documentation This PR/Issue is related to documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants