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

fix benchmarks to handle zero existential deposit #67

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

nbaztec
Copy link

@nbaztec nbaztec commented Aug 18, 2023

Fixes pallet-balances and pallet-identity benchmarks to handle 0 ExistentialDeposit.

let caller = whitelisted_caller();

// Give some multiple of the existential deposit
let balance = existential_deposit.saturating_mul(ED_MULTIPLIER.into());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why removing the multiplier? We can keep it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this benchmark we need the account to be reaped so we can no longer transfer a part of the balance, rather the entire balance needs to be transferred so the benchmark case is respected, which doesn't really need the multiplier.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can alternatively also make it to transfer the balance instead of the ED, if that's better.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if the multiplier is useless, my point is to minimize the changes, change only what we strictly need to be able to run the benchmarks

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@nbaztec nbaztec merged commit f18e23c into moonbeam-polkadot-v0.9.43 Aug 18, 2023
0 of 4 checks passed
@nbaztec nbaztec deleted the nish-fix-benchmarks branch August 18, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants