clean up tests and fix cli commands

This commit is contained in:
whyrusleeping
2020-02-03 19:37:55 -08:00
parent 30a922513b
commit 9cee31193c
6 changed files with 81 additions and 26 deletions
+3 -3
View File
@@ -425,12 +425,12 @@ func (a *StateAPI) MsigGetAvailableBalance(ctx context.Context, addr address.Add
return act.Balance, nil
}
offset := ts.Height() - st.StartingBlock
if offset > st.UnlockDuration {
offset := ts.Height() - uint64(st.StartEpoch)
if offset > uint64(st.UnlockDuration) {
return act.Balance, nil
}
minBalance := types.BigDiv(st.InitialBalance, types.NewInt(st.UnlockDuration))
minBalance := types.BigDiv(types.BigInt(st.InitialBalance), types.NewInt(uint64(st.UnlockDuration)))
minBalance = types.BigMul(minBalance, types.NewInt(offset))
return types.BigSub(act.Balance, minBalance), nil
}