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

Conversation

@Doordashcon
Copy link
Contributor

@Doordashcon Doordashcon commented Mar 2, 2022

This PR attempts to solve #10943

polkadot address: 12zsKEDVcHpKEWb99iFt3xrTCQQXZMu477nJQsTBBrof5k2h

@Doordashcon Doordashcon marked this pull request as draft March 2, 2022 00:17
{
System: frame_system::{Pallet, Call, Storage, Event<T>, Config},
BagsList: bags_list::{Pallet, Call, Storage, Event<T>},
BagsList: bags_list::{Pallet, Call, Storage, Event<T, I>},
Copy link
Member

Choose a reason for hiding this comment

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

Here I would add two copies of this bags list pallet, and then do a test which modifies the pallet in different ways and shows they both hold state correctly.

Generally, any PR should have tests which show what the PR does.

Copy link
Contributor

Choose a reason for hiding this comment

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

we can have a proper and realistic test for this after #10944, in the meantime I can't think of any imaginative way tbh. I think as long as this PR does not alter any logic, it is fine to go in without further tests. We don't want to test "does pallet instances way the work we expect" here.

Copy link
Contributor

Choose a reason for hiding this comment

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

(unless if there are ways that we can make a pallet instantiable incorrectly. My assumption was that if it compiles, it works).

@shawntabrizi shawntabrizi added B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Mar 2, 2022
@kianenigma kianenigma requested a review from emostov March 2, 2022 09:23
@Doordashcon Doordashcon marked this pull request as ready for review March 4, 2022 19:28
impl<T: Config<I>, I: 'static> Bag<T, I> {
#[cfg(test)]
pub(crate) fn new(
phantom: PhantomData<I>,
Copy link
Contributor

@kianenigma kianenigma Mar 7, 2022

Choose a reason for hiding this comment

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

really think this is not the pattern of how to do this: just use Default::default? or anything else?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, phantom should not need to be passed in as a argument

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

few minor notes, but overall looks good to me! Thanks for your contribution

Copy link
Contributor

@emostov emostov left a comment

Choose a reason for hiding this comment

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

Mostly there - see comments. Tag me once all the comments are addressed. Thanks!

@emostov
Copy link
Contributor

emostov commented Mar 8, 2022

Also, if you include you polkadot or kusama address in a comment we can tip you :)

@Doordashcon Doordashcon requested a review from emostov March 9, 2022 11:09
@shawntabrizi
Copy link
Member

/tip small

@substrate-tip-bot
Copy link

A small tip was successfully submitted for Doordashcon (12zsKEDVcHpKEWb99iFt3xrTCQQXZMu477nJQsTBBrof5k2h on polkadot).

https://polkadot.js.org/apps/#/treasury/tips

@kianenigma
Copy link
Contributor

included in #10997

@kianenigma kianenigma closed this Mar 9, 2022
@Doordashcon
Copy link
Contributor Author

Thanks for the Tip :)

@Doordashcon Doordashcon deleted the ddc-BPL-T1 branch March 14, 2022 15:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants