-
Notifications
You must be signed in to change notification settings - Fork 808
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
Migrate pallet-tips
to umbrella crate
#6532
base: master
Are you sure you want to change the base?
Conversation
User @bennethxyz, please sign the CLA here. |
@kianenigma @re-gius please review |
please review @re-gius |
@@ -654,7 +639,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> { | |||
/// 1. The number of entries in `Tips` should be equal to `Reasons`. | |||
/// 2. Reasons exists for each Tip[`OpenTip.reason`]. | |||
/// 3. If `OpenTip.finders_fee` is true, then OpenTip.deposit should be greater than zero. | |||
#[cfg(any(feature = "try-runtime", test))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why is this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mainly because of this
error[E0433]: failed to resolve: could not find `try_runtime` in `frame`
--> /polkadot-sdk/substrate/frame/tips/src/lib.rs:640:45
|
640 | pub fn do_try_state() -> Result<(), frame::try_runtime::TryRuntimeError> {
| ^^^^^^^^^^^ could not find `try_runtime` in `frame`
|
note: found an item that was configured out
--> /polkadot-sdk/substrate/frame/src/lib.rs:254:9
|
254 | pub mod try_runtime {
| ^^^^^^^^^^^
note: the item is gated here
--> /polkadot-sdk/substrate/frame/src/lib.rs:253:1
|
253 | #[cfg(any(feature = "try-runtime", test))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<Test as crate::Config>::TipReportDepositBase::get() + | ||
<Test as crate::Config>::DataDepositPerByte::get() * | ||
<<Test as crate::Config>::TipReportDepositBase as TypedGet>::get() + | ||
<<Test as crate::Config>::DataDepositPerByte as TypedGet>::get() * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is TypedGet
not in the prelude? I guess because otherwise get
is conflicting. Then it is good as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah
}, | ||
weights::Weight, | ||
}; | ||
use core::str; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -195,6 +181,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { | |||
pub fn build_and_execute(test: impl FnOnce() -> ()) { | |||
new_test_ext().execute_with(|| { | |||
test(); | |||
#[cfg(feature = "try-runtime")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was better before when the state was asserted in the test.
@@ -631,10 +608,9 @@ fn report_awesome_and_tip_works_second_instance() { | |||
} | |||
|
|||
#[test] | |||
#[cfg(feature = "try-runtime")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also prefered before
); | ||
}) | ||
} | ||
|
||
#[test] | ||
#[cfg(feature = "try-runtime")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
); | ||
}) | ||
} | ||
|
||
#[test] | ||
#[cfg(feature = "try-runtime")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
part of #6504
Description
Modifying
pallet-tips
to usepolkadot-frame-sdk
re-exports and adding a few I think relevant for other pallets.Review Notes
runtime::prelude
now includesPalletId
, I saw many other pallets use this in mock environments to distinguish instances of the same pallet and also identifiers for XCM.Added
ensure
to top levelprelude
as it is also used in mock runtimes and other files acrossFRAME
.polkadot address: 15rM9idTv1izwNFqPabfcT4jkqHDsEvHSa5fASAUZwZcS4Yw