Skip to content

Commit

Permalink
chore: init blank pool fees pallet
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed Nov 24, 2023
1 parent 8b9c8f0 commit 2f6911e
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 13 deletions.
46 changes: 34 additions & 12 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ members = [
"pallets/nft-sales",
"pallets/order-book",
"pallets/permissions",
"pallets/pool-fees",
"pallets/pool-system",
"pallets/pool-registry",
"pallets/data-collector",
Expand Down Expand Up @@ -405,7 +406,6 @@ std = [
"fp-storage/std",
"frame-benchmarking/std",
"frame-system/std",

"futures/std",
"futures/std",
"getrandom/std",
Expand Down
72 changes: 72 additions & 0 deletions pallets/pool-fees/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[package]
authors = ["Centrifuge <[email protected]>"]
description = "Pool Fees Pallet"
edition = "2021"
license = "LGPL-3.0"
name = "pallet-pool-fees"
repository = "https://github.com/centrifuge/centrifuge-chain"
version = "0.1.0"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"], default-features = false }
log = { version = "0.4.0", default-features = false }
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] }

frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.43" }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.43" }

cfg-primitives = { path = "../../libs/primitives", default-features = false }
cfg-traits = { path = "../../libs/traits", default-features = false }
cfg-types = { path = "../../libs/types", default-features = false }

[dev-dependencies]
bitflags = "1.3"

[features]
default = ["std"]
runtime-benchmarks = [
"cfg-primitives/runtime-benchmarks",
"cfg-traits/runtime-benchmarks",
"cfg-types/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
std = [
"cfg-traits/std",
"cfg-types/std",
"cfg-primitives/std",
"codec/std",
"frame-support/std",
"frame-system/std",
"frame-benchmarking/std",
"log/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-arithmetic/std",
"sp-std/std",
"pallet-timestamp/std",
]
try-runtime = [
"cfg-primitives/try-runtime",
"cfg-traits/try-runtime",
"cfg-types/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-timestamp/try-runtime",
"sp-runtime/try-runtime",
]
52 changes: 52 additions & 0 deletions pallets/pool-fees/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright 2023 Centrifuge Foundation (centrifuge.io).

// Centrifuge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version (see http://www.gnu.org/licenses).

// Centrifuge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

#![cfg_attr(not(feature = "std"), no_std)]

pub use pallet::*;

#[frame_support::pallet]
pub mod pallet {
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;

use super::*;

#[pallet::pallet]
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
type WeightInfo: WeightInfo;
}

#[pallet::storage]
#[pallet::getter(fn something)]
pub type Something<T> = StorageValue<_, u32>;

#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {}

#[pallet::error]
pub enum Error<T> {}

#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pallet::weight(10_000)]
pub fn some_extrinsic(origin: OriginFor<T>) -> DispatchResult {
let who = ensure_signed(origin)?;
}
}
}

0 comments on commit 2f6911e

Please sign in to comment.