mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 22:51:13 +00:00
Do not allow zero Existential Deposit when using Balances (#4894)
* Add non-zero ed check on Balances genesis * Update ED from 0 to 1 * bump impl * bump spec * Found remove more ed = 0 * Fix some contract tests * Use ctx.overlay.set_balance for contracts * Fix staking test * Remove obsolete logic * Allow death of payout account in society * Update frame/balances/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Dont create genesis balances if balance is zero in transaction payment pallet Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Gavin Wood <github@gavwood.com>
This commit is contained in:
@@ -394,6 +394,10 @@ decl_storage! {
|
||||
config(balances): Vec<(T::AccountId, T::Balance)>;
|
||||
// ^^ begin, length, amount liquid at genesis
|
||||
build(|config: &GenesisConfig<T, I>| {
|
||||
assert!(
|
||||
<T as Trait<I>>::ExistentialDeposit::get() > Zero::zero(),
|
||||
"The existential deposit should be greater than zero."
|
||||
);
|
||||
for (_, balance) in &config.balances {
|
||||
assert!(
|
||||
*balance >= <T as Trait<I>>::ExistentialDeposit::get(),
|
||||
|
||||
@@ -103,7 +103,7 @@ pub struct ExtBuilder {
|
||||
impl Default for ExtBuilder {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
existential_deposit: 0,
|
||||
existential_deposit: 1,
|
||||
creation_fee: 0,
|
||||
monied: false,
|
||||
}
|
||||
@@ -120,9 +120,6 @@ impl ExtBuilder {
|
||||
}
|
||||
pub fn monied(mut self, monied: bool) -> Self {
|
||||
self.monied = monied;
|
||||
if self.existential_deposit == 0 {
|
||||
self.existential_deposit = 1;
|
||||
}
|
||||
self
|
||||
}
|
||||
pub fn set_associated_consts(&self) {
|
||||
|
||||
Reference in New Issue
Block a user