-
Notifications
You must be signed in to change notification settings - Fork 78
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
Split concern for pool benchmark helper #1645
Conversation
|
||
pub fn mock_bench_create_pool(f: impl Fn(T::PoolId, &T::AccountId) + 'static) { | ||
register_call!(move |(a, b)| f(a, b)); | ||
} | ||
|
||
pub fn mock_bench_investor_setup( | ||
f: impl Fn(T::PoolId, T::AccountId, T::Balance) + 'static, | ||
) { | ||
register_call!(move |(a, b, c)| f(a, b, c)); | ||
} | ||
|
||
pub fn mock_bench_default_investment_id( | ||
f: impl Fn(T::PoolId) -> T::TrancheCurrency + 'static + 'static, | ||
) { | ||
register_call!(f); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer needed if mock implementation for these is empty (which makes sense because you do not want to benchmark in testing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for untangling! LGTM
6ab2c7c
Can I have a re-approval? |
❤️ |
Description
The previous
PoolBenchmarkHelper
utility made use of investment utilities. This forces you to track investment bounds through the code, which is ok for parts that will end to use investments, but for cases where you only want to create a pool, it is boilerplate and annoying to use, carrying information out of the problem scope. This PR splits the current trait into 2 depending on the usage you require.Changes and Descriptions
PoolBenchmarkHelper
toFundedPoolBenchmarkHelper
, for creating funded pools.PoolBenchmarkHelper
for only creating just pools.Required for OracleV2. #1629