Fix Crowdloan Dissolve and Add Auction Cancel (#2665)

* Check fund depositor calls dissolve

* add auction cancel too

* use drain api rather than `iter` + `take`

* add test and benchmarks

* cargo run --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=auctions --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/

Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
This commit is contained in:
Shawn Tabrizi
2021-03-24 11:20:15 +01:00
committed by GitHub
parent db3cdca001
commit ffe4bf151c
4 changed files with 118 additions and 44 deletions
@@ -759,7 +759,7 @@ fn basic_swap_works() {
assert_eq!(Balances::free_balance(&crowdloan_account), 0);
// Dissolve returns the balance of the person who put a deposit for crowdloan
assert_ok!(Crowdloan::dissolve(Origin::signed(2), ParaId::from(2)));
assert_ok!(Crowdloan::dissolve(Origin::signed(1), ParaId::from(2)));
assert_eq!(Balances::reserved_balance(&1), 0);
assert_eq!(Balances::reserved_balance(&2), 500 + 20 * 2 * 1);