mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 18:21:02 +00:00
Fix subtle indices bug (#2128)
* Fix subtle indices bug * Also fix balances divide by zero.
This commit is contained in:
@@ -312,7 +312,7 @@ decl_storage! {
|
||||
// <= begin it should be >= balance
|
||||
// >= begin+length it should be <= 0
|
||||
|
||||
let per_block = balance / length;
|
||||
let per_block = balance / length.max(primitives::traits::One::one());
|
||||
let offset = begin * per_block + balance;
|
||||
|
||||
(who.clone(), VestingSchedule { offset, per_block })
|
||||
|
||||
Reference in New Issue
Block a user