Skip to content

Commit

Permalink
comment out zenlink
Browse files Browse the repository at this point in the history
Signed-off-by: Charles Ferrell <charlie@manta.network>
  • Loading branch information
ferrell-code committed Nov 29, 2023
1 parent 09b507f commit e1861be
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 84 deletions.
3 changes: 0 additions & 3 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions pallets/manta-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ rand_chacha = { version = "0.3.1", optional = true, default-features = false }
tempfile = { version = "3.3.0", optional = true, default-features = false }

# substrate dependencies
frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43", default-features = false, optional = true }
frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43", default-features = false }
scale-codec = { package = "parity-scale-codec", version = '3.4.0', default-features = false, features = ["derive", "max-encoded-len"] }
Expand Down Expand Up @@ -55,7 +54,6 @@ rpc = [
# Standard Library
std = [
"anyhow/std",
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"scale-codec/std",
Expand Down
13 changes: 6 additions & 7 deletions runtime/calamari/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ session-key-primitives = { path = '../../primitives/session-keys', default-featu
orml-traits = { git = 'https://github.com/manta-network/open-runtime-module-library.git', default-features = false, branch = "polkadot-v0.9.43" }
orml-xtokens = { git = 'https://github.com/manta-network/open-runtime-module-library.git', default-features = false, branch = "polkadot-v0.9.43" }

zenlink-protocol = { git = 'https://github.com/manta-network/Zenlink', branch = "polkadot-v0.9.43", default-features = false }
zenlink-protocol-runtime-api = { git = 'https://github.com/manta-network/Zenlink', branch = "polkadot-v0.9.43", default-features = false }
#zenlink-protocol = { git = 'https://github.com/manta-network/Zenlink', branch = "polkadot-v0.9.43", default-features = false }
#zenlink-protocol-runtime-api = { git = 'https://github.com/manta-network/Zenlink', branch = "polkadot-v0.9.43", default-features = false }

[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
Expand Down Expand Up @@ -178,7 +178,7 @@ runtime-benchmarks = [
'pallet-xcm-benchmarks/runtime-benchmarks',
'pallet-manta-sbt/runtime-benchmarks',
'pallet-name-service/runtime-benchmarks',
"zenlink-protocol/runtime-benchmarks",
#"zenlink-protocol/runtime-benchmarks",
'pallet-farming/runtime-benchmarks',
"pallet-conviction-voting/runtime-benchmarks",
"pallet-referenda/runtime-benchmarks",
Expand Down Expand Up @@ -222,7 +222,7 @@ try-runtime = [
'calamari-vesting/try-runtime',
'pallet-manta-sbt/try-runtime',
'pallet-name-service/try-runtime',
"zenlink-protocol/try-runtime",
#"zenlink-protocol/try-runtime",
'pallet-randomness/try-runtime',
'pallet-lottery/try-runtime',
"pallet-farming/try-runtime",
Expand Down Expand Up @@ -255,7 +255,6 @@ std = [
'frame-system-rpc-runtime-api/std',
'frame-try-runtime/std',
'frame-benchmarking/std',
'frame-system-benchmarking/std',
'pallet-authorship/std',
'pallet-balances/std',
'pallet-multisig/std',
Expand Down Expand Up @@ -304,8 +303,8 @@ std = [
'pallet-manta-sbt/std',
'pallet-name-service/std',
'manta-support/std',
"zenlink-protocol/std",
"zenlink-protocol-runtime-api/std",
#"zenlink-protocol/std",
#"zenlink-protocol-runtime-api/std",
"pallet-farming/std",
"pallet-farming-rpc-runtime-api/std",
"pallet-conviction-voting/std",
Expand Down
22 changes: 10 additions & 12 deletions runtime/calamari/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ use runtime_common::{
ExtrinsicBaseWeight,
};
use session_key_primitives::{AuraId, NimbusId, VrfId};
use zenlink_protocol::{AssetBalance, AssetId as ZenlinkAssetId, MultiAssetsHandler, PairInfo};
//use zenlink_protocol::{AssetBalance, AssetId as ZenlinkAssetId, MultiAssetsHandler, PairInfo};
use cumulus_primitives_core::relay_chain::MAX_POV_SIZE;

#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
Expand All @@ -89,7 +90,7 @@ pub mod migrations;
mod nimbus_session_adapter;
pub mod staking;
pub mod xcm_config;
pub mod zenlink;
//pub mod zenlink;

use currency::*;
use impls::DealWithFees;
Expand Down Expand Up @@ -168,7 +169,7 @@ pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(70);
/// We allow for 0.5 seconds of compute with a 6 second average block time.
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_ref_time(WEIGHT_PER_SECOND)
.saturating_div(2)
.set_proof_size(cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64);
.set_proof_size(MAX_POV_SIZE as u64);

parameter_types! {
pub const Version: RuntimeVersion = VERSION;
Expand Down Expand Up @@ -276,7 +277,6 @@ impl Contains<RuntimeCall> for BaseFilter {
| RuntimeCall::XcmpQueue(_) | RuntimeCall::DmpQueue(_) => false,

// Explicitly ALLOWED calls
| RuntimeCall::Authorship(_)
| RuntimeCall::Multisig(_)
| RuntimeCall::Democracy(pallet_democracy::Call::vote {..}
| pallet_democracy::Call::emergency_cancel {..}
Expand Down Expand Up @@ -331,7 +331,7 @@ impl Contains<RuntimeCall> for BaseFilter {
| RuntimeCall::NameService(_)
| RuntimeCall::XTokens(_)
| RuntimeCall::TransactionPause(_)
| RuntimeCall::ZenlinkProtocol(_)
//| RuntimeCall::ZenlinkProtocol(_)
| RuntimeCall::Farming(_)
| RuntimeCall::Assets(
pallet_assets::Call::transfer {..}
Expand Down Expand Up @@ -465,8 +465,6 @@ impl pallet_lottery::Config for Runtime {
}
impl pallet_authorship::Config for Runtime {
type FindAuthor = AuthorInherent;
type UncleGenerations = ConstU32<0>;
type FilterUncle = ();
type EventHandler = (CollatorSelection,);
}

Expand Down Expand Up @@ -972,7 +970,7 @@ construct_runtime!(
AuthorInherent: pallet_author_inherent::{Pallet, Call, Storage, Inherent} = 60,
AuraAuthorFilter: pallet_aura_style_filter::{Pallet, Storage} = 63,
// The order of the next 4 is important and shall not change.
Authorship: pallet_authorship::{Pallet, Call, Storage} = 20,
Authorship: pallet_authorship::{Pallet, Storage} = 20,
CollatorSelection: manta_collator_selection::{Pallet, Call, Storage, Event<T>, Config<T>} = 21,
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = 22,
Aura: pallet_aura::{Pallet, Storage, Config<T>} = 23,
Expand Down Expand Up @@ -1008,7 +1006,7 @@ construct_runtime!(
// Calamari stuff
CalamariVesting: calamari_vesting::{Pallet, Call, Storage, Event<T>} = 50,

ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event<T>} = 51,
//ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event<T>} = 51,

Farming: pallet_farming::{Pallet, Call, Storage, Event<T>} = 54,

Expand Down Expand Up @@ -1088,7 +1086,7 @@ mod benches {
[pallet_manta_sbt, MantaSbt]
[pallet_name_service, NameService]
// Dex
[zenlink_protocol, ZenlinkProtocol]
//[zenlink_protocol, ZenlinkProtocol]
[pallet_farming, Farming]
// XCM
[cumulus_pallet_xcmp_queue, XcmpQueue]
Expand Down Expand Up @@ -1300,7 +1298,7 @@ impl_runtime_apis! {
}

// zenlink runtime outer apis
impl zenlink_protocol_runtime_api::ZenlinkProtocolApi<Block, AccountId, ZenlinkAssetId> for Runtime {
/*impl zenlink_protocol_runtime_api::ZenlinkProtocolApi<Block, AccountId, ZenlinkAssetId> for Runtime {
fn get_balance(
asset_id: ZenlinkAssetId,
Expand Down Expand Up @@ -1359,7 +1357,7 @@ impl_runtime_apis! {
amount
)
}
}
}*/

impl pallet_farming_rpc_runtime_api::FarmingRuntimeApi<Block, AccountId, CalamariAssetId, PoolId> for Runtime {
fn get_farming_rewards(who: AccountId, pid: PoolId) -> Vec<(CalamariAssetId, Balance)> {
Expand Down
2 changes: 1 addition & 1 deletion runtime/calamari/src/migrations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Manta. If not, see <http://www.gnu.org/licenses/>.

pub mod asset_id;
//pub mod asset_id;
pub mod staking;
pub mod sudo;
2 changes: 1 addition & 1 deletion runtime/calamari/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ pub mod pallet_treasury;
pub mod pallet_tx_pause;
pub mod pallet_utility;
pub mod xcm;
pub mod zenlink_protocol;
//pub mod zenlink_protocol;
2 changes: 1 addition & 1 deletion runtime/calamari/src/weights/pallet_author_inherent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub trait WeightInfo {

/// Weights for pallet_author_inherent using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_author_inherent::WeightInfo for SubstrateWeight<T> {
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: ParachainSystem ValidationData (r:1 w:0)
// Storage: AuthorInherent HighestSlotSeen (r:1 w:1)
// Storage: AuthorInherent Author (r:1 w:0)
Expand Down
18 changes: 9 additions & 9 deletions runtime/calamari/src/weights/pallet_balances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ use manta_primitives::constants::RocksDbWeight;

/// Weight functions needed for pallet_balances.
pub trait WeightInfo {
fn transfer() -> Weight;
fn transfer_allow_death() -> Weight;
fn transfer_keep_alive() -> Weight;
fn set_balance_creating() -> Weight;
fn set_balance_killing() -> Weight;
fn force_set_balance_creating() -> Weight;
fn force_set_balance_killing() -> Weight;
fn force_transfer() -> Weight;
fn transfer_all() -> Weight;
fn force_unreserve() -> Weight;
Expand All @@ -59,7 +59,7 @@ pub trait WeightInfo {
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_balances::WeightInfo for SubstrateWeight<T> {
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
fn transfer_allow_death() -> Weight {
// Minimum execution time: 45_858 nanoseconds.
Weight::from_ref_time(49_145_000)
.saturating_add(T::DbWeight::get().reads(1))
Expand All @@ -73,14 +73,14 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for SubstrateWeight<T>
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: System Account (r:1 w:1)
fn set_balance_creating() -> Weight {
fn force_set_balance_creating() -> Weight {
// Minimum execution time: 25_291 nanoseconds.
Weight::from_ref_time(26_130_000)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: System Account (r:1 w:1)
fn set_balance_killing() -> Weight {
fn force_set_balance_killing() -> Weight {
// Minimum execution time: 27_298 nanoseconds.
Weight::from_ref_time(28_053_000)
.saturating_add(T::DbWeight::get().reads(1))
Expand Down Expand Up @@ -112,7 +112,7 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for SubstrateWeight<T>
// For backwards compatibility and tests
impl WeightInfo for () {
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
fn transfer_allow_death() -> Weight {
// Minimum execution time: 45_858 nanoseconds.
Weight::from_ref_time(49_145_000)
.saturating_add(RocksDbWeight::get().reads(1))
Expand All @@ -126,14 +126,14 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().writes(1))
}
// Storage: System Account (r:1 w:1)
fn set_balance_creating() -> Weight {
fn force_set_balance_creating() -> Weight {
// Minimum execution time: 25_291 nanoseconds.
Weight::from_ref_time(26_130_000)
.saturating_add(RocksDbWeight::get().reads(1))
.saturating_add(RocksDbWeight::get().writes(1))
}
// Storage: System Account (r:1 w:1)
fn set_balance_killing() -> Weight {
fn force_set_balance_killing() -> Weight {
// Minimum execution time: 27_298 nanoseconds.
Weight::from_ref_time(28_053_000)
.saturating_add(RocksDbWeight::get().reads(1))
Expand Down
Loading

0 comments on commit e1861be

Please sign in to comment.