Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mesh-1097: add corporate-actions pallet
- Loading branch information
Showing
5 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[package] | ||
name = "pallet-corporate-actions" | ||
version = "0.1.0" | ||
authors = ["Polymath"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
# Common | ||
polymesh-primitives = { path = "../../primitives", default-features = false } | ||
polymesh-primitives-derive = { path = "../../primitives_derive", default-features = false } | ||
polymesh-common-utilities = { path = "../common", default-features = false } | ||
|
||
# Our Pallets | ||
pallet-balances = { path = "../balances", default-features = false } | ||
pallet-identity = { path = "../identity", default-features = false } | ||
|
||
# Other | ||
serde = { version = "1.0.104", default-features = false } | ||
serde_derive = { version = "1.0.104", optional = true, default-features = false } | ||
|
||
# Substrate | ||
codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] } | ||
sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, tag = "v2.0.0" } | ||
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, tag = "v2.0.0" } | ||
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, tag = "v2.0.0" } | ||
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, tag = "v2.0.0" } | ||
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, tag = "v2.0.0" } | ||
sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, tag = "v2.0.0" } | ||
sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, tag = "v2.0.0" } | ||
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, tag = "v2.0.0" } | ||
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, tag = "v2.0.0" } | ||
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, tag = "v2.0.0" } | ||
pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, tag = "v2.0.0" } | ||
libsecp256k1 = { version = "0.3.5", default-features = false, features = ["hmac"] } | ||
|
||
[features] | ||
default = ["std"] | ||
no_std = [] | ||
std = [ | ||
"codec/std", | ||
"frame-support/std", | ||
"frame-system/std", | ||
"pallet-balances/std", | ||
"pallet-timestamp/std", | ||
"polymesh-common-utilities/std", | ||
"polymesh-primitives/std", | ||
"serde/std", | ||
"serde_derive", | ||
"sp-api/std", | ||
"sp-core/std", | ||
"sp-io/std", | ||
"sp-runtime/std", | ||
"sp-std/std", | ||
"sp-version/std", | ||
"sp-arithmetic/std" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// This file is part of the Polymesh distribution (https://github.com/PolymathNetwork/Polymesh). | ||
// Copyright (c) 2020 Polymath | ||
|
||
// This program 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, version 3. | ||
|
||
// This program 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. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
//! # Corporate Actions module. | ||
//! | ||
//! TODO | ||
//! | ||
//! ## Overview | ||
//! | ||
//! TODO | ||
//! | ||
//! ## Interface | ||
//! | ||
//! TODO | ||
//! | ||
//! ### Dispatchable Functions | ||
//! | ||
//! TODO | ||
//! | ||
//! ### Public Functions | ||
//! | ||
//! TODO | ||
//! | ||
|
||
#![cfg_attr(not(feature = "std"), no_std)] | ||
|
||
use frame_support::{decl_error, decl_event, decl_module, decl_storage, traits::Currency}; | ||
use polymesh_common_utilities::{ | ||
balances::Trait as BalancesTrait, identity::Trait as IdentityTrait, | ||
}; | ||
use sp_std::prelude::*; | ||
|
||
/// The module's configuration trait. | ||
pub trait Trait: frame_system::Trait + BalancesTrait + IdentityTrait { | ||
/// The overarching event type. | ||
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>; | ||
type Currency: Currency<Self::AccountId>; | ||
} | ||
|
||
decl_storage! { | ||
trait Store for Module<T: Trait> as Asset { | ||
// TODO | ||
} | ||
} | ||
|
||
// Public interface for this runtime module. | ||
decl_module! { | ||
pub struct Module<T: Trait> for enum Call where origin: T::Origin { | ||
type Error = Error<T>; | ||
|
||
/// initialize the default event for this module | ||
fn deposit_event() = default; | ||
|
||
// TODO | ||
} | ||
} | ||
|
||
decl_event! { | ||
pub enum Event<T> | ||
where | ||
AccountId = <T as frame_system::Trait>::AccountId, | ||
{ | ||
/// TODO | ||
TODO(AccountId), | ||
} | ||
} | ||
|
||
decl_error! { | ||
pub enum Error for Module<T: Trait> { | ||
// TODO | ||
} | ||
} | ||
|
||
impl<T: Trait> Module<T> { | ||
// TODO | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters