Skip to content

Commit

Permalink
feat: implement pallet tipping (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulhakim2902 authored Feb 22, 2023
1 parent e486e3b commit c3f56ae
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Cargo.lock

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

10 changes: 10 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ opinion-requestor-benchmarking = { path = '../pallets/opinion-requestor/benchmar
opinion = { path = '../pallets/opinion', default-features = false }
opinion-benchmarking = { path = '../pallets/opinion/benchmarking', default-features = false, optional = true }

# Myriad Dependencies
## Myriad Pallet Dependencies
pallet-tipping = { git = 'https://github.com/myriadsocial/myriad-node.git', tag = '2.3.4', default-features = false }

# Local Primitives
primitives-profile-roles = { path = '../primitives/profile-roles', default-features = false }
primitives-ethereum-address = { path = '../primitives/ethereum-address', default-features = false }
Expand Down Expand Up @@ -192,6 +196,9 @@ runtime-benchmarks = [
'health-professional-qualification-benchmarking',
'opinion-requestor-benchmarking',
'opinion-benchmarking',

# Myriad Pallet
'pallet-tipping/runtime-benchmarks',
]
std = [
# External Dependencies
Expand Down Expand Up @@ -287,6 +294,9 @@ std = [
# Local Primitives
'primitives-profile-roles/std',
'primitives-ethereum-address/std',

# Myriad Pallet
'pallet-tipping/std',
]
try-runtime = [
# Substrate Dependencies
Expand Down
23 changes: 23 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,26 @@ impl opinion::Config for Runtime {
type OpinionWeightInfo = ();
}

// ------------------------------
// Myriad Pallets
// ------------------------------
parameter_types! {
// In percentage
pub const AdminFee: u8 = 10;
pub const TransactionFee: u8 = 5;
}

impl pallet_tipping::Config for Runtime {
type Assets = OctopusAssets;
type Currency = Balances;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type TimeProvider = Timestamp;
type AdminFee = AdminFee;
type TransactionFee = TransactionFee;
type WeightInfo = ();
}

type Migrations = (
// This migration is used to set the interval value in the upward-messages. It should be
// deleted after the upgrade.
Expand Down Expand Up @@ -1004,6 +1024,9 @@ construct_runtime!(
HealthProfessionalQualification: health_professional_qualification,
OpinionRequestor: opinion_requestor,
Opinion: opinion,

// Myriad pallets
Tipping: pallet_tipping,
}
);

Expand Down

0 comments on commit c3f56ae

Please sign in to comment.