Skip to content

Commit

Permalink
Update fee share (#1395)
Browse files Browse the repository at this point in the history
* feat: 🎸 add usd_cumulation

* feat: 🎸 bench

* fix: 🐛 fmt

* docs: ✏️ add note
  • Loading branch information
yooml authored Aug 29, 2024
1 parent 442550e commit 018d080
Show file tree
Hide file tree
Showing 11 changed files with 487 additions and 38 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions pallets/fee-share/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ bifrost-vtoken-minting = { workspace = true }
zenlink-protocol = { workspace = true }
bifrost-slp = { workspace = true }
cumulus-primitives-core = { workspace = true }
pallet-traits = { workspace = true }

[dev-dependencies]
orml-tokens = { workspace = true }
Expand All @@ -39,6 +40,9 @@ sp-io = { workspace = true }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
bifrost-asset-registry = { workspace = true }
pallet-prices = { workspace = true }
orml-oracle = { workspace = true }
env_logger = { workspace = true }

[features]
default = ["std"]
Expand All @@ -55,6 +59,8 @@ std = [
"zenlink-protocol/std",
"bifrost-slp/std",
"bifrost-asset-registry/std",
"pallet-traits/std",
"pallet-prices/std",
]

runtime-benchmarks = [
Expand Down
16 changes: 16 additions & 0 deletions pallets/fee-share/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,20 @@ benchmarks! {
true,
));
}: _(RawOrigin::Root,0)
set_usd_config {
let caller: T::AccountId = whitelisted_caller();
let tokens_proportion = vec![(caller.clone(), Perbill::from_percent(100))];
const KSM: CurrencyId = CurrencyId::Token(TokenSymbol::KSM);
let token_type = vec![KSM];
assert_ok!(FeeShare::<T>::create_distribution(
RawOrigin::Root.into(),
vec![KSM],
tokens_proportion.clone(),
true,
));
}: _(RawOrigin::Root,
0,
100u128,
10u32.into(),
caller)
}
Loading

0 comments on commit 018d080

Please sign in to comment.