Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
a4c6067b
Unverified
Commit
a4c6067b
authored
11 months ago
by
Liam Aharon
Browse files
Options
Downloads
Patches
Plain Diff
clean up mock
parent
aef1b4b8
Branches
gh-readonly-queue/master/pr-4865-7df94a469e02e1d553bd4050b0e91870d6a4c31b
Branches containing commit
No related merge requests found
Pipeline
#461794
failed with stages
in 12 minutes and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/frame/asset-rewards/src/mock.rs
+3
-6
3 additions, 6 deletions
substrate/frame/asset-rewards/src/mock.rs
with
3 additions
and
6 deletions
substrate/frame/asset-rewards/src/mock.rs
+
3
−
6
View file @
a4c6067b
...
...
@@ -105,14 +105,12 @@ ord_parameter_types! {
pub
const
AssetConversionOrigin
:
u128
=
AccountIdConversion
::
<
u128
>
::
into_account_truncating
(
&
StakingRewardsPalletId
::
get
());
}
// Set account id 1 to the permissioned creator
pub
struct
MockPermissionedPoolCreator
;
impl
EnsureOrigin
<
RuntimeOrigin
>
for
MockPermissionedPoolCreator
{
type
Success
=
();
fn
try_origin
(
origin
:
RuntimeOrigin
,
// key: &RuntimeParametersKey,
)
->
Result
<
Self
::
Success
,
RuntimeOrigin
>
{
fn
try_origin
(
origin
:
RuntimeOrigin
)
->
Result
<
Self
::
Success
,
RuntimeOrigin
>
{
// Set account 1 to admin in tests
if
ensure_signed
(
origin
.clone
())
.map_or
(
false
,
|
acc
|
acc
==
1
)
{
return
Ok
(());
...
...
@@ -122,7 +120,7 @@ impl EnsureOrigin<RuntimeOrigin> for MockPermissionedPoolCreator {
}
#[cfg(feature
=
"runtime-benchmarks"
)]
fn
try_successful_origin
()
->
Result
<
O
,
()
>
{
fn
try_successful_origin
()
->
Result
<
RuntimeOrigin
,
()
>
{
todo!
()
}
}
...
...
@@ -135,7 +133,6 @@ impl Config for MockRuntime {
type
Balance
=
<
Self
as
pallet_balances
::
Config
>
::
Balance
;
type
Assets
=
NativeAndAssets
;
type
PalletId
=
StakingRewardsPalletId
;
// allow account id 1 to be permissioned creator
type
PermissionedPoolCreator
=
MockPermissionedPoolCreator
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment