Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Oct 14, 2024
1 parent d8c8d21 commit b06a2dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/chain/randomness.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (g *GenesisRandomnessSource) GetChainRandomness(ctx context.Context, randEp
_, _ = rand.New(rand.NewSource(int64(randEpoch))).Read(out) //nolint
return *(*[32]byte)(out), nil
}
func (r *GenesisRandomnessSource) GetBeaconEntry(_ context.Context, randEpoch abi.ChainEpoch) (*types.BeaconEntry, error) {
func (g *GenesisRandomnessSource) GetBeaconEntry(_ context.Context, randEpoch abi.ChainEpoch) (*types.BeaconEntry, error) {
out := make([]byte, 32)
_, _ = rand.New(rand.NewSource(int64(randEpoch))).Read(out) //nolint
return &types.BeaconEntry{Round: 10, Data: out}, nil
Expand Down
6 changes: 2 additions & 4 deletions pkg/vm/vmcontext/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

// "github.com/dchest/blake2b"
"github.com/dchest/blake2b"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/exitcode"
Expand All @@ -15,10 +15,8 @@ import (
"github.com/filecoin-project/venus/venus-shared/actors/builtin/account"
blockstoreutil "github.com/filecoin-project/venus/venus-shared/blockstore"
"github.com/filecoin-project/venus/venus-shared/types"
must "github.com/filecoin-project/venus/venus-shared/utils"
cbor "github.com/ipfs/go-ipld-cbor"
"github.com/pkg/errors"
"golang.org/x/crypto/blake2b"

"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
Expand Down Expand Up @@ -106,7 +104,7 @@ type HeadChainRandomness interface {
}

func DrawRandomnessFromDigest(digest [32]byte, pers crypto.DomainSeparationTag, round abi.ChainEpoch, entropy []byte) ([]byte, error) {
h := must.One(blake2b.New256(nil))
h := blake2b.New256()
if err := binary.Write(h, binary.BigEndian, int64(pers)); err != nil {
return nil, fmt.Errorf("deriving randomness: %w", err)
}
Expand Down

0 comments on commit b06a2dd

Please sign in to comment.