Skip to content

Commit

Permalink
remove xcm
Browse files Browse the repository at this point in the history
Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>
  • Loading branch information
zqhxuyuan committed May 29, 2023
1 parent 3260c9a commit af453d2
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 587 deletions.
144 changes: 0 additions & 144 deletions Cargo.lock

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

14 changes: 1 addition & 13 deletions zenlink-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,13 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false }
pallet-balances = { git = 'https://github.com/paritytech/substrate', default-features = false, branch = 'polkadot-v0.9.37' }

# Polkadot
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37", default-features = false }
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37", default-features = false }

# Cumulus
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.37" }

orml-traits = { git = "https://github.com/manta-network/open-runtime-module-library", branch = "polkadot-v0.9.37", default-features = false }
orml-tokens = { git = "https://github.com/manta-network/open-runtime-module-library", branch = "polkadot-v0.9.37", default-features = false }

[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" }
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" }

orml-tokens = { git = "https://github.com/manta-network/open-runtime-module-library", branch = "polkadot-v0.9.37" }

[features]
default = ["std"]
Expand All @@ -55,12 +48,7 @@ std = [
"sp-arithmetic/std",
"pallet-balances/std",

"xcm/std",
"xcm-executor/std",
"cumulus-primitives-core/std",

"orml-traits/std",
"orml-tokens/std",
]

runtime-benchmarks = [
Expand Down
2 changes: 0 additions & 2 deletions zenlink-protocol/rpc/runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ sp_api::decl_runtime_apis! {

fn get_balance(asset_id: AssetId, owner: AccountId) -> AssetBalance;

fn get_sovereigns_info(asset_id: AssetId) -> Vec<(u32, AccountId, AssetBalance)>;

fn get_pair_by_asset_id(
asset_0: AssetId,
asset_1: AssetId
Expand Down
27 changes: 0 additions & 27 deletions zenlink-protocol/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ pub trait ZenlinkProtocolApi<BlockHash, AccountId, AssetId> {
at: Option<BlockHash>,
) -> RpcResult<NumberOrHex>;

#[method(name = "zenlinkProtocol_getSovereignsInfo")]
fn get_sovereigns_info(
&self,
asset_id: AssetId,
at: Option<BlockHash>,
) -> RpcResult<Vec<(u32, AccountId, NumberOrHex)>>;

#[method(name = "zenlinkProtocol_getPairByAssetId")]
fn get_pair_by_asset_id(
&self,
Expand Down Expand Up @@ -176,26 +169,6 @@ where
.map_err(runtime_error_into_rpc_err)
}

fn get_sovereigns_info(
&self,
asset_id: AssetId,
at: Option<<Block as BlockT>::Hash>,
) -> RpcResult<Vec<(u32, AccountId, NumberOrHex)>> {
let api = self.client.runtime_api();
let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash));

api.get_sovereigns_info(&at, asset_id)
.map(|infos| {
infos
.into_iter()
.map(|(para_id, account, asset_balance)| {
(para_id, account, asset_balance.into())
})
.collect::<Vec<_>>()
})
.map_err(runtime_error_into_rpc_err)
}

fn get_pair_by_asset_id(
&self,
asset_0: AssetId,
Expand Down
8 changes: 2 additions & 6 deletions zenlink-protocol/src/fee/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use sp_runtime::{

use crate as pallet_zenlink;
pub use crate::{
AssetBalance, AssetId, AssetIdConverter, Config, LocalAssetHandler, MultiAssetsHandler,
PairLpGenerate, Pallet, ParaId, ZenlinkMultiAssets, LIQUIDITY, LOCAL, NATIVE, RESERVED,
AssetBalance, AssetId, Config, LocalAssetHandler, MultiAssetsHandler,
PairLpGenerate, Pallet, ZenlinkMultiAssets, LIQUIDITY, LOCAL, NATIVE, RESERVED,
};

type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
Expand Down Expand Up @@ -147,11 +147,7 @@ impl Config for Test {
type PalletId = ZenlinkPalletId;
type AssetId = AssetId;
type LpGenerate = PairLpGenerate<Self>;
type TargetChains = ();
type SelfParaId = ();
type XcmExecutor = ();
type AccountIdConverter = ();
type AssetIdConverter = AssetIdConverter;
type WeightInfo = ();
}

Expand Down
6 changes: 1 addition & 5 deletions zenlink-protocol/src/foreign/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use sp_runtime::{

use crate as pallet_zenlink;
pub use crate::{
AssetId, AssetIdConverter, Config, MultiAssetsHandler, PairLpGenerate, Pallet, ParaId,
AssetId, Config, MultiAssetsHandler, PairLpGenerate, Pallet,
ZenlinkMultiAssets, LIQUIDITY, LOCAL, NATIVE, RESERVED,
};

Expand Down Expand Up @@ -83,11 +83,7 @@ impl Config for Test {
type PalletId = ZenlinkPalletId;
type AssetId = AssetId;
type LpGenerate = PairLpGenerate<Self>;
type TargetChains = ();
type SelfParaId = ();
type XcmExecutor = ();
type AccountIdConverter = ();
type AssetIdConverter = AssetIdConverter;
type WeightInfo = ();
}

Expand Down
Loading

0 comments on commit af453d2

Please sign in to comment.