Fix proposer slashing context timeout test (#6379)

* Fix proposer slashing context timeout test
* goimports
* revert slashing change
* Merge branch 'master' into fix_proposer_slashing_test
This commit is contained in:
Shay Zluf 2020-06-24 15:10:40 +03:00 committed by GitHub
parent edb08bd209
commit b8e1bf0445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,7 @@ import (
pubsub "github.com/libp2p/go-libp2p-pubsub"
pubsubpb "github.com/libp2p/go-libp2p-pubsub/pb"
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
"github.com/prysmaticlabs/go-bitfield"
mock "github.com/prysmaticlabs/prysm/beacon-chain/blockchain/testing"
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/beacon-chain/p2p"
@ -169,7 +170,14 @@ func TestValidateProposerSlashing_ContextTimeout(t *testing.T) {
slashing, state := setupValidProposerSlashing(t)
slashing.Header_1.Header.Slot = 100000000
err := state.SetJustificationBits(bitfield.Bitvector4{0x0F}) // 0b1111
if err != nil {
t.Fatal(err)
}
err = state.SetPreviousJustifiedCheckpoint(&ethpb.Checkpoint{Epoch: 0, Root: []byte{}})
if err != nil {
t.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
defer cancel()