Fix lint errors

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-04-08 21:37:04 +02:00
parent f17929f032
commit 1bd28bdb6a
7 changed files with 14 additions and 14 deletions

View File

@ -96,7 +96,7 @@ type mockBeacon struct {
interval time.Duration interval time.Duration
} }
func NewMockBeacon(interval time.Duration) *mockBeacon { func NewMockBeacon(interval time.Duration) DrandBeacon {
mb := &mockBeacon{interval: interval} mb := &mockBeacon{interval: interval}
return mb return mb

View File

@ -284,7 +284,7 @@ func (cg *ChainGen) nextBlockProof(ctx context.Context, pts *types.TipSet, m add
return nil, nil, nil, xerrors.Errorf("getLatestBeaconEntry: %w", err) return nil, nil, nil, xerrors.Errorf("getLatestBeaconEntry: %w", err)
} }
entries, err := beacon.BeaconEntriesForBlock(ctx, cg.beacon, abi.ChainEpoch(round), *prev) entries, err := beacon.BeaconEntriesForBlock(ctx, cg.beacon, round, *prev)
if err != nil { if err != nil {
return nil, nil, nil, xerrors.Errorf("get beacon entries for block: %w", err) return nil, nil, nil, xerrors.Errorf("get beacon entries for block: %w", err)
} }
@ -366,7 +366,7 @@ func (cg *ChainGen) NextTipSetFromMiners(base *types.TipSet, miners []address.Ad
if et != nil { if et != nil {
// TODO: winning post proof // TODO: winning post proof
_ = ticket _ = ticket
fblk, err := cg.makeBlock(base, m, ticket, et, bvals, abi.ChainEpoch(round), msgs) fblk, err := cg.makeBlock(base, m, ticket, et, bvals, round, msgs)
if err != nil { if err != nil {
return nil, xerrors.Errorf("making a block for next tipset failed: %w", err) return nil, xerrors.Errorf("making a block for next tipset failed: %w", err)
} }

View File

@ -264,7 +264,7 @@ func MakeGenesisBlock(ctx context.Context, bs bstore.Blockstore, sys runtime.Sys
BlockSig: nil, BlockSig: nil,
Timestamp: template.Timestamp, Timestamp: template.Timestamp,
BeaconEntries: []types.BeaconEntry{ BeaconEntries: []types.BeaconEntry{
types.BeaconEntry{ {
Round: 0, Round: 0,
Data: make([]byte, 32), Data: make([]byte, 32),
}, },

View File

@ -266,6 +266,6 @@ type fakeRand struct{}
func (fr *fakeRand) GetRandomness(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) ([]byte, error) { func (fr *fakeRand) GetRandomness(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) ([]byte, error) {
out := make([]byte, 32) out := make([]byte, 32)
rand.New(rand.NewSource(int64(randEpoch))).Read(out) _, _ = rand.New(rand.NewSource(int64(randEpoch))).Read(out)
return out, nil return out, nil
} }

View File

@ -219,7 +219,7 @@ func TestForkHeightTriggers(t *testing.T) {
} }
return []*types.SignedMessage{ return []*types.SignedMessage{
&types.SignedMessage{ {
Signature: *sig, Signature: *sig,
Message: *m, Message: *m,
}, },

View File

@ -424,7 +424,7 @@ func (m *Miner) createBlock(base *MiningBase, addr address.Address, ticket *type
nheight := base.ts.Height() + base.nullRounds + 1 nheight := base.ts.Height() + base.nullRounds + 1
// why even return this? that api call could just submit it for us // why even return this? that api call could just submit it for us
return m.api.MinerCreateBlock(context.TODO(), addr, base.ts.Key(), ticket, eproof, bvals, msgs, nheight, uint64(uts)) return m.api.MinerCreateBlock(context.TODO(), addr, base.ts.Key(), ticket, eproof, bvals, msgs, nheight, uts)
} }
type ActorLookup func(context.Context, address.Address, types.TipSetKey) (*types.Actor, error) type ActorLookup func(context.Context, address.Address, types.TipSetKey) (*types.Actor, error)

View File

@ -23,11 +23,11 @@ func TestMessageFiltering(t *testing.T) {
a2 := mustIDAddr(2) a2 := mustIDAddr(2)
actors := map[address.Address]*types.Actor{ actors := map[address.Address]*types.Actor{
a1: &types.Actor{ a1: {
Nonce: 3, Nonce: 3,
Balance: types.NewInt(1200), Balance: types.NewInt(1200),
}, },
a2: &types.Actor{ a2: {
Nonce: 1, Nonce: 1,
Balance: types.NewInt(1000), Balance: types.NewInt(1000),
}, },
@ -38,7 +38,7 @@ func TestMessageFiltering(t *testing.T) {
} }
msgs := []types.Message{ msgs := []types.Message{
types.Message{ {
From: a1, From: a1,
To: a1, To: a1,
Nonce: 3, Nonce: 3,
@ -46,7 +46,7 @@ func TestMessageFiltering(t *testing.T) {
GasLimit: 50, GasLimit: 50,
GasPrice: types.NewInt(1), GasPrice: types.NewInt(1),
}, },
types.Message{ {
From: a1, From: a1,
To: a1, To: a1,
Nonce: 4, Nonce: 4,
@ -54,7 +54,7 @@ func TestMessageFiltering(t *testing.T) {
GasLimit: 50, GasLimit: 50,
GasPrice: types.NewInt(1), GasPrice: types.NewInt(1),
}, },
types.Message{ {
From: a2, From: a2,
To: a1, To: a1,
Nonce: 1, Nonce: 1,
@ -62,7 +62,7 @@ func TestMessageFiltering(t *testing.T) {
GasLimit: 100, GasLimit: 100,
GasPrice: types.NewInt(1), GasPrice: types.NewInt(1),
}, },
types.Message{ {
From: a2, From: a2,
To: a1, To: a1,
Nonce: 0, Nonce: 0,
@ -70,7 +70,7 @@ func TestMessageFiltering(t *testing.T) {
GasLimit: 100, GasLimit: 100,
GasPrice: types.NewInt(1), GasPrice: types.NewInt(1),
}, },
types.Message{ {
From: a2, From: a2,
To: a1, To: a1,
Nonce: 2, Nonce: 2,