Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New currency type #342

Merged
merged 9 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 107 additions & 45 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.145", features = ["derive"] }
jsonrpsee = { version = "0.16.2", features = ["server"] }

module-issue-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "58983d2695c309665c9c017a022436aaee088f3d"}
module-oracle-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "58983d2695c309665c9c017a022436aaee088f3d"}
module-redeem-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "58983d2695c309665c9c017a022436aaee088f3d"}
module-replace-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "58983d2695c309665c9c017a022436aaee088f3d"}
module-vault-registry-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "58983d2695c309665c9c017a022436aaee088f3d"}
module-issue-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "d05b0015d15ca39cc780889bcc095335e9862a36"}
module-oracle-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "d05b0015d15ca39cc780889bcc095335e9862a36"}
module-redeem-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "d05b0015d15ca39cc780889bcc095335e9862a36"}
module-replace-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "d05b0015d15ca39cc780889bcc095335e9862a36"}
module-vault-registry-rpc = { git = "https://github.com/pendulum-chain/spacewalk", rev = "d05b0015d15ca39cc780889bcc095335e9862a36"}

spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", rev = "58983d2695c309665c9c017a022436aaee088f3d"}
spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", rev = "d05b0015d15ca39cc780889bcc095335e9862a36"}

# Local
amplitude-runtime = {path = "../runtime/amplitude"}
Expand Down
42 changes: 22 additions & 20 deletions runtime/amplitude/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,27 @@ smallvec = "1.9.0"
runtime-common = { path = "../common", default-features = false }

# Custom libraries for Spacewalk
clients-info = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
currency = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
security = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
staking = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
oracle = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
stellar-relay = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
reward = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
fee = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
vault-registry = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
redeem = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
issue = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
nomination = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
replace = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
module-issue-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
module-oracle-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
module-redeem-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
module-replace-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
module-vault-registry-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
clients-info = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
currency = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
security = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
staking = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
oracle = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
stellar-relay = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
fee = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
vault-registry = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
redeem = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
issue = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
nomination = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
replace = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
module-issue-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
module-oracle-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
module-redeem-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
module-replace-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
module-vault-registry-rpc-runtime-api = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }
pooled-rewards = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36"}
reward-distribution = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36"}


# Substrate
frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.40" }
Expand Down Expand Up @@ -179,6 +181,7 @@ std = [
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"pallet-treasury/std",
"pooled-rewards/std",
"pallet-utility/std",
"pallet-vesting/std",
"pallet-xcm/std",
Expand Down Expand Up @@ -212,7 +215,6 @@ std = [
"staking/std",
"oracle/std",
"stellar-relay/std",
"reward/std",
"fee/std",
"vault-registry/std",
"redeem/std",
Expand Down
49 changes: 40 additions & 9 deletions runtime/amplitude/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ impl Contains<RuntimeCall> for BaseFilter {
RuntimeCall::VaultRegistry(_) |
RuntimeCall::VaultRewards(_) |
RuntimeCall::Farming(_) |
RuntimeCall::AssetRegistry(_) => true,
RuntimeCall::AssetRegistry(_) |
RuntimeCall::RewardDistribution(_) => true,
// All pallets are allowed, but exhaustive match is defensive
// in the case of adding new pallets.
}
Expand Down Expand Up @@ -1079,12 +1080,17 @@ impl security::Config for Runtime {
type WeightInfo = security::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const MaxRewardCurrencies: u32= 10;
}

impl staking::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SignedInner = SignedInner;
type SignedFixedPoint = SignedFixedPoint;
type GetNativeCurrencyId = NativeCurrencyId;
type CurrencyId = CurrencyId;
type MaxRewardCurrencies = MaxRewardCurrencies;
}

#[cfg(feature = "runtime-benchmarks")]
Expand Down Expand Up @@ -1131,13 +1137,6 @@ impl stellar_relay::Config for Runtime {
type WeightInfo = stellar_relay::SubstrateWeight<Runtime>;
}

impl reward::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SignedFixedPoint = SignedFixedPoint;
type RewardId = VaultId;
type CurrencyId = CurrencyId;
type GetNativeCurrencyId = NativeCurrencyId;
}
parameter_types! {
pub const FeePalletId: PalletId = PalletId(*b"mod/fees");
pub const VaultRegistryPalletId: PalletId = PalletId(*b"mod/vreg");
Expand All @@ -1155,6 +1154,7 @@ impl fee::Config for Runtime {
type VaultStaking = VaultStaking;
type OnSweep = currency::SweepFunds<Runtime, FeeAccount>;
type MaxExpectedValue = MaxExpectedValue;
type RewardDistribution = RewardDistribution;
}

impl vault_registry::Config for Runtime {
Expand Down Expand Up @@ -1200,6 +1200,36 @@ impl clients_info::Config for Runtime {
type MaxNameLength = ConstU32<255>;
type MaxUriLength = ConstU32<255>;
}
// Choice of parameters: Perquintill::from_parts(37567400000000000u64) represents a value of
// 0.0375674 = 37567400000000000 / 1×10¹⁸
// The decay interval 216000 equates to a month when considering 1 block every 12 seconds
parameter_types! {
pub const DecayRate: Perquintill = Perquintill::from_parts(37567400000000000u64);
pub const MaxCurrencies: u32 = 10;
}

impl reward_distribution::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = reward_distribution::SubstrateWeight<Runtime>;
type Balance = Balance;
type DecayInterval = ConstU32<216_000>;
type DecayRate = DecayRate;
type VaultRewards = VaultRewards;
type MaxCurrencies = MaxCurrencies;
type OracleApi = Oracle;
type Balances = Balances;
type VaultStaking = VaultStaking;
type FeePalletId = FeePalletId;
}

impl pooled_rewards::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SignedFixedPoint = SignedFixedPoint;
type PoolId = CurrencyId;
type PoolRewardsCurrencyId = CurrencyId;
type StakeId = VaultId;
type MaxRewardCurrencies = MaxRewardCurrencies;
}

parameter_types! {
pub const FarmingKeeperPalletId: PalletId = PalletId(*b"am/fmkpr");
Expand Down Expand Up @@ -1287,9 +1317,10 @@ construct_runtime!(
Security: security::{Pallet, Call, Config, Storage, Event<T>} = 67,
StellarRelay: stellar_relay::{Pallet, Call, Config<T>, Storage, Event<T>} = 68,
VaultRegistry: vault_registry::{Pallet, Call, Config<T>, Storage, Event<T>, ValidateUnsigned} = 69,
VaultRewards: reward::{Pallet, Call, Storage, Event<T>} = 70,
VaultRewards: pooled_rewards::{Pallet, Call, Storage, Event<T>} = 70,
VaultStaking: staking::{Pallet, Storage, Event<T>} = 71,
ClientsInfo: clients_info::{Pallet, Call, Storage, Event<T>} = 72,
RewardDistribution: reward_distribution::{Pallet, Call, Storage, Event<T>} = 73,

Farming: farming::{Pallet, Call, Storage, Event<T>} = 90,

Expand Down
9 changes: 5 additions & 4 deletions runtime/amplitude/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use orml_traits::{
use pallet_xcm::XcmPassthrough;
use polkadot_parachain::primitives::Sibling;
use polkadot_runtime_common::impls::ToAuthor;
use runtime_common::parachains::kusama::asset_hub;
use sp_runtime::traits::Convert;
use xcm::latest::{prelude::*, Weight as XCMWeight};
use xcm_builder::{
Expand All @@ -27,7 +28,6 @@ use xcm_executor::{
traits::{JustTry, ShouldExecute},
XcmExecutor,
};
use runtime_common::parachains::kusama::asset_hub;

const XCM_ASSET_RELAY_KSM: u8 = 0;
const XCM_ASSET_ASSETHUB_USDT: u8 = 1;
Expand Down Expand Up @@ -83,15 +83,16 @@ impl Convert<CurrencyId, Option<MultiLocation>> for CurrencyIdConvert {
impl Convert<MultiLocation, Option<CurrencyId>> for CurrencyIdConvert {
fn convert(location: MultiLocation) -> Option<CurrencyId> {
match location {
MultiLocation { parents: 1, interior: Here } => Some(CurrencyId::XCM(XCM_ASSET_RELAY_KSM)),
MultiLocation { parents: 1, interior: Here } =>
Some(CurrencyId::XCM(XCM_ASSET_RELAY_KSM)),
MultiLocation {
parents: 1,
interior:
X3(
Parachain(asset_hub::PARA_ID),
PalletInstance(asset_hub::ASSET_PALLET_ID),
GeneralIndex(asset_hub::USDT_ASSET_ID)
)
GeneralIndex(asset_hub::USDT_ASSET_ID),
),
} => Some(CurrencyId::XCM(XCM_ASSET_ASSETHUB_USDT)),
_ => None,
}
Expand Down
3 changes: 2 additions & 1 deletion runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-m
dia-oracle = { git = "https://github.com/pendulum-chain/oracle-pallet", default-features = false, branch = "polkadot-v0.9.40" }
zenlink-protocol = { git = "https://github.com/pendulum-chain/Zenlink-DEX-Module", default-features = false, branch = "polkadot-v0.9.40-protocol" }

spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "58983d2695c309665c9c017a022436aaee088f3d" }
spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36" }

[features]
default = [
Expand All @@ -50,6 +50,7 @@ std = [
"xcm/std",
"orml-traits/std",
"dia-oracle/std",
"orml-asset-registry/std",
"zenlink-protocol/std",
"spacewalk-primitives/std",
]
Expand Down
1 change: 0 additions & 1 deletion runtime/common/src/chain_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ impl From<dia::CoinInfo> for CoinInfo {
}
}


/// decode gets the slice from a Vec<u8> to decode it into its scale encoded type.
pub fn decode<T: Decode>(input: Vec<u8>) -> Result<T, codec::Error> {
let mut input = input.as_slice();
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/stellar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub const BRL_ISSUER: [u8; 32] = [
42, 28, 143, 202, 59, 197, 162, 94, 8, 62, 58,
];

// GA2MSSZKJOU6RNL3EJKH3S5TB5CDYTFQFWRYFGUJVIN5I6AOIRTLUHTO
// GA2MSSZKJOU6RNL3EJKH3S5TB5CDYTFQFWRYFGUJVIN5I6AOIRTLUHTO
pub const TZS_ISSUER: [u8; 32] = [
52, 201, 75, 42, 75, 169, 232, 181, 123, 34, 84, 125, 203, 179, 15, 68, 60, 76, 176, 45, 163,
130, 154, 137, 170, 27, 212, 120, 14, 68, 102, 186,
Expand Down
77 changes: 76 additions & 1 deletion runtime/common/src/zenlink.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::stellar::{BRL_ISSUER, TZS_ISSUER, USDC_ISSUER};
use spacewalk_primitives::{Asset, CurrencyId};

use zenlink_protocol::{LOCAL, NATIVE};
pub type ZenlinkAssetId = zenlink_protocol::AssetId;

Expand All @@ -10,6 +9,7 @@ fn discriminant(currency: &CurrencyId) -> u8 {
CurrencyId::XCM(_) => 1,
CurrencyId::Stellar(_) => 2,
CurrencyId::ZenlinkLPToken(_, _, _, _) => 3,
CurrencyId::Token(_) => 4,
}
}

Expand Down Expand Up @@ -56,6 +56,7 @@ pub fn zenlink_id_to_currency_id(

Ok(CurrencyId::ZenlinkLPToken(token1_id, token1_type, token2_id, token2_type))
},
(4, LOCAL) => Ok(CurrencyId::Token(symbol.into())),
_ => Err(()),
}
}
Expand Down Expand Up @@ -98,6 +99,16 @@ pub fn currency_id_to_zenlink_id(
((token2_type as u64) << 40);
Ok(ZenlinkAssetId { chain_id: parachain_id, asset_type: LOCAL, asset_index: index })
},
CurrencyId::Token(token_id) =>
if token_id < 256 {
Ok(ZenlinkAssetId {
chain_id: parachain_id,
asset_type: LOCAL,
asset_index: ((disc << 8) + token_id as u64) as u64,
})
} else {
return Err(())
},
}
}

Expand Down Expand Up @@ -235,6 +246,30 @@ mod zenlink_tests {
zenlink_id_to_currency_id(fake_zenlink_asset, 1000u32);
let expected_currency: CurrencyId = CurrencyId::ZenlinkLPToken(0, 2, 1, 2);
assert_eq!(currency, Ok(expected_currency));

// XCM(0) and Token(0) LP Token Zenlink index = 0x0000_0400_0100_0300
let xcm0_token0_lp_token_index = 0x0000_0400_0100_0300 as u64;
let fake_zenlink_asset = ZenlinkAssetId {
chain_id: 1000u32,
asset_type: LOCAL,
asset_index: xcm0_token0_lp_token_index,
};
let currency: Result<CurrencyId, _> =
zenlink_id_to_currency_id(fake_zenlink_asset, 1000u32);
let expected_currency: CurrencyId = CurrencyId::ZenlinkLPToken(0, 1, 0, 4);
assert_eq!(currency, Ok(expected_currency));

// XCM(5) and Token(58) LP Token Zenlink index = 0x0000_043A_0105_0300
let xcm0_token58_lp_token_index = 0x0000_043A_0105_0300 as u64;
let fake_zenlink_asset = ZenlinkAssetId {
chain_id: 1000u32,
asset_type: LOCAL,
asset_index: xcm0_token58_lp_token_index,
};
let currency: Result<CurrencyId, _> =
zenlink_id_to_currency_id(fake_zenlink_asset, 1000u32);
let expected_currency: CurrencyId = CurrencyId::ZenlinkLPToken(5, 1, 58, 4);
assert_eq!(currency, Ok(expected_currency));
}

#[test]
Expand Down Expand Up @@ -270,6 +305,13 @@ mod zenlink_tests {
ZenlinkAssetId { chain_id: 1000u32, asset_type: LOCAL, asset_index: 0x0100 as u64 };
assert_eq!(currency_id_to_zenlink_id(fake_currency_id, 1000), Ok(expected_zenlink_asset));
}
#[test]
fn convert_xcm_1_currency_to_zenlink_xcm() {
let fake_currency_id = CurrencyId::XCM(1);
let expected_zenlink_asset =
ZenlinkAssetId { chain_id: 1000u32, asset_type: LOCAL, asset_index: 0x0101 as u64 };
assert_eq!(currency_id_to_zenlink_id(fake_currency_id, 1000), Ok(expected_zenlink_asset));
}

#[test]
fn convert_stellar_currency_to_stellar_zenlink() {
Expand All @@ -288,4 +330,37 @@ mod zenlink_tests {
);
}
}

#[test]
fn convert_token_currency_to_zenlink_token() {
let fake_currency_id = CurrencyId::Token(0);
let expected_zenlink_asset =
ZenlinkAssetId { chain_id: 1000u32, asset_type: LOCAL, asset_index: 0x0400 as u64 };
assert_eq!(currency_id_to_zenlink_id(fake_currency_id, 1000), Ok(expected_zenlink_asset));
}

#[test]
fn convert_token_currency_to_zenlink_token_2() {
let fake_currency_id = CurrencyId::Token(6);
let expected_zenlink_asset =
ZenlinkAssetId { chain_id: 1000u32, asset_type: LOCAL, asset_index: 0x0406 as u64 };
assert_eq!(currency_id_to_zenlink_id(fake_currency_id, 1000), Ok(expected_zenlink_asset));
}

#[test]
fn convert_zenlink_lp_token_currency_to_zenlink_lp_representation() {
let fake_currency_id = CurrencyId::ZenlinkLPToken(158, 4, 101, 1);
let expected_zenlink_asset = ZenlinkAssetId {
chain_id: 1000u32,
asset_type: LOCAL,
asset_index: 0x0000_0165_049E_0300 as u64,
};
assert_eq!(currency_id_to_zenlink_id(fake_currency_id, 1000), Ok(expected_zenlink_asset));
}

#[test]
fn convert_token_currency_to_zenlink_token_error_out_of_range() {
let fake_currency_id = CurrencyId::Token(258);
assert_eq!(currency_id_to_zenlink_id(fake_currency_id, 1000),Err(()))
}
}
Loading