Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add improved homa lite redeem match #1626

Merged
merged 25 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b9e9e57
Added a new mock that costs no fees. This can be used to test economi…
Nov 16, 2021
6b5746c
Fixed a bug where total_staking is not changed when redeeming from av…
Nov 17, 2021
3ea7064
Added one more test
Nov 17, 2021
e02b9cf
Updated comments
Nov 17, 2021
83d7593
Added one more test
Nov 17, 2021
23c2000
Updated homalite redeem logic so if redeemer doesn't enough reserve b…
Nov 18, 2021
9ee460c
Fixed a clippy errot
Nov 18, 2021
0e59973
Added function that iterates redeem request from a starting element. …
Nov 19, 2021
e8c4b9e
Replaced redeem logic to iterate from the "Next" item
Nov 20, 2021
1c4c68d
Merge remote-tracking branch 'origin/master' into feature/homa-lite-r…
Nov 20, 2021
785658b
Improved the way iterator from next element
Nov 21, 2021
2bb50e2
Changed the storage of NextRedeemRequestToMatch to store the last red…
Nov 22, 2021
84f0042
Improved how "first element" is handled
Nov 22, 2021
47851d6
Improved coding structure for homalite redeem
Nov 23, 2021
a1613ed
Refactored the way functions are structured in HomaLite
Nov 23, 2021
e3acbff
Fixed a benchmarking test
Nov 23, 2021
f494599
refactor
xlc Nov 24, 2021
43318a9
Fixed unit tests
Nov 24, 2021
b8ca01d
Tidied up how events are asserted in HomaLite unit tests
Nov 24, 2021
4b7ee6a
Tidied up how events are asserted
Nov 24, 2021
62083c8
minor comments update
Nov 24, 2021
308d6e2
Added System::reset_events to make event assert clearer
Nov 24, 2021
37d0827
Fixed clippy
Nov 24, 2021
4cd40e4
Update modules/homa-lite/src/lib.rs
xlc Nov 24, 2021
64ca4fb
Merge remote-tracking branch 'origin/master' into feature/homa-lite-r…
xlc Nov 24, 2021
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
5 changes: 4 additions & 1 deletion modules/homa-lite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ primitives = { package = "acala-primitives", path = "../../primitives", default-
orml-traits = { path = "../../orml/traits", default-features = false }
module-support = { path = "../../modules/support", default-features = false }

# TODO: move this to dev-dependencies when https://github.com/paritytech/polkadot/pull/4355 is available
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.12", default-features = false }

[dev-dependencies]
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12" }
module-currencies = { path = "../../modules/currencies" }
orml-tokens = { path = "../../orml/tokens" }
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.12" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.12" }
module-relaychain = { path = "../relaychain", features = ["kusama"] }

Expand All @@ -48,6 +50,7 @@ std = [
"primitives/std",
"orml-traits/std",
"module-support/std",
"xcm-executor/std",
]
runtime-benchmarks = [
"frame-benchmarking",
Expand Down
4 changes: 2 additions & 2 deletions modules/homa-lite/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ benchmarks! {
let caller: T::AccountId = account("caller", 0, SEED);
<T as module::Config>::Currency::deposit(T::LiquidCurrencyId::get(), &caller, amount)?;
let _ = crate::Pallet::<T>::adjust_available_staking_balance(RawOrigin::Root.into(), AmountOf::<T>::max_value(), 1);
let _ = crate::Pallet::<T>::request_redeem(RawOrigin::Signed(caller).into(), amount, Permill::default());
let _ = crate::Pallet::<T>::request_redeem(RawOrigin::Signed(caller.clone()).into(), amount, Permill::default());
}: {
let _ = crate::Pallet::<T>::process_redeem_requests_with_available_staking_balance(1);
let _ = crate::Pallet::<T>::process_redeem_requests_with_available_staking_balance(&caller);
}

xcm_unbond {}: {
Expand Down
Loading