Merge pull request #1148 from filecoin-project/feat/msig-integration

DO NOT MERGE: Feat/msig integration
This commit is contained in:
Łukasz Magiera
2020-02-04 07:19:49 +01:00
committed by GitHub
21 changed files with 365 additions and 1307 deletions
+4 -4
View File
@@ -174,7 +174,7 @@ func (a *StateAPI) StateReadState(ctx context.Context, act *types.Actor, ts *typ
return nil, err
}
blk, err := state.Store.Blocks.GetBlock(ctx, act.Head)
blk, err := state.Store.(*hamt.BasicCborIpldStore).Blocks.GetBlock(ctx, act.Head)
if err != nil {
return nil, err
}
@@ -429,12 +429,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
}