-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Benchmark combinatorial-tokens (#1387)
* Expose benchmarking parameter * Add security notes to code * Update and test `TokenMerged` event * Implement `TokenRedeemed` event * Test `TokenRedeemed` event * Add `CombinatorialTokensBenchmarkHelper` * Implement `redeem_position` benchmark * Implement first benchmarks, prediction markets benchmark helper * Clear up errors * Include benchmarks * Extend tests * Implement more benchmarks * . * . * Use weight in `redeem_position` * . * . * . * First split bench * Horizontal splits benchmarked * . * . * .
- Loading branch information
1 parent
3bda745
commit 2660096
Showing
18 changed files
with
1,271 additions
and
80 deletions.
There are no files selected for viewing
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
13 changes: 13 additions & 0 deletions
13
primitives/src/traits/combinatorial_tokens_benchmark_helper.rs
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,13 @@ | ||
use alloc::vec::Vec; | ||
use sp_runtime::DispatchResult; | ||
|
||
pub trait CombinatorialTokensBenchmarkHelper { | ||
type Balance; | ||
type MarketId; | ||
|
||
/// Prepares the market with the specified `market_id` to have a particular `payout`. | ||
fn setup_payout_vector( | ||
market_id: Self::MarketId, | ||
payout: Option<Vec<Self::Balance>>, | ||
) -> DispatchResult; | ||
} |
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
Oops, something went wrong.