refactoring: Deduplicate code (#10090)

* Deduplicate sync committee indices from state

* Deduplicate code in listblocks RPC endpoints, which only differ in response object

* Deduplicate test code in config/fieldparams

* Delete stale benchmark target. This is already included in go_default_test

* deduplicate test cases in TestIsSlashableValidator_OK and fix blst
BUILD file

* Deduplicate TestStore_IsFinalizedChildBlock

* Revert crypto/bls/blst/BUILD.bazel

* Deduplicate TestStore_SaveBlock_NoDuplicates

* Use a generic wrapper for beacon blocks to streamline test

* Deduplicate TestStore_BlocksCRUD

* Deduplicate TestStore_BlocksHandleZeroCase

* Deduplicate TestStore_BlocksBatchDelete

* deduplicate TestStore_BlocksHandleInvalidEndSlot

* Deduplicate TestStore_BlocksCRUD_NoCache

* Deduplicate common block test setup. Make TestStore_Blocks_FiltersCorrectly support multiple forks in test

* Deduplicate the rest of these tests

* lint

* Deprecation warning

* Add test for WrappedSignedBeaconBlock

* Test error path
This commit is contained in:
Preston Van Loon
2022-01-16 12:44:42 -06:00
committed by GitHub
parent 3c54eb1cf6
commit 182bd615ac
15 changed files with 678 additions and 1809 deletions

View File

@@ -12,7 +12,10 @@ go_library(
go_test(
name = "go_default_test",
srcs = ["mainnet_test.go"],
srcs = [
"common_test.go",
"mainnet_test.go",
],
deps = [
":go_default_library",
"//config/params:go_default_library",
@@ -22,7 +25,10 @@ go_test(
go_test(
name = "go_minimal_test",
srcs = ["minimal_test.go"],
srcs = [
"common_test.go",
"minimal_test.go",
],
eth_network = "minimal",
deps = [
":go_default_library",