Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/master' into bkchr-something-sto…
…rage-version
  • Loading branch information
bkchr committed Apr 27, 2023
commit 1732b68a8eb1611bec29aa80de20aa8049107a08
2 changes: 1 addition & 1 deletion frame/support/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub use randomness::Randomness;

mod metadata;
pub use metadata::{
CallMetadata, CrateVersion, GetCallMetadata, GetCallName, GetStorageVersion,
CallMetadata, CrateVersion, GetCallIndex, GetCallMetadata, GetCallName, GetStorageVersion,
NoStorageVersionSet, PalletInfo, PalletInfoAccess, PalletInfoData, PalletsInfoAccess,
StorageVersion, STORAGE_VERSION_STORAGE_KEY_POSTFIX,
};
Expand Down
22 changes: 21 additions & 1 deletion frame/support/test/tests/pallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ parameter_types! {
static UpdateStorageVersion: bool = false;
}

/// Latest stable metadata version used for testing.
const LATEST_METADATA_VERSION: u32 = 14;

pub struct SomeType1;
impl From<SomeType1> for u64 {
fn from(_t: SomeType1) -> Self {
Expand Down Expand Up @@ -518,7 +521,6 @@ pub mod pallet2 {
}

#[pallet::pallet]
#[pallet::generate_store(pub(crate) trait Store)]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);
Expand Down Expand Up @@ -2110,3 +2112,21 @@ fn post_runtime_upgrade_detects_missing_storage_version_change() {
ExecutiveWithUpgrade::try_runtime_upgrade(UpgradeCheckSelect::PreAndPost).unwrap();
});
}

#[test]
fn test_dispatch_context() {
TestExternalities::default().execute_with(|| {
// By default there is no context
assert!(with_context::<(), _>(|_| ()).is_none());

// When not using `dispatch`, there should be no dispatch context
assert_eq!(
DispatchError::Unavailable,
Example::check_for_dispatch_context(RuntimeOrigin::root()).unwrap_err(),
);

// When using `dispatch`, there should be a dispatch context
assert_ok!(RuntimeCall::from(pallet::Call::<Runtime>::check_for_dispatch_context {})
.dispatch(RuntimeOrigin::root()));
});
}
10 changes: 10 additions & 0 deletions scripts/ci/gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,23 @@ test-linux-stable:
# node-cli is excluded until https://github.com/paritytech/substrate/issues/11321 fixed
- echo "Node index - ${CI_NODE_INDEX}. Total amount - ${CI_NODE_TOTAL}"
- time cargo nextest run --workspace
<<<<<<< HEAD
--locked
--release
--verbose
--features runtime-benchmarks,try-runtime
--manifest-path ./bin/node/cli/Cargo.toml
--exclude node-cli
--partition count:${CI_NODE_INDEX}/${CI_NODE_TOTAL}
=======
--locked
--release
--verbose
--features runtime-benchmarks
--manifest-path ./bin/node/cli/Cargo.toml
--exclude node-cli
--partition count:${CI_NODE_INDEX}/${CI_NODE_TOTAL}
>>>>>>> origin/master
# we need to update cache only from one job
- if [ ${CI_NODE_INDEX} == 1 ]; then rusty-cachier cache upload; fi

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.