From b06a2ddc006451e276e29eb911359c37ff8a58ff Mon Sep 17 00:00:00 2001 From: simlecode <69969590+simlecode@users.noreply.github.com> Date: Mon, 14 Oct 2024 09:42:08 +0800 Subject: [PATCH] chore: fix lint --- extern/filecoin-ffi | 2 +- pkg/chain/randomness.go | 2 +- pkg/vm/vmcontext/types.go | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index e467d2992e..815fb3a20f 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit e467d2992e3f9bd09beb71ecf84323b45d2a3511 +Subproject commit 815fb3a20fda47cad556ba2045b16021610cd02c diff --git a/pkg/chain/randomness.go b/pkg/chain/randomness.go index f10736784c..812e058d08 100644 --- a/pkg/chain/randomness.go +++ b/pkg/chain/randomness.go @@ -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 diff --git a/pkg/vm/vmcontext/types.go b/pkg/vm/vmcontext/types.go index 4e9948e5e4..5a35d82538 100644 --- a/pkg/vm/vmcontext/types.go +++ b/pkg/vm/vmcontext/types.go @@ -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" @@ -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" @@ -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) }