Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 8 additions & 8 deletions Cargo.lock

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

26 changes: 6 additions & 20 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ use sp_std::prelude::*;
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
// A few exports that help ease life for downstream crates.
use frame_support::traits::{
Contains, EqualPrivilegeOnly, Imbalance, InstanceFilter, OnUnbalanced,
};
use frame_support::traits::{EqualPrivilegeOnly, Imbalance, InstanceFilter, OnUnbalanced};
pub use frame_support::{
construct_runtime, parameter_types,
traits::{KeyOwnerProofSystem, Randomness, StorageInfo},
Expand Down Expand Up @@ -221,27 +219,10 @@ parameter_types! {
pub const SS58Prefix: u8 = 13;
}

pub struct BaseFilter;
#[rustfmt::skip]
impl Contains<Call> for BaseFilter {
//Block send extrinsics for mainnent before official token generation event
fn contains(call: &Call) -> bool {
!matches!(
call,
// filter until we have resolved https://github.com/integritee-network/pallets/issues/17
Call::Teeracle(_)
)
}
}

// Configure FRAME pallets to include in runtime.

impl frame_system::Config for Runtime {
#[cfg(feature = "skip-extrinsic-filtering")]
type BaseCallFilter = frame_support::traits::Everything;
//Block extrinsics for mainnet before official token generation event
#[cfg(not(feature = "skip-extrinsic-filtering"))]
type BaseCallFilter = BaseFilter;
/// Block & extrinsics weights: base values and limits.
type BlockWeights = BlockWeights;
/// The maximum length of a block (in bytes).
Expand Down Expand Up @@ -398,10 +379,15 @@ impl pallet_claims::Config for Runtime {
type MoveClaimOrigin = frame_system::EnsureRoot<AccountId>;
type WeightInfo = weights::pallet_claims::WeightInfo<Runtime>;
}
parameter_types! {
pub const MaxWhitelistedReleases: u32 = 10;
}

/// added by Integritee
impl pallet_teeracle::Config for Runtime {
type Event = Event;
type WeightInfo = weights::pallet_teeracle::WeightInfo<Runtime>;
type MaxWhitelistedReleases = MaxWhitelistedReleases;
}

parameter_types! {
Expand Down
15 changes: 14 additions & 1 deletion runtime/src/weights/pallet_teeracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,24 @@ use sp_std::marker::PhantomData;
/// Weight functions for pallet_teeracle.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_teeracle::WeightInfo for WeightInfo<T> {
// Storage: Teerex Whitelist (r:1 w:1)
fn add_to_whitelist() -> Weight {
(86_491_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Teerex Whitelist (r:1 w:1)
fn remove_from_whitelist() -> Weight {
(86_491_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Teerex EnclaveIndex (r:1 w:0)
// Storage: Teeracle ExchangeRates (r:1 w:1)
// Storage: Teerex Whitelist (r:1 w:0)
fn update_exchange_rate() -> Weight {
(86_491_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
}