Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden committed Sep 27, 2024
1 parent 6eb96b5 commit 4902e87
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 12 deletions.
5 changes: 5 additions & 0 deletions control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,8 @@ subxt metadata --url ws://127.0.0.1:8000 -f bytes -o runtimes/polkadot/polkadot-
subxt metadata --url ws://127.0.0.1:8001 -f bytes -o runtimes/bridge-hub-polkadot/bridge-hub-metadata.bin
subxt metadata --url ws://127.0.0.1:8002 -f bytes -o runtimes/asset-hub-polkadot/asset-hub-metadata.bin
```

Update runtime.rs:
```shell
subxt codegen --url wss://paseo-rpc.dwellir.com > runtimes/paseo/src/runtime.rs
```
7 changes: 3 additions & 4 deletions control/preimage/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::bridge_hub_runtime::runtime_types::{
};
use crate::bridge_hub_runtime::RuntimeCall as BridgeHubRuntimeCall;

#[cfg(feature = "polkadot")]
#[cfg(any(feature = "polkadot", feature = "paseo"))]
pub mod asset_hub_polkadot_types {
pub use crate::asset_hub_runtime::runtime_types::staging_xcm::v3::multilocation::MultiLocation;
pub use crate::asset_hub_runtime::runtime_types::xcm::v3::{
Expand Down Expand Up @@ -262,11 +262,10 @@ pub fn set_gateway_address(params: &GatewayAddressArgs) -> BridgeHubRuntimeCall
pub fn make_asset_sufficient(params: &UpdateAssetArgs) -> AssetHubRuntimeCall {
use subxt::utils::AccountId32;
let chain_id = crate::bridge_hub_runtime::CHAIN_ID;
#[cfg(feature = "polkadot")]
#[cfg(any(feature = "polkadot", feature = "paseo"))]
use asset_hub_polkadot_types::*;
#[cfg(feature = "westend")]
use asset_hub_westend_types::*;

let asset_id = get_asset_id(chain_id, params.contract_id.into_array().into());
let owner = GlobalConsensusEthereumConvertsFor::<[u8; 32]>::from_chain_id(&chain_id);
AssetHubRuntimeCall::ForeignAssets(pallet_assets::pallet::Call2::force_asset_status {
Expand All @@ -283,7 +282,7 @@ pub fn make_asset_sufficient(params: &UpdateAssetArgs) -> AssetHubRuntimeCall {

pub fn force_set_metadata(params: &UpdateAssetArgs) -> AssetHubRuntimeCall {
let chain_id = crate::bridge_hub_runtime::CHAIN_ID;
#[cfg(feature = "polkadot")]
#[cfg(any(feature = "polkadot", feature = "paseo"))]
use asset_hub_polkadot_types::*;
#[cfg(feature = "westend")]
use asset_hub_westend_types::*;
Expand Down
15 changes: 10 additions & 5 deletions control/preimage/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use crate::Context;

use crate::bridge_hub_runtime::{self, RuntimeCall as BridgeHubRuntimeCall};

#[cfg(any(feature = "polkadot", feature = "paseo"))]
#[cfg(feature = "polkadot")]
use crate::relay_runtime::runtime_types::xcm::v2::OriginKind;
#[cfg(feature = "westend")]
#[cfg(any(feature = "westend", feature = "paseo"))]
use crate::relay_runtime::runtime_types::xcm::v3::OriginKind;

use crate::relay_runtime::runtime_types::{
Expand Down Expand Up @@ -178,9 +178,14 @@ pub fn utility_force_batch(calls: Vec<RelayRuntimeCall>) -> RelayRuntimeCall {
}

pub fn sudo(call: Box<RelayRuntimeCall>) -> RelayRuntimeCall {
RelayRuntimeCall::Sudo(
crate::relay_runtime::api::runtime_types::pallet_sudo::pallet::Call::sudo { call },
)
#[cfg(feature = "paseo")]
return RelayRuntimeCall::Sudo(
crate::relay_runtime::runtime_types::pallet_sudo::pallet::Call::sudo { call },
);
#[cfg(not(feature = "paseo"))]
return RelayRuntimeCall::Utility(
crate::relay_runtime::runtime_types::pallet_utility::pallet::Call::batch_all { calls },
);
}

pub fn force_xcm_version() -> AssetHubRuntimeCall {
Expand Down
4 changes: 2 additions & 2 deletions control/preimage/src/relay_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ pub use westend_runtime::runtime_types::westend_runtime::RuntimeCall;
pub use westend_runtime::*;

#[cfg(feature = "paseo")]
pub use paseo_runtime::runtime_types::paseo_runtime::RuntimeCall;
pub use paseo_runtime::runtime::api::runtime_types::paseo_runtime::RuntimeCall;
#[cfg(feature = "paseo")]
pub use paseo_runtime::*;
pub use paseo_runtime::runtime::api::*;
Binary file modified control/runtimes/asset-hub-paseo/asset-hub-metadata.bin
Binary file not shown.
Binary file modified control/runtimes/bridge-hub-paseo/bridge-hub-metadata.bin
Binary file not shown.
Binary file modified control/runtimes/paseo/polkadot-metadata.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion control/runtimes/paseo/src/runtime.rs

Large diffs are not rendered by default.

0 comments on commit 4902e87

Please sign in to comment.