-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Resolving Compile Errors in Core Time Prep Tests #1793
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
ef3adf9
Revert "fix(review-bot): pull secrets from `master` environment" (#1748)
d8d90a8
Enable mocking contracts (#1331)
pmikolajczyk41 0691c91
Move import queue from `ChainSync` to `SyncingEngine` (#1736)
dmitry-markin f820dc0
[NPoS] Fix for Reward Deficit in the pool (#1255)
Ank4n 9485b0b
Point documentation links to monorepo (#1741)
skunert 7d4f829
frame-support: `RuntimeDebug\Eq\PartialEq` impls for `Imbalance` (#1717)
muharem 8fe947a
improve service error (#1734)
yjhmelody e8baac7
Tvl pool staking (#1322)
PieWol 2ed66a0
migrate alliance, fast-unstake and bags list to use derive-impl (#1636)
kianenigma c54ea64
no-bound derives: Use absolute path for `core` (#1763)
bkchr db3fd68
Init System Parachain storage versions and add migration check jobs t…
liamaharon 3ea497b
expose the last relay chain block number as an API from parachain-sys…
rphmeier aad80cc
feat: compute pallet/storage prefix hash at compile time (#1539)
yjhmelody d80171e
Update bridges subtree (#1740)
svyatonik cd076d7
Upgraded review-bot to version 2.0.1 (#1784)
Bullrich f4827dc
remove outdated scripts (#1769)
yjhmelody 0a6dfdf
Updating glutton for async backing (#1619)
BradleyOlson64 2bafc11
Fixed test compile errors
BradleyOlson64 4a971d7
Merge branch 'rk-core-time-prep' of https://github.com/paritytech/pol…
BradleyOlson64 2a079fa
Fixing errors after merge
BradleyOlson64 7ab7e38
Fix builder compilation.
83a589b
changing mem_replace back to sp_std
BradleyOlson64 bfa35cd
Merge branch 'brad-core-time-tests' of https://github.com/paritytech/…
BradleyOlson64 86955ee
Remove deprecated CI config files (#1799)
sergejparity 51c0c24
PVF: Add back socket path parameter, use tmp socket path (#1780)
mrcnski d21113c
Delete full db directory with `purge-chain` subcommand (#1786)
skunert 0c59232
Bump the known_good_semver group with 1 update (#1752)
dependabot[bot] b6dd905
Partial mock assigner with static storage
BradleyOlson64 1835c09
Revive Substrate Crate (#1477)
ggwpez 02e4eab
Mock assigner take 1
BradleyOlson64 ddf5e5c
Bump the known_good_semver group with 1 update (#1802)
dependabot[bot] 35ed272
migrate babe and authorship to use derive-impl (#1790)
Dmitry-Borodin a330ea2
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
BradleyOlson64 0f01b22
Fixed assigner test
BradleyOlson64 07ec512
Tests passed and mock assigner fixed
BradleyOlson64 7e820f3
Revert "Merge branch 'master'
BradleyOlson64 696abda
made constructor private, and fmt
BradleyOlson64 b13e058
Fixed unneeded config tweak
BradleyOlson64 6eb9057
More tweaks
BradleyOlson64 f9e84aa
Streamlining add_on_demand_order
BradleyOlson64 dcf3e24
Dropped unified assignment in favor of V0
BradleyOlson64 59ad88e
Added to assigner_on_demand tests
BradleyOlson64 9a7c643
Remove assigner state check from scheduler tests
BradleyOlson64 0b93e26
fmt
BradleyOlson64 5504170
Final tweaks
BradleyOlson64 6334d0a
added assert
BradleyOlson64 d7b7d53
Added comments to MockAssigner
BradleyOlson64 495ac04
Generic get_assignment_provider_config
BradleyOlson64 b7e6d36
Simplified mock assigner
BradleyOlson64 c9c4f08
Fixed builder to work with Mock Assigner
BradleyOlson64 f4dd55b
Edited scheduler tests for minimal mock assigner
BradleyOlson64 12a2289
Added unified assigner test file
BradleyOlson64 d0c2a9b
fmt
BradleyOlson64 41c15e2
Removed parachain + parathread mentions from tests
BradleyOlson64 7a191c8
fmt
BradleyOlson64 41e1d35
Comment fix
BradleyOlson64 c1d2add
Merge branch 'rk-core-time-prep' of https://github.com/paritytech/pol…
BradleyOlson64 46ef8cd
Cleanup + better logic.
3f0b797
Shored up assigner_parachains encapsulation
BradleyOlson64 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,26 +110,41 @@ pub enum SpotTrafficCalculationErr { | |
| } | ||
|
|
||
| /// Assignments as provided by the on-demand `AssignmentProvider`. | ||
| #[derive(RuntimeDebug, Encode, Decode, TypeInfo)] | ||
| #[derive(RuntimeDebug, Encode, Decode, TypeInfo, PartialEq, Clone)] | ||
| pub struct OnDemandAssignment { | ||
| /// The assigned para id. | ||
| para_id: ParaId, | ||
| /// The core index the para got assigned to. | ||
| core_index: CoreIndex, | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| impl OnDemandAssignment { | ||
| pub fn new(para_id: ParaId, core_index: CoreIndex) -> Self { | ||
| Self { para_id, core_index } | ||
| } | ||
| } | ||
|
|
||
| impl Assignment for OnDemandAssignment { | ||
| fn para_id(&self) -> ParaId { | ||
| self.para_id | ||
| } | ||
| } | ||
|
|
||
| /// Internal representation of an order after it has been enqueued already. | ||
| #[derive(Encode, Decode, TypeInfo)] | ||
| #[cfg(not(test))] | ||
| #[derive(Encode, Decode, TypeInfo, Debug, PartialEq)] | ||
| pub(super) struct EnqueuedOrder { | ||
| pub para_id: ParaId, | ||
| } | ||
|
|
||
| // Looser encapsulation for tests | ||
| #[cfg(test)] | ||
| #[derive(Encode, Decode, TypeInfo, Debug, PartialEq)] | ||
| pub(crate) struct EnqueuedOrder { | ||
| pub para_id: ParaId, | ||
| } | ||
|
|
||
| impl EnqueuedOrder { | ||
| pub fn new(para_id: ParaId) -> Self { | ||
| Self { para_id } | ||
|
|
@@ -471,6 +486,7 @@ where | |
| /// Errors: | ||
| /// - `InvalidParaId` | ||
| /// - `QueueFull` | ||
| #[cfg(not(test))] | ||
| fn add_on_demand_order( | ||
| order: EnqueuedOrder, | ||
| location: QueuePushDirection, | ||
|
|
@@ -491,6 +507,27 @@ where | |
| }) | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| pub fn add_on_demand_order( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same. |
||
| order: EnqueuedOrder, | ||
| location: QueuePushDirection, | ||
| ) -> Result<(), DispatchError> { | ||
| // Only parathreads are valid paraids for on the go parachains. | ||
| ensure!(<paras::Pallet<T>>::is_parathread(order.para_id), Error::<T>::InvalidParaId); | ||
|
|
||
| let config = <configuration::Pallet<T>>::config(); | ||
|
|
||
| OnDemandQueue::<T>::try_mutate(|queue| { | ||
| // Abort transaction if queue is too large | ||
| ensure!(Self::queue_size() < config.on_demand_queue_max_size, Error::<T>::QueueFull); | ||
| match location { | ||
| QueuePushDirection::Back => queue.push_back(order), | ||
| QueuePushDirection::Front => queue.push_front(order), | ||
| }; | ||
| Ok(()) | ||
| }) | ||
| } | ||
|
|
||
| /// Get the size of the on demand queue. | ||
| /// | ||
| /// Returns: | ||
|
|
@@ -511,7 +548,7 @@ where | |
|
|
||
| /// Getter for the order queue. | ||
| #[cfg(test)] | ||
| fn get_queue() -> VecDeque<EnqueuedOrder> { | ||
| pub fn get_queue() -> VecDeque<EnqueuedOrder> { | ||
| OnDemandQueue::<T>::get() | ||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.