Address simple linter issues

This commit is contained in:
Ian Davis
2022-11-24 16:32:27 +00:00
parent ca3b7c3bcf
commit 9f85d3dca7
15 changed files with 25 additions and 30 deletions
+2 -2
View File
@@ -898,7 +898,7 @@ func (r *refunder) EnsureMinerMinimums(ctx context.Context, tipset *types.TipSet
func (r *refunder) processTipsetStorageMarketActor(ctx context.Context, tipset *types.TipSet, msg api.Message, recp *types.MessageReceipt) (bool, string, types.BigInt, error) {
m := msg.Message
refundValue := types.NewInt(0)
var refundValue types.BigInt
var messageMethod string
switch m.Method {
@@ -925,7 +925,7 @@ func (r *refunder) processTipsetStorageMarketActor(ctx context.Context, tipset *
func (r *refunder) processTipsetStorageMinerActor(ctx context.Context, tipset *types.TipSet, msg api.Message, recp *types.MessageReceipt) (bool, string, types.BigInt, error) {
m := msg.Message
refundValue := types.NewInt(0)
var refundValue types.BigInt
var messageMethod string
if _, found := r.blockmap[m.To]; found {
+6 -6
View File
@@ -36,7 +36,7 @@ type Option uint64
const (
Approve Option = 49
Reject = 50
Reject Option = 50
)
type Vote struct {
@@ -148,7 +148,7 @@ var finalResultCmd = &cli.Command{
}
votes, err := getVotesMap(vj)
if err != nil {
return xerrors.Errorf("failed to get voters: ", err)
return xerrors.Errorf("failed to get voters: %w\n", err)
}
type minerBriefInfo struct {
@@ -160,23 +160,23 @@ var finalResultCmd = &cli.Command{
// power actor
pa, err := st.GetActor(power.Address)
if err != nil {
return xerrors.Errorf("failed to get power actor: \n", err)
return xerrors.Errorf("failed to get power actor: %w\n", err)
}
powerState, err := power.Load(store, pa)
if err != nil {
return xerrors.Errorf("failed to get power state: \n", err)
return xerrors.Errorf("failed to get power state: %w\n", err)
}
//market actor
ma, err := st.GetActor(market.Address)
if err != nil {
return xerrors.Errorf("fail to get market actor: ", err)
return xerrors.Errorf("fail to get market actor: %w\n", err)
}
marketState, err := market.Load(store, ma)
if err != nil {
return xerrors.Errorf("fail to load market state: ", err)
return xerrors.Errorf("fail to load market state: %w\n", err)
}
lookupId := func(addr address.Address) address.Address {
+4 -4
View File
@@ -240,7 +240,7 @@ func checkMigrationInvariants(ctx context.Context, v8StateRootCid cid.Cid, v9Sta
return err
}
v9actorTree, err := builtin.LoadTree(actorStore, v9stateRoot.Actors)
v9actorTree, _ := builtin.LoadTree(actorStore, v9stateRoot.Actors)
messages, err := v9.CheckStateInvariants(v9actorTree, epoch, actorCodeCids)
if err != nil {
return xerrors.Errorf("checking state invariants: %w", err)
@@ -465,7 +465,7 @@ func compareProposalToAllocation(prop market8.DealProposal, alloc verifreg9.Allo
return xerrors.Errorf("couldnt get ID from address")
}
if proposalClientID != uint64(alloc.Client) {
return xerrors.Errorf("client id mismatch between proposal and allocation: %s, %s", proposalClientID, alloc.Client)
return xerrors.Errorf("client id mismatch between proposal and allocation: %v, %v", proposalClientID, alloc.Client)
}
proposalProviderID, err := address.IDFromAddress(prop.Provider)
@@ -473,11 +473,11 @@ func compareProposalToAllocation(prop market8.DealProposal, alloc verifreg9.Allo
return xerrors.Errorf("couldnt get ID from address")
}
if proposalProviderID != uint64(alloc.Provider) {
return xerrors.Errorf("provider id mismatch between proposal and allocation: %s, %s", proposalProviderID, alloc.Provider)
return xerrors.Errorf("provider id mismatch between proposal and allocation: %v, %v", proposalProviderID, alloc.Provider)
}
if prop.PieceSize != alloc.Size {
return xerrors.Errorf("piece size mismatch between proposal and allocation: %s, %s", prop.PieceSize, alloc.Size)
return xerrors.Errorf("piece size mismatch between proposal and allocation: %v, %v", prop.PieceSize, alloc.Size)
}
if alloc.TermMax != 540*builtin.EpochsInDay {