tests: Update SRML Democracy: only start referendum when proposal exists, emit...
tests: Update SRML Democracy: only start referendum when proposal exists, emit `Tabled` event, voter must have balance * Run tests with `cargo test -p srml-democrac` * Rename `value` to `deposit` * Rename `proposal` to `index` (i.e. proposal index) * Add TODO that we should we only allow voting after we also check that the data mapped to the ref_index in `ReferendumInfoOf` is valid, not just when `ReferendumInfoOf` contains the referendum index as a key * Only allow starting a referendum for a given proposal if the proposal exists when starting a referendum by calling `start_referendum`. The council may start a referendum directly by calling `internal_start_referendum` even if the proposal does not exist in `PublicProps`. Added test for each case. * Emit event `Tabled` in both the `start_referendum` and `internal_start_referendum` functions to indicate that the proposal has been elevated to the Table of Referenda * Add test to show that a voter trying to call `vote` to signal approval when they no longer have any balance will not work * Add test for edge case when voter trying to call `vote` with the smallest balance allowable to vote of 1 unit will work
parent
34c797e8
Please register or sign in to comment