mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 13:28:01 -05:00
Move spectests into a separate package (#8798)
* move general/phase0/bls tests * phase0/operations tests * phase0/sanity/blocks * fix import * phase0/sanity/slots * phase0/sanity/slots minimal * phase0/epoch_processing tests * phase0/rewards tests * simplify * more simplification * phase0/shuffling tests * phase0/ssz_static tests * spectest/utils * fix build * readme * update test sizes * update readme
This commit is contained in:
@@ -21,6 +21,7 @@ go_library(
|
||||
"//beacon-chain:__subpackages__",
|
||||
"//fuzz:__pkg__",
|
||||
"//shared/testutil:__pkg__",
|
||||
"//spectest:__subpackages__",
|
||||
"//validator/accounts:__pkg__",
|
||||
],
|
||||
deps = [
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
load("@prysm//tools/go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["block_processing_test.yaml.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/blocks/spectest",
|
||||
visibility = ["//beacon-chain:__subpackages__"],
|
||||
)
|
||||
|
||||
test_suite(
|
||||
name = "go_default_test",
|
||||
tags = ["spectest"],
|
||||
tests = [
|
||||
":go_mainnet_test",
|
||||
# Minimal tests must be run with --define ssz=minimal
|
||||
#":go_minimal_test",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_mainnet_test",
|
||||
size = "medium",
|
||||
srcs = glob(
|
||||
["*_test.go"],
|
||||
exclude = ["*_minimal_test.go"],
|
||||
),
|
||||
data = glob(["*.yaml"]) + [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
],
|
||||
embed = [":go_default_library"],
|
||||
shard_count = 4,
|
||||
tags = ["spectest"],
|
||||
deps = [
|
||||
"//beacon-chain/core/blocks:go_default_library",
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/core/state:go_default_library",
|
||||
"//beacon-chain/core/state/stateutils:go_default_library",
|
||||
"//beacon-chain/core/validators:go_default_library",
|
||||
"//beacon-chain/state/interface:go_default_library",
|
||||
"//beacon-chain/state/stateV0:go_default_library",
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
||||
"@com_github_golang_snappy//:go_default_library",
|
||||
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",
|
||||
"@in_gopkg_d4l3k_messagediff_v1//:go_default_library",
|
||||
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
# Requires --define ssz=minimal
|
||||
go_test(
|
||||
name = "go_minimal_test",
|
||||
size = "small",
|
||||
srcs = glob(
|
||||
["*_test.go"],
|
||||
exclude = ["*_mainnet_test.go"],
|
||||
),
|
||||
data = glob(["*.yaml"]) + [
|
||||
"@eth2_spec_tests_minimal//:test_data",
|
||||
],
|
||||
embed = [":go_default_library"],
|
||||
tags = [
|
||||
"manual",
|
||||
"minimal",
|
||||
"spectest",
|
||||
],
|
||||
deps = [
|
||||
"//beacon-chain/core/blocks:go_default_library",
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/core/state:go_default_library",
|
||||
"//beacon-chain/core/state/stateutils:go_default_library",
|
||||
"//beacon-chain/core/validators:go_default_library",
|
||||
"//beacon-chain/state/interface:go_default_library",
|
||||
"//beacon-chain/state/stateV0:go_default_library",
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
||||
"@com_github_golang_snappy//:go_default_library",
|
||||
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",
|
||||
"@in_gopkg_d4l3k_messagediff_v1//:go_default_library",
|
||||
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
|
||||
],
|
||||
)
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAttestationMainnet(t *testing.T) {
|
||||
runAttestationTest(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAttestationMinimal(t *testing.T) {
|
||||
runAttestationTest(t, "minimal")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAttesterSlashingMainnet(t *testing.T) {
|
||||
runAttesterSlashingTest(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAttesterSlashingMinimal(t *testing.T) {
|
||||
runAttesterSlashingTest(t, "minimal")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBlockHeaderMainnet(t *testing.T) {
|
||||
runBlockHeaderTest(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBlockHeaderMinimal(t *testing.T) {
|
||||
runBlockHeaderTest(t, "minimal")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBlockProcessingMainnet(t *testing.T) {
|
||||
runBlockProcessingTest(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBlockProcessingMinimal(t *testing.T) {
|
||||
runBlockProcessingTest(t, "minimal")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDepositMainnet(t *testing.T) {
|
||||
runDepositTest(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDepositMinimal(t *testing.T) {
|
||||
runDepositTest(t, "minimal")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestProposerSlashingMainnet(t *testing.T) {
|
||||
runProposerSlashingTest(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestProposerSlashingMinimal(t *testing.T) {
|
||||
runProposerSlashingTest(t, "minimal")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestVoluntaryExitMainnet(t *testing.T) {
|
||||
runVoluntaryExitTest(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestVoluntaryExitMinimal(t *testing.T) {
|
||||
runVoluntaryExitTest(t, "minimal")
|
||||
}
|
||||
@@ -5,7 +5,10 @@ go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["epoch_processing.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/epoch",
|
||||
visibility = ["//beacon-chain:__subpackages__"],
|
||||
visibility = [
|
||||
"//beacon-chain:__subpackages__",
|
||||
"//spectest:__subpackages__",
|
||||
],
|
||||
deps = [
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/core/validators:go_default_library",
|
||||
|
||||
@@ -12,7 +12,10 @@ go_library(
|
||||
"type.go",
|
||||
],
|
||||
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/epoch/precompute",
|
||||
visibility = ["//beacon-chain:__subpackages__"],
|
||||
visibility = [
|
||||
"//beacon-chain:__subpackages__",
|
||||
"//spectest:__subpackages__",
|
||||
],
|
||||
deps = [
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/state/interface:go_default_library",
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
load("@prysm//tools/go:def.bzl", "go_library")
|
||||
|
||||
test_suite(
|
||||
name = "go_default_test",
|
||||
tags = ["spectest"],
|
||||
tests = [
|
||||
":go_mainnet_test",
|
||||
# Minimal tests must be run with --define ssz=minimal
|
||||
#":go_minimal_test",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_mainnet_test",
|
||||
size = "small",
|
||||
srcs = glob(
|
||||
["*_test.go"],
|
||||
exclude = ["*_minimal_test.go"],
|
||||
),
|
||||
data = [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"spectest",
|
||||
],
|
||||
deps = [
|
||||
"//beacon-chain/core/epoch:go_default_library",
|
||||
"//beacon-chain/core/epoch/precompute:go_default_library",
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/state/stateV0:go_default_library",
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_ghodss_yaml//:go_default_library",
|
||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
||||
"@com_github_golang_snappy//:go_default_library",
|
||||
"@in_gopkg_d4l3k_messagediff_v1//:go_default_library",
|
||||
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
# Requires --define ssz=minimal
|
||||
go_test(
|
||||
name = "go_minimal_test",
|
||||
size = "small",
|
||||
srcs = glob(
|
||||
["*_test.go"],
|
||||
exclude = ["*_mainnet_test.go"],
|
||||
),
|
||||
data = [
|
||||
"@eth2_spec_tests_minimal//:test_data",
|
||||
],
|
||||
tags = [
|
||||
"manual",
|
||||
"minimal",
|
||||
"spectest",
|
||||
],
|
||||
deps = [
|
||||
"//beacon-chain/core/epoch:go_default_library",
|
||||
"//beacon-chain/core/epoch/precompute:go_default_library",
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/state/stateV0:go_default_library",
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_ghodss_yaml//:go_default_library",
|
||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
||||
"@com_github_golang_snappy//:go_default_library",
|
||||
"@in_gopkg_d4l3k_messagediff_v1//:go_default_library",
|
||||
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
|
||||
],
|
||||
)
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRewardsPenaltiesMainnet(t *testing.T) {
|
||||
runPrecomputeRewardsAndPenaltiesTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRewardsPenaltiesMinimal(t *testing.T) {
|
||||
runPrecomputeRewardsAndPenaltiesTests(t, "minimal")
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
|
||||
test_suite(
|
||||
name = "go_default_test",
|
||||
tags = ["spectest"],
|
||||
tests = [
|
||||
":go_mainnet_test",
|
||||
# Minimal tests must be run with --define ssz=minimal
|
||||
#":go_minimal_test",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_mainnet_test",
|
||||
size = "small",
|
||||
srcs = glob(
|
||||
["*_test.go"],
|
||||
exclude = ["*_minimal_test.go"],
|
||||
),
|
||||
data = [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"spectest",
|
||||
],
|
||||
deps = [
|
||||
"//beacon-chain/core/epoch:go_default_library",
|
||||
"//beacon-chain/core/epoch/precompute:go_default_library",
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/state/interface:go_default_library",
|
||||
"//beacon-chain/state/stateV0:go_default_library",
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
||||
"@in_gopkg_d4l3k_messagediff_v1//:go_default_library",
|
||||
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
# Requires --define ssz=minimal
|
||||
go_test(
|
||||
name = "go_minimal_test",
|
||||
size = "small",
|
||||
srcs = glob(
|
||||
["*_test.go"],
|
||||
exclude = ["*_mainnet_test.go"],
|
||||
),
|
||||
data = [
|
||||
"@eth2_spec_tests_minimal//:test_data",
|
||||
],
|
||||
tags = [
|
||||
"manual",
|
||||
"minimal",
|
||||
"spectest",
|
||||
],
|
||||
deps = [
|
||||
"//beacon-chain/core/epoch:go_default_library",
|
||||
"//beacon-chain/core/epoch/precompute:go_default_library",
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/state/interface:go_default_library",
|
||||
"//beacon-chain/state/stateV0:go_default_library",
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
||||
"@in_gopkg_d4l3k_messagediff_v1//:go_default_library",
|
||||
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
|
||||
],
|
||||
)
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestEffectiveBalanceUpdatesMainnet(t *testing.T) {
|
||||
runEffectiveBalanceUpdatesTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestEffectiveBalanceUpdatesMinimal(t *testing.T) {
|
||||
runEffectiveBalanceUpdatesTests(t, "minimal")
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestEth1DataResetMainnet(t *testing.T) {
|
||||
runEth1DataResetTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestEth1DataResetMinimal(t *testing.T) {
|
||||
runEth1DataResetTests(t, "minimal")
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestHistoricalRootsUpdateMainnet(t *testing.T) {
|
||||
runHistoricalRootsUpdateTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestHistoricalRootsUpdateMinimal(t *testing.T) {
|
||||
runHistoricalRootsUpdateTests(t, "minimal")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestJustificationAndFinalizationMainnet(t *testing.T) {
|
||||
runJustificationAndFinalizationTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestJustificationAndFinalizationMinimal(t *testing.T) {
|
||||
runJustificationAndFinalizationTests(t, "minimal")
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestParticipationRecordUpdatesMainnet(t *testing.T) {
|
||||
runParticipationRecordUpdatesTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestParticipationRecordUpdatesMinimal(t *testing.T) {
|
||||
runParticipationRecordUpdatesTests(t, "minimal")
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestRandaoMixesResetMainnet(t *testing.T) {
|
||||
runRandaoMixesResetTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestRandaoMixesResetMinimal(t *testing.T) {
|
||||
runRandaoMixesResetTests(t, "minimal")
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Package spectest contains all conformity specification tests
|
||||
// for epoch processing according to the eth2 spec.
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRegistryUpdatesMainnet(t *testing.T) {
|
||||
runRegistryUpdatesTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRegistryUpdatesMinimal(t *testing.T) {
|
||||
runRegistryUpdatesTests(t, "minimal")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRewardsAndPenaltiesMainnet(t *testing.T) {
|
||||
runRewardsAndPenaltiesTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRewardsAndPenaltiesMinimal(t *testing.T) {
|
||||
runRewardsAndPenaltiesTests(t, "minimal")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSlashingsMainnet(t *testing.T) {
|
||||
runSlashingsTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSlashingsMinimal(t *testing.T) {
|
||||
runSlashingsTests(t, "minimal")
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestSlashingsResetMainnet(t *testing.T) {
|
||||
runSlashingsResetTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestSlashingsResetMinimal(t *testing.T) {
|
||||
runSlashingsResetTests(t, "minimal")
|
||||
}
|
||||
@@ -28,6 +28,7 @@ go_library(
|
||||
"//shared/p2putils:__pkg__",
|
||||
"//shared/testutil:__pkg__",
|
||||
"//slasher:__subpackages__",
|
||||
"//spectest:__subpackages__",
|
||||
"//tools:__subpackages__",
|
||||
"//validator:__subpackages__",
|
||||
],
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
load("@prysm//tools/go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["shuffle_test_format.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/helpers/spectest",
|
||||
visibility = ["//beacon-chain:__subpackages__"],
|
||||
deps = ["@com_github_prysmaticlabs_eth2_types//:go_default_library"],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
size = "medium",
|
||||
srcs = ["shuffle_yaml_test.go"],
|
||||
data = [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
"@eth2_spec_tests_minimal//:test_data",
|
||||
],
|
||||
embed = [":go_default_library"],
|
||||
tags = ["spectest"],
|
||||
deps = [
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_ethereum_go_ethereum//common:go_default_library",
|
||||
"@com_github_go_yaml_yaml//:go_default_library",
|
||||
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
|
||||
],
|
||||
)
|
||||
@@ -20,6 +20,7 @@ go_library(
|
||||
"//fuzz:__pkg__",
|
||||
"//shared/interop:__pkg__",
|
||||
"//shared/testutil:__pkg__",
|
||||
"//spectest:__subpackages__",
|
||||
"//tools/benchmark-files-gen:__pkg__",
|
||||
"//tools/genesis-state-gen:__pkg__",
|
||||
"//tools/pcli:__pkg__",
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
|
||||
test_suite(
|
||||
name = "go_default_test",
|
||||
tags = ["spectest"],
|
||||
tests = [
|
||||
":go_mainnet_test",
|
||||
# Minimal tests must be run with --define ssz=minimal
|
||||
#":go_minimal_test",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_mainnet_test",
|
||||
size = "medium",
|
||||
srcs = glob(
|
||||
["*_test.go"],
|
||||
exclude = ["*_minimal_test.go"],
|
||||
),
|
||||
data = [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
],
|
||||
shard_count = 2,
|
||||
tags = ["spectest"],
|
||||
deps = [
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/core/state:go_default_library",
|
||||
"//beacon-chain/state/stateV0:go_default_library",
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//shared/featureconfig:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
||||
"@com_github_golang_snappy//:go_default_library",
|
||||
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",
|
||||
"@com_github_urfave_cli_v2//:go_default_library",
|
||||
"@in_gopkg_d4l3k_messagediff_v1//:go_default_library",
|
||||
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
# Requires --define ssz=minimal
|
||||
go_test(
|
||||
name = "go_minimal_test",
|
||||
size = "small",
|
||||
srcs = glob(
|
||||
["*_test.go"],
|
||||
exclude = ["*_mainnet_test.go"],
|
||||
),
|
||||
data = [
|
||||
"@eth2_spec_tests_minimal//:test_data",
|
||||
],
|
||||
tags = [
|
||||
"manual",
|
||||
"minimal",
|
||||
"spectest",
|
||||
],
|
||||
deps = [
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/core/state:go_default_library",
|
||||
"//beacon-chain/state/stateV0:go_default_library",
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//shared/featureconfig:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
||||
"@com_github_golang_snappy//:go_default_library",
|
||||
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",
|
||||
"@com_github_urfave_cli_v2//:go_default_library",
|
||||
"@in_gopkg_d4l3k_messagediff_v1//:go_default_library",
|
||||
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
|
||||
],
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
// Package spectest contains all conformity specification tests
|
||||
// for slot processing logic according to the eth2 beacon spec.
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSlotProcessingMainnet(t *testing.T) {
|
||||
runSlotProcessingTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package spectest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSlotProcessingMinimal(t *testing.T) {
|
||||
runSlotProcessingTests(t, "minimal")
|
||||
}
|
||||
@@ -5,7 +5,10 @@ go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["validator.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/validators",
|
||||
visibility = ["//beacon-chain:__subpackages__"],
|
||||
visibility = [
|
||||
"//beacon-chain:__subpackages__",
|
||||
"//spectest:__subpackages__",
|
||||
],
|
||||
deps = [
|
||||
"//beacon-chain/core/helpers:go_default_library",
|
||||
"//beacon-chain/state/interface:go_default_library",
|
||||
|
||||
@@ -13,6 +13,7 @@ go_library(
|
||||
"//shared/depositutil:__subpackages__",
|
||||
"//shared/testutil:__pkg__",
|
||||
"//slasher/rpc:__subpackages__",
|
||||
"//spectest:__subpackages__",
|
||||
"//tools/benchmark-files-gen:__pkg__",
|
||||
"//tools/pcli:__pkg__",
|
||||
],
|
||||
|
||||
@@ -40,6 +40,7 @@ go_library(
|
||||
"//shared/interop:__subpackages__",
|
||||
"//shared/testutil:__pkg__",
|
||||
"//slasher/rpc:__subpackages__",
|
||||
"//spectest:__subpackages__",
|
||||
"//tools/benchmark-files-gen:__pkg__",
|
||||
"//tools/pcli:__pkg__",
|
||||
],
|
||||
|
||||
@@ -35,7 +35,6 @@ go_test(
|
||||
name = "go_default_test",
|
||||
size = "small",
|
||||
srcs = [
|
||||
"ssz_static_test.go",
|
||||
"tags_test.go",
|
||||
],
|
||||
data = [
|
||||
@@ -51,71 +50,6 @@ go_test(
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//proto/validator/accounts/v2:go_default_library",
|
||||
"//shared/bytesutil:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/assert:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_golang_snappy//:go_default_library",
|
||||
"@com_github_ferranbt_fastssz//:go_default_library",
|
||||
"@com_github_ghodss_yaml//:go_default_library",
|
||||
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",
|
||||
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
# Requires --define ssz=minimal
|
||||
go_test(
|
||||
name = "go_minimal_test",
|
||||
size = "small",
|
||||
srcs = [
|
||||
"ssz_static_minimal_test.go",
|
||||
"ssz_static_test.go",
|
||||
],
|
||||
data = [
|
||||
"@eth2_spec_tests_minimal//:test_data",
|
||||
],
|
||||
tags = [
|
||||
"manual",
|
||||
"minimal",
|
||||
"spectest",
|
||||
],
|
||||
deps = [
|
||||
"//beacon-chain/state/stateV0:go_default_library",
|
||||
"//beacon-chain/state/stateutil:go_default_library",
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//proto/validator/accounts/v2:go_default_library",
|
||||
"//shared/bytesutil:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/assert:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
"@com_github_golang_snappy//:go_default_library",
|
||||
"@com_github_ferranbt_fastssz//:go_default_library",
|
||||
"@com_github_ghodss_yaml//:go_default_library",
|
||||
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",
|
||||
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_mainnet_test",
|
||||
size = "small",
|
||||
srcs = [
|
||||
"ssz_static_mainnet_test.go",
|
||||
"ssz_static_test.go",
|
||||
],
|
||||
data = [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
],
|
||||
tags = ["spectest"],
|
||||
deps = [
|
||||
"//beacon-chain/state/stateV0:go_default_library",
|
||||
"//beacon-chain/state/stateutil:go_default_library",
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//proto/validator/accounts/v2:go_default_library",
|
||||
"//shared/bytesutil:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"//shared/params/spectest:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"//shared/testutil/assert:go_default_library",
|
||||
"//shared/testutil/require:go_default_library",
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSZZStatic_Mainnet(t *testing.T) {
|
||||
runSSZStaticTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSSZStatic_Minimal(t *testing.T) {
|
||||
runSSZStaticTests(t, "minimal")
|
||||
}
|
||||
@@ -8,5 +8,8 @@ go_library(
|
||||
"interface.go",
|
||||
],
|
||||
importpath = "github.com/prysmaticlabs/prysm/shared/bls/common",
|
||||
visibility = ["//shared/bls:__subpackages__"],
|
||||
visibility = [
|
||||
"//shared/bls:__subpackages__",
|
||||
"//spectest:__subpackages__",
|
||||
],
|
||||
)
|
||||
|
||||
16
spectest/README.md
Normal file
16
spectest/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Spec Tests
|
||||
|
||||
Spec testing vectors: https://github.com/ethereum/eth2.0-spec-tests
|
||||
|
||||
To run all `mainnet` spec tests:
|
||||
|
||||
```bash
|
||||
bazel test //... --test_tag_filters=spectest
|
||||
```
|
||||
|
||||
Minimal tests require `--define ssz=minimal` setting and are not triggered
|
||||
automatically when `//...` is selected. One can run minimal tests manually, though:
|
||||
|
||||
```bash
|
||||
bazel query 'tests(attr("tags", "minimal, spectest", //...))' | xargs bazel test --define ssz=minimal
|
||||
```
|
||||
@@ -1,5 +1,5 @@
|
||||
load("@prysm//tools/go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
load("@prysm//tools/go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
@@ -7,11 +7,12 @@ go_library(
|
||||
srcs = [
|
||||
"aggregate_test.yaml.go",
|
||||
"aggregate_verify_test.yaml.go",
|
||||
"doc.go",
|
||||
"fast_aggregate_verify_test.yaml.go",
|
||||
"sign_test.yaml.go",
|
||||
"verify_test.yaml.go",
|
||||
],
|
||||
importpath = "github.com/prysmaticlabs/prysm/shared/bls/spectest",
|
||||
importpath = "github.com/prysmaticlabs/prysm/spectest/general/phase0/bls",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package spectest
|
||||
package bls
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
@@ -13,11 +13,11 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
||||
)
|
||||
|
||||
func TestAggregateYaml(t *testing.T) {
|
||||
t.Run("blst", testAggregateYaml)
|
||||
func TestAggregate(t *testing.T) {
|
||||
t.Run("blst", testAggregate)
|
||||
}
|
||||
|
||||
func testAggregateYaml(t *testing.T) {
|
||||
func testAggregate(t *testing.T) {
|
||||
testFolders, testFolderPath := testutil.TestFolders(t, "general", "phase0", "bls/aggregate/small")
|
||||
|
||||
for _, folder := range testFolders {
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by yaml_to_go. DO NOT EDIT.
|
||||
// source: aggregate.yaml
|
||||
|
||||
package spectest
|
||||
package bls
|
||||
|
||||
type AggregateTest struct {
|
||||
Input []string `json:"input"`
|
||||
@@ -1,4 +1,4 @@
|
||||
package spectest
|
||||
package bls
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
@@ -14,11 +14,11 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
||||
)
|
||||
|
||||
func TestAggregateVerifyYaml(t *testing.T) {
|
||||
t.Run("blst", testAggregateVerifyYaml)
|
||||
func TestAggregateVerify(t *testing.T) {
|
||||
t.Run("blst", testAggregateVerify)
|
||||
}
|
||||
|
||||
func testAggregateVerifyYaml(t *testing.T) {
|
||||
func testAggregateVerify(t *testing.T) {
|
||||
testFolders, testFolderPath := testutil.TestFolders(t, "general", "phase0", "bls/aggregate_verify/small")
|
||||
|
||||
for i, folder := range testFolders {
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by yaml_to_go. DO NOT EDIT.
|
||||
// source: aggregate_verify.yaml
|
||||
|
||||
package spectest
|
||||
package bls
|
||||
|
||||
type AggregateVerifyTest struct {
|
||||
Input struct {
|
||||
3
spectest/general/phase0/bls/doc.go
Normal file
3
spectest/general/phase0/bls/doc.go
Normal file
@@ -0,0 +1,3 @@
|
||||
// Package bls includes tests to ensure conformity with the eth2 BLS cryptography specification.
|
||||
// See https://github.com/ethereum/eth2.0-spec-tests/tree/master/tests/general/phase0/bls for details.
|
||||
package bls
|
||||
@@ -1,4 +1,4 @@
|
||||
package spectest
|
||||
package bls
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
@@ -14,11 +14,11 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
||||
)
|
||||
|
||||
func TestFastAggregateVerifyYaml(t *testing.T) {
|
||||
t.Run("blst", testFastAggregateVerifyYaml)
|
||||
func TestFastAggregateVerify(t *testing.T) {
|
||||
t.Run("blst", testFastAggregateVerify)
|
||||
}
|
||||
|
||||
func testFastAggregateVerifyYaml(t *testing.T) {
|
||||
func testFastAggregateVerify(t *testing.T) {
|
||||
testFolders, testFolderPath := testutil.TestFolders(t, "general", "phase0", "bls/fast_aggregate_verify/small")
|
||||
|
||||
for i, folder := range testFolders {
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by yaml_to_go. DO NOT EDIT.
|
||||
// source: fast_aggregate_verify.yaml
|
||||
|
||||
package spectest
|
||||
package bls
|
||||
|
||||
type FastAggregateVerifyTest struct {
|
||||
Input struct {
|
||||
@@ -1,6 +1,4 @@
|
||||
// Package spectest includes tests to ensure conformity with the eth2
|
||||
// bls cryptography specification.
|
||||
package spectest
|
||||
package bls
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -16,11 +14,11 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
||||
)
|
||||
|
||||
func TestSignMessageYaml(t *testing.T) {
|
||||
t.Run("blst", testSignMessageYaml)
|
||||
func TestSign(t *testing.T) {
|
||||
t.Run("blst", testSign)
|
||||
}
|
||||
|
||||
func testSignMessageYaml(t *testing.T) {
|
||||
func testSign(t *testing.T) {
|
||||
testFolders, testFolderPath := testutil.TestFolders(t, "general", "phase0", "bls/sign/small")
|
||||
|
||||
for i, folder := range testFolders {
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by yaml_to_go. DO NOT EDIT.
|
||||
// source: sign_msg.yaml
|
||||
|
||||
package spectest
|
||||
package bls
|
||||
|
||||
type SignMsgTest struct {
|
||||
Input struct {
|
||||
@@ -1,4 +1,4 @@
|
||||
package spectest
|
||||
package bls
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
@@ -13,11 +13,11 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
||||
)
|
||||
|
||||
func TestVerifyMessageYaml(t *testing.T) {
|
||||
t.Run("blst", testVerifyMessageYaml)
|
||||
func TestVerify(t *testing.T) {
|
||||
t.Run("blst", testVerify)
|
||||
}
|
||||
|
||||
func testVerifyMessageYaml(t *testing.T) {
|
||||
func testVerify(t *testing.T) {
|
||||
testFolders, testFolderPath := testutil.TestFolders(t, "general", "phase0", "bls/verify/small")
|
||||
|
||||
for i, folder := range testFolders {
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by yaml_to_go. DO NOT EDIT.
|
||||
// source: verify.yaml
|
||||
|
||||
package spectest
|
||||
package bls
|
||||
|
||||
type VerifyMsgTest struct {
|
||||
Input struct {
|
||||
28
spectest/mainnet/phase0/epoch_processing/BUILD.bazel
Normal file
28
spectest/mainnet/phase0/epoch_processing/BUILD.bazel
Normal file
@@ -0,0 +1,28 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
size = "small",
|
||||
srcs = [
|
||||
"effective_balance_updates_test.go",
|
||||
"epoch_processing_test.go",
|
||||
"eth1_data_reset_test.go",
|
||||
"historical_roots_update_test.go",
|
||||
"justification_and_finalization_test.go",
|
||||
"participation_record_updates_test.go",
|
||||
"randao_mixes_reset_test.go",
|
||||
"registry_test.go",
|
||||
"rewards_and_penalties_test.go",
|
||||
"slashings_reset_test.go",
|
||||
"slashings_test.go",
|
||||
],
|
||||
data = glob(["*.yaml"]) + [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = ["spectest"],
|
||||
deps = [
|
||||
"//shared/params:go_default_library",
|
||||
"//spectest/shared/phase0/epoch_processing:go_default_library",
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_EpochProcessing_EffectiveBalanceUpdates(t *testing.T) {
|
||||
epoch_processing.RunEffectiveBalanceUpdatesTests(t, "mainnet")
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package spectest
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_EpochProcessing_Eth1DataReset(t *testing.T) {
|
||||
epoch_processing.RunEth1DataResetTests(t, "mainnet")
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_EpochProcessing_HistoricalRootsUpdate(t *testing.T) {
|
||||
epoch_processing.RunHistoricalRootsUpdateTests(t, "mainnet")
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_EpochProcessing_JustificationAndFinalization(t *testing.T) {
|
||||
epoch_processing.RunJustificationAndFinalizationTests(t, "mainnet")
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_EpochProcessing_ParticipationRecordUpdates(t *testing.T) {
|
||||
epoch_processing.RunParticipationRecordUpdatesTests(t, "mainnet")
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_EpochProcessing_RandaoMixesReset(t *testing.T) {
|
||||
epoch_processing.RunRandaoMixesResetTests(t, "mainnet")
|
||||
}
|
||||
11
spectest/mainnet/phase0/epoch_processing/registry_test.go
Normal file
11
spectest/mainnet/phase0/epoch_processing/registry_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_EpochProcessing_ResetRegistryUpdates(t *testing.T) {
|
||||
epoch_processing.RunRegistryUpdatesTests(t, "mainnet")
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_EpochProcessing_RewardsAndPenalties(t *testing.T) {
|
||||
epoch_processing.RunRewardsAndPenaltiesTests(t, "mainnet")
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_EpochProcessing_SlashingsReset(t *testing.T) {
|
||||
epoch_processing.RunSlashingsResetTests(t, "mainnet")
|
||||
}
|
||||
11
spectest/mainnet/phase0/epoch_processing/slashings_test.go
Normal file
11
spectest/mainnet/phase0/epoch_processing/slashings_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_EpochProcessing_Slashings(t *testing.T) {
|
||||
epoch_processing.RunSlashingsTests(t, "mainnet")
|
||||
}
|
||||
20
spectest/mainnet/phase0/operations/BUILD.bazel
Normal file
20
spectest/mainnet/phase0/operations/BUILD.bazel
Normal file
@@ -0,0 +1,20 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
size = "small",
|
||||
srcs = [
|
||||
"attestation_test.go",
|
||||
"attester_slashing_test.go",
|
||||
"block_header_test.go",
|
||||
"deposit_test.go",
|
||||
"proposer_slashing_test.go",
|
||||
"voluntary_exit_test.go",
|
||||
],
|
||||
data = glob(["*.yaml"]) + [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = ["spectest"],
|
||||
deps = ["//spectest/shared/phase0/operations:go_default_library"],
|
||||
)
|
||||
11
spectest/mainnet/phase0/operations/attestation_test.go
Normal file
11
spectest/mainnet/phase0/operations/attestation_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package operations
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/operations"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_Operations_Attestation(t *testing.T) {
|
||||
operations.RunAttestationTest(t, "mainnet")
|
||||
}
|
||||
11
spectest/mainnet/phase0/operations/attester_slashing_test.go
Normal file
11
spectest/mainnet/phase0/operations/attester_slashing_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package operations
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/operations"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_Operations_AttesterSlashing(t *testing.T) {
|
||||
operations.RunAttesterSlashingTest(t, "mainnet")
|
||||
}
|
||||
11
spectest/mainnet/phase0/operations/block_header_test.go
Normal file
11
spectest/mainnet/phase0/operations/block_header_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package operations
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/operations"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_Operations_BlockHeader(t *testing.T) {
|
||||
operations.RunBlockHeaderTest(t, "mainnet")
|
||||
}
|
||||
11
spectest/mainnet/phase0/operations/deposit_test.go
Normal file
11
spectest/mainnet/phase0/operations/deposit_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package operations
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/operations"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_Operations_Deposit(t *testing.T) {
|
||||
operations.RunDepositTest(t, "mainnet")
|
||||
}
|
||||
11
spectest/mainnet/phase0/operations/proposer_slashing_test.go
Normal file
11
spectest/mainnet/phase0/operations/proposer_slashing_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package operations
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/operations"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_Operations_ProposerSlashing(t *testing.T) {
|
||||
operations.RunProposerSlashingTest(t, "mainnet")
|
||||
}
|
||||
11
spectest/mainnet/phase0/operations/voluntary_exit_test.go
Normal file
11
spectest/mainnet/phase0/operations/voluntary_exit_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package operations
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/operations"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_Operations_VoluntaryExit(t *testing.T) {
|
||||
operations.RunVoluntaryExitTest(t, "mainnet")
|
||||
}
|
||||
12
spectest/mainnet/phase0/rewards/BUILD.bazel
Normal file
12
spectest/mainnet/phase0/rewards/BUILD.bazel
Normal file
@@ -0,0 +1,12 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
size = "small",
|
||||
srcs = ["rewards_test.go"],
|
||||
data = glob(["*.yaml"]) + [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
],
|
||||
tags = ["spectest"],
|
||||
deps = ["//spectest/shared/phase0/rewards:go_default_library"],
|
||||
)
|
||||
11
spectest/mainnet/phase0/rewards/rewards_test.go
Normal file
11
spectest/mainnet/phase0/rewards/rewards_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package rewards
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/rewards"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_Rewards(t *testing.T) {
|
||||
rewards.RunPrecomputeRewardsAndPenaltiesTests(t, "mainnet")
|
||||
}
|
||||
15
spectest/mainnet/phase0/sanity/BUILD.bazel
Normal file
15
spectest/mainnet/phase0/sanity/BUILD.bazel
Normal file
@@ -0,0 +1,15 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
size = "small",
|
||||
srcs = [
|
||||
"blocks_test.go",
|
||||
"slots_test.go",
|
||||
],
|
||||
data = glob(["*.yaml"]) + [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
],
|
||||
tags = ["spectest"],
|
||||
deps = ["//spectest/shared/phase0/sanity:go_default_library"],
|
||||
)
|
||||
11
spectest/mainnet/phase0/sanity/blocks_test.go
Normal file
11
spectest/mainnet/phase0/sanity/blocks_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package sanity
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/sanity"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_Sanity_Blocks(t *testing.T) {
|
||||
sanity.RunBlockProcessingTest(t, "mainnet")
|
||||
}
|
||||
11
spectest/mainnet/phase0/sanity/slots_test.go
Normal file
11
spectest/mainnet/phase0/sanity/slots_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package sanity
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/sanity"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_Sanity_Slots(t *testing.T) {
|
||||
sanity.RunSlotProcessingTests(t, "mainnet")
|
||||
}
|
||||
12
spectest/mainnet/phase0/shuffling/core/shuffle/BUILD.bazel
Normal file
12
spectest/mainnet/phase0/shuffling/core/shuffle/BUILD.bazel
Normal file
@@ -0,0 +1,12 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
size = "small",
|
||||
srcs = ["shuffle_test.go"],
|
||||
data = glob(["*.yaml"]) + [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
],
|
||||
tags = ["spectest"],
|
||||
deps = ["//spectest/shared/phase0/shuffling/core/shuffle:go_default_library"],
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
package shuffle
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/shuffling/core/shuffle"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_Shuffling_Core_Shuffle(t *testing.T) {
|
||||
shuffle.RunShuffleTests(t, "mainnet")
|
||||
}
|
||||
12
spectest/mainnet/phase0/ssz_static/BUILD.bazel
Normal file
12
spectest/mainnet/phase0/ssz_static/BUILD.bazel
Normal file
@@ -0,0 +1,12 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
size = "small",
|
||||
srcs = ["ssz_static_test.go"],
|
||||
data = glob(["*.yaml"]) + [
|
||||
"@eth2_spec_tests_mainnet//:test_data",
|
||||
],
|
||||
tags = ["spectest"],
|
||||
deps = ["//spectest/shared/phase0/ssz_static:go_default_library"],
|
||||
)
|
||||
11
spectest/mainnet/phase0/ssz_static/ssz_static_test.go
Normal file
11
spectest/mainnet/phase0/ssz_static/ssz_static_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package ssz_static
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/ssz_static"
|
||||
)
|
||||
|
||||
func TestMainnet_Phase0_SSZStatic(t *testing.T) {
|
||||
ssz_static.RunSSZStaticTests(t, "mainnet")
|
||||
}
|
||||
32
spectest/minimal/phase0/epoch_processing/BUILD.bazel
Normal file
32
spectest/minimal/phase0/epoch_processing/BUILD.bazel
Normal file
@@ -0,0 +1,32 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_test")
|
||||
|
||||
# Requires --define ssz=minimal
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
size = "small",
|
||||
srcs = [
|
||||
"effective_balance_updates_test.go",
|
||||
"epoch_processing_test.go",
|
||||
"eth1_data_reset_test.go",
|
||||
"historical_roots_update_test.go",
|
||||
"justification_and_finalization_test.go",
|
||||
"participation_record_updates_test.go",
|
||||
"randao_mixes_reset_test.go",
|
||||
"registry_test.go",
|
||||
"rewards_and_penalties_test.go",
|
||||
"slashings_reset_test.go",
|
||||
"slashings_test.go",
|
||||
],
|
||||
data = glob(["*.yaml"]) + [
|
||||
"@eth2_spec_tests_minimal//:test_data",
|
||||
],
|
||||
tags = [
|
||||
"manual",
|
||||
"minimal",
|
||||
"spectest",
|
||||
],
|
||||
deps = [
|
||||
"//shared/params:go_default_library",
|
||||
"//spectest/shared/phase0/epoch_processing:go_default_library",
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMinimal_Phase0_EpochProcessing_EffectiveBalanceUpdates(t *testing.T) {
|
||||
epoch_processing.RunEffectiveBalanceUpdatesTests(t, "minimal")
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
prevConfig := params.BeaconConfig().Copy()
|
||||
defer params.OverrideBeaconConfig(prevConfig)
|
||||
c := params.BeaconConfig()
|
||||
c.MinGenesisActiveValidatorCount = 16384
|
||||
params.OverrideBeaconConfig(c)
|
||||
|
||||
m.Run()
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package epoch_processing
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/spectest/shared/phase0/epoch_processing"
|
||||
)
|
||||
|
||||
func TestMinimal_Phase0_EpochProcessing_Eth1DataReset(t *testing.T) {
|
||||
epoch_processing.RunEth1DataResetTests(t, "minimal")
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user