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
e192b764
Unverified
Commit
e192b764
authored
8 months ago
by
Branislav Kontur
Committed by
GitHub
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Avoid using `xcm::v4` and use latest instead for AssetHub benchmarks (#4567)
parent
f469fbfb
Branches
gh-readonly-queue/master/pr-4567-f469fbfb0a44c4e223488b07ec641ca02b2fb8f1
Branches containing commit
No related merge requests found
Pipeline
#477647
waiting for manual action with stages
in 1 hour, 9 minutes, and 13 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
+8
-8
8 additions, 8 deletions
...us/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
+8
-8
8 additions, 8 deletions
...s/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
with
16 additions
and
16 deletions
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
+
8
−
8
View file @
e192b764
...
@@ -93,8 +93,8 @@ use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
...
@@ -93,8 +93,8 @@ use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use
polkadot_runtime_common
::{
BlockHashCount
,
SlowAdjustingFeeUpdate
};
use
polkadot_runtime_common
::{
BlockHashCount
,
SlowAdjustingFeeUpdate
};
#[cfg(feature
=
"runtime-benchmarks"
)]
#[cfg(feature
=
"runtime-benchmarks"
)]
use
xcm
::
latest
::
prelude
::{
use
xcm
::
latest
::
prelude
::{
Asset
,
Fungible
,
Here
,
InteriorLocation
,
Junction
,
Junction
::
*
,
Location
,
NetworkId
,
Asset
,
Assets
as
XcmAssets
,
Fungible
,
Here
,
InteriorLocation
,
Junction
,
Junction
::
*
,
Location
,
NonFungible
,
Parent
,
ParentThen
,
Response
,
XCM_VERSION
,
NetworkId
,
NonFungible
,
Parent
,
ParentThen
,
Response
,
XCM_VERSION
,
};
};
use
xcm
::{
use
xcm
::{
latest
::
prelude
::{
AssetId
,
BodyId
},
latest
::
prelude
::{
AssetId
,
BodyId
},
...
@@ -1535,7 +1535,7 @@ impl_runtime_apis! {
...
@@ -1535,7 +1535,7 @@ impl_runtime_apis! {
}
}
fn
set_up_complex_asset_transfer
(
fn
set_up_complex_asset_transfer
(
)
->
Option
<
(
x
cm
::
v4
::
Assets
,
u32
,
Location
,
Box
<
dyn
FnOnce
()
>
)
>
{
)
->
Option
<
(
X
cmAssets
,
u32
,
Location
,
Box
<
dyn
FnOnce
()
>
)
>
{
// Transfer to Relay some local AH asset (local-reserve-transfer) while paying
// Transfer to Relay some local AH asset (local-reserve-transfer) while paying
// fees using teleported native token.
// fees using teleported native token.
// (We don't care that Relay doesn't accept incoming unknown AH local asset)
// (We don't care that Relay doesn't accept incoming unknown AH local asset)
...
@@ -1566,7 +1566,7 @@ impl_runtime_apis! {
...
@@ -1566,7 +1566,7 @@ impl_runtime_apis! {
);
);
let
transfer_asset
:
Asset
=
(
asset_location
,
asset_amount
)
.into
();
let
transfer_asset
:
Asset
=
(
asset_location
,
asset_amount
)
.into
();
let
assets
:
x
cm
::
v4
::
Assets
=
vec!
[
fee_asset
.clone
(),
transfer_asset
]
.into
();
let
assets
:
X
cmAssets
=
vec!
[
fee_asset
.clone
(),
transfer_asset
]
.into
();
let
fee_index
=
if
assets
.get
(
0
)
.unwrap
()
.eq
(
&
fee_asset
)
{
0
}
else
{
1
};
let
fee_index
=
if
assets
.get
(
0
)
.unwrap
()
.eq
(
&
fee_asset
)
{
0
}
else
{
1
};
// verify transferred successfully
// verify transferred successfully
...
@@ -1634,7 +1634,7 @@ impl_runtime_apis! {
...
@@ -1634,7 +1634,7 @@ impl_runtime_apis! {
fn
valid_destination
()
->
Result
<
Location
,
BenchmarkError
>
{
fn
valid_destination
()
->
Result
<
Location
,
BenchmarkError
>
{
Ok
(
TokenLocation
::
get
())
Ok
(
TokenLocation
::
get
())
}
}
fn
worst_case_holding
(
depositable_count
:
u32
)
->
x
cm
::
v4
::
Assets
{
fn
worst_case_holding
(
depositable_count
:
u32
)
->
X
cmAssets
{
// A mix of fungible, non-fungible, and concrete assets.
// A mix of fungible, non-fungible, and concrete assets.
let
holding_non_fungibles
=
MaxAssetsIntoHolding
::
get
()
/
2
-
depositable_count
;
let
holding_non_fungibles
=
MaxAssetsIntoHolding
::
get
()
/
2
-
depositable_count
;
let
holding_fungibles
=
holding_non_fungibles
.saturating_sub
(
2
);
// -2 for two `iter::once` bellow
let
holding_fungibles
=
holding_non_fungibles
.saturating_sub
(
2
);
// -2 for two `iter::once` bellow
...
@@ -1695,7 +1695,7 @@ impl_runtime_apis! {
...
@@ -1695,7 +1695,7 @@ impl_runtime_apis! {
(
0u64
,
Response
::
Version
(
Default
::
default
()))
(
0u64
,
Response
::
Version
(
Default
::
default
()))
}
}
fn
worst_case_asset_exchange
()
->
Result
<
(
x
cm
::
v4
::
Assets
,
x
cm
::
v4
::
Assets
),
BenchmarkError
>
{
fn
worst_case_asset_exchange
()
->
Result
<
(
X
cmAssets
,
X
cmAssets
),
BenchmarkError
>
{
Err
(
BenchmarkError
::
Skip
)
Err
(
BenchmarkError
::
Skip
)
}
}
...
@@ -1714,9 +1714,9 @@ impl_runtime_apis! {
...
@@ -1714,9 +1714,9 @@ impl_runtime_apis! {
Ok
(
TokenLocation
::
get
())
Ok
(
TokenLocation
::
get
())
}
}
fn
claimable_asset
()
->
Result
<
(
Location
,
Location
,
x
cm
::
v4
::
Assets
),
BenchmarkError
>
{
fn
claimable_asset
()
->
Result
<
(
Location
,
Location
,
X
cmAssets
),
BenchmarkError
>
{
let
origin
=
TokenLocation
::
get
();
let
origin
=
TokenLocation
::
get
();
let
assets
:
x
cm
::
v4
::
Assets
=
(
TokenLocation
::
get
(),
1_000
*
UNITS
)
.into
();
let
assets
:
X
cmAssets
=
(
TokenLocation
::
get
(),
1_000
*
UNITS
)
.into
();
let
ticket
=
Location
{
parents
:
0
,
interior
:
Here
};
let
ticket
=
Location
{
parents
:
0
,
interior
:
Here
};
Ok
((
origin
,
ticket
,
assets
))
Ok
((
origin
,
ticket
,
assets
))
}
}
...
...
This diff is collapsed.
Click to expand it.
cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
+
8
−
8
View file @
e192b764
...
@@ -95,8 +95,8 @@ use xcm::latest::prelude::AssetId;
...
@@ -95,8 +95,8 @@ use xcm::latest::prelude::AssetId;
#[cfg(feature
=
"runtime-benchmarks"
)]
#[cfg(feature
=
"runtime-benchmarks"
)]
use
xcm
::
latest
::
prelude
::{
use
xcm
::
latest
::
prelude
::{
Asset
,
Fungible
,
Here
,
InteriorLocation
,
Junction
,
Junction
::
*
,
Location
,
NetworkId
,
Asset
,
Assets
as
XcmAssets
,
Fungible
,
Here
,
InteriorLocation
,
Junction
,
Junction
::
*
,
Location
,
NonFungible
,
Parent
,
ParentThen
,
Response
,
XCM_VERSION
,
NetworkId
,
NonFungible
,
Parent
,
ParentThen
,
Response
,
XCM_VERSION
,
};
};
use
xcm_fee_payment_runtime_api
::{
use
xcm_fee_payment_runtime_api
::{
...
@@ -1629,7 +1629,7 @@ impl_runtime_apis! {
...
@@ -1629,7 +1629,7 @@ impl_runtime_apis! {
}
}
fn
set_up_complex_asset_transfer
(
fn
set_up_complex_asset_transfer
(
)
->
Option
<
(
x
cm
::
v4
::
Assets
,
u32
,
Location
,
Box
<
dyn
FnOnce
()
>
)
>
{
)
->
Option
<
(
X
cmAssets
,
u32
,
Location
,
Box
<
dyn
FnOnce
()
>
)
>
{
// Transfer to Relay some local AH asset (local-reserve-transfer) while paying
// Transfer to Relay some local AH asset (local-reserve-transfer) while paying
// fees using teleported native token.
// fees using teleported native token.
// (We don't care that Relay doesn't accept incoming unknown AH local asset)
// (We don't care that Relay doesn't accept incoming unknown AH local asset)
...
@@ -1660,7 +1660,7 @@ impl_runtime_apis! {
...
@@ -1660,7 +1660,7 @@ impl_runtime_apis! {
);
);
let
transfer_asset
:
Asset
=
(
asset_location
,
asset_amount
)
.into
();
let
transfer_asset
:
Asset
=
(
asset_location
,
asset_amount
)
.into
();
let
assets
:
x
cm
::
v4
::
Assets
=
vec!
[
fee_asset
.clone
(),
transfer_asset
]
.into
();
let
assets
:
X
cmAssets
=
vec!
[
fee_asset
.clone
(),
transfer_asset
]
.into
();
let
fee_index
=
if
assets
.get
(
0
)
.unwrap
()
.eq
(
&
fee_asset
)
{
0
}
else
{
1
};
let
fee_index
=
if
assets
.get
(
0
)
.unwrap
()
.eq
(
&
fee_asset
)
{
0
}
else
{
1
};
// verify transferred successfully
// verify transferred successfully
...
@@ -1733,7 +1733,7 @@ impl_runtime_apis! {
...
@@ -1733,7 +1733,7 @@ impl_runtime_apis! {
fn
valid_destination
()
->
Result
<
Location
,
BenchmarkError
>
{
fn
valid_destination
()
->
Result
<
Location
,
BenchmarkError
>
{
Ok
(
WestendLocation
::
get
())
Ok
(
WestendLocation
::
get
())
}
}
fn
worst_case_holding
(
depositable_count
:
u32
)
->
x
cm
::
v4
::
Assets
{
fn
worst_case_holding
(
depositable_count
:
u32
)
->
X
cmAssets
{
// A mix of fungible, non-fungible, and concrete assets.
// A mix of fungible, non-fungible, and concrete assets.
let
holding_non_fungibles
=
MaxAssetsIntoHolding
::
get
()
/
2
-
depositable_count
;
let
holding_non_fungibles
=
MaxAssetsIntoHolding
::
get
()
/
2
-
depositable_count
;
let
holding_fungibles
=
holding_non_fungibles
-
2
;
// -2 for two `iter::once` bellow
let
holding_fungibles
=
holding_non_fungibles
-
2
;
// -2 for two `iter::once` bellow
...
@@ -1794,7 +1794,7 @@ impl_runtime_apis! {
...
@@ -1794,7 +1794,7 @@ impl_runtime_apis! {
(
0u64
,
Response
::
Version
(
Default
::
default
()))
(
0u64
,
Response
::
Version
(
Default
::
default
()))
}
}
fn
worst_case_asset_exchange
()
->
Result
<
(
x
cm
::
v4
::
Assets
,
x
cm
::
v4
::
Assets
),
BenchmarkError
>
{
fn
worst_case_asset_exchange
()
->
Result
<
(
X
cmAssets
,
X
cmAssets
),
BenchmarkError
>
{
Err
(
BenchmarkError
::
Skip
)
Err
(
BenchmarkError
::
Skip
)
}
}
...
@@ -1813,9 +1813,9 @@ impl_runtime_apis! {
...
@@ -1813,9 +1813,9 @@ impl_runtime_apis! {
Ok
(
WestendLocation
::
get
())
Ok
(
WestendLocation
::
get
())
}
}
fn
claimable_asset
()
->
Result
<
(
Location
,
Location
,
x
cm
::
v4
::
Assets
),
BenchmarkError
>
{
fn
claimable_asset
()
->
Result
<
(
Location
,
Location
,
X
cmAssets
),
BenchmarkError
>
{
let
origin
=
WestendLocation
::
get
();
let
origin
=
WestendLocation
::
get
();
let
assets
:
x
cm
::
v4
::
Assets
=
(
AssetId
(
WestendLocation
::
get
()),
1_000
*
UNITS
)
.into
();
let
assets
:
X
cmAssets
=
(
AssetId
(
WestendLocation
::
get
()),
1_000
*
UNITS
)
.into
();
let
ticket
=
Location
{
parents
:
0
,
interior
:
Here
};
let
ticket
=
Location
{
parents
:
0
,
interior
:
Here
};
Ok
((
origin
,
ticket
,
assets
))
Ok
((
origin
,
ticket
,
assets
))
}
}
...
...
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