Skip to content

Commit

Permalink
Use mock web3/powchain for fuzz test (#8866)
Browse files Browse the repository at this point in the history
* Use mock web3/powchain for fuzz test

* gofmt

* build viz
  • Loading branch information
prestonvanloon authored May 5, 2021
1 parent 60c6cf7 commit 2f66d1a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion beacon-chain/powchain/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ go_library(
"mock_powchain.go",
],
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/powchain/testing",
visibility = ["//beacon-chain:__subpackages__"],
visibility = [
"//beacon-chain:__subpackages__",
"//fuzz:__pkg__",
],
deps = [
"//beacon-chain/powchain/types:go_default_library",
"//beacon-chain/state/interface:go_default_library",
Expand Down
1 change: 1 addition & 0 deletions fuzz/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ go_fuzz_test(
"//beacon-chain/blockchain:go_default_library",
"//beacon-chain/operations/slashings:go_default_library",
"//beacon-chain/forkchoice/protoarray:go_default_library",
"//beacon-chain/powchain/testing:go_default_library",
"//shared/testutil:go_default_library",
"@com_github_libp2p_go_libp2p_core//peer:go_default_library",
"@com_github_libp2p_go_libp2p_pubsub//:go_default_library",
Expand Down
3 changes: 2 additions & 1 deletion fuzz/block_fuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/prysmaticlabs/prysm/beacon-chain/operations/voluntaryexits"
"github.com/prysmaticlabs/prysm/beacon-chain/p2p"
p2pt "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing"
powt "github.com/prysmaticlabs/prysm/beacon-chain/powchain/testing"
"github.com/prysmaticlabs/prysm/beacon-chain/state/stateV0"
"github.com/prysmaticlabs/prysm/beacon-chain/state/stategen"
"github.com/prysmaticlabs/prysm/beacon-chain/sync"
Expand Down Expand Up @@ -133,7 +134,7 @@ func BeaconFuzzBlock(b []byte) {
}

chain, err := blockchain.NewService(context.Background(), &blockchain.Config{
ChainStartFetcher: nil,
ChainStartFetcher: powt.NewPOWChain(),
BeaconDB: db1,
DepositCache: nil,
AttPool: ap,
Expand Down

0 comments on commit 2f66d1a

Please sign in to comment.