JoshOrndorff / recipes

A Hands-On Cookbook for Aspiring Blockchain Chefs
GNU General Public License v3.0
378 stars 187 forks source link

In Charity pallet, the pot is not initialized with an account minimum balance. #309

Closed jimmychu0807 closed 4 years ago

jimmychu0807 commented 4 years ago

Initially raised in #308. This can be verified with using polkadot-js app to query the system:account of the charity account.

Verified at the following screenshots.

  1. To get the charity pot account.

Screenshot 2020-07-16 at 10 15 36

  1. Purge the chain, and check the pot account balance.

Screenshot 2020-07-16 at 10 14 30

jimmychu0807 commented 4 years ago

@JoshOrndorff On this branch, I have written test to include pot initial minimum_balance into consideration. Test passes now. The main changes is in fn new_test_ext(), there is also these lines:

crate::GenesisConfig {}
        .assimilate_storage::<TestRuntime>(&mut t)
        .unwrap();

being run. With this, it means min balance is indeed set properly in pot account.

But when running regularly, interacting using polkadot-JS app, if we query the pot account after purging a chain, we still see the pot amount start from 0 instead of the min balance.

Not sure where the bug is...

JoshOrndorff commented 4 years ago

Good debugging work @jimmychu0807 This is a mystery to me as well.

jimmychu0807 commented 4 years ago

close by #319