Skip to content

Commit

Permalink
xcm api implemented in fake_runtime_apis
Browse files Browse the repository at this point in the history
  • Loading branch information
ipapandinas committed Sep 7, 2024
1 parent 283eb91 commit 8413960
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions bin/collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ polkadot-parachain = { workspace = true, features = ["std"] }
polkadot-primitives = { workspace = true, features = ["std"] }
polkadot-service = { workspace = true }

# xcm dependencies
xcm = { workspace = true }
xcm-fee-payment-runtime-api = { workspace = true }

# benchmark dependencies
frame-benchmarking = { workspace = true, features = ["std"] }
frame-benchmarking-cli = { workspace = true }
Expand Down
33 changes: 33 additions & 0 deletions bin/collator/src/parachain/fake_runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ use sp_runtime::{
ApplyExtrinsicResult, Permill,
};
use sp_version::RuntimeVersion;
use xcm::{VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm};
use xcm_fee_payment_runtime_api::{
dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects},
fees::Error as XcmPaymentApiError,
};

pub struct Runtime;

Expand Down Expand Up @@ -137,6 +142,34 @@ impl_runtime_apis! {
}
}

impl xcm_fee_payment_runtime_api::fees::XcmPaymentApi<Block> for Runtime {
fn query_acceptable_payment_assets(_: xcm::Version) -> Result<Vec<VersionedAssetId>, XcmPaymentApiError> {
unimplemented!()
}

fn query_weight_to_asset_fee(_: Weight, _: VersionedAssetId) -> Result<u128, XcmPaymentApiError> {
unimplemented!()
}

fn query_xcm_weight(_: VersionedXcm<()>) -> Result<Weight, XcmPaymentApiError> {
unimplemented!()
}

fn query_delivery_fees(_: VersionedLocation, _: VersionedXcm<()>) -> Result<VersionedAssets, XcmPaymentApiError> {
unimplemented!()
}
}

impl xcm_fee_payment_runtime_api::dry_run::DryRunApi<Block, (), (), ()> for Runtime {
fn dry_run_call(_: (), _: ()) -> Result<CallDryRunEffects<()>, XcmDryRunApiError> {
unimplemented!()
}

fn dry_run_xcm(_: VersionedLocation, _: VersionedXcm<()>) -> Result<XcmDryRunEffects<()>, XcmDryRunApiError> {
unimplemented!()
}
}

impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {
fn chain_id() -> u64 {
unimplemented!()
Expand Down

0 comments on commit 8413960

Please sign in to comment.