Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
fix weak test code
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp committed Jan 22, 2024
1 parent 3f8c3a4 commit 9808160
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions prover/prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,15 @@ func (s *ProverTestSuite) TestContestWrongBlocks() {
close(sink)
}()

// Contest the transition.
contestedSink := make(chan *bindings.TaikoL1ClientTransitionContested, 3)
contestedSub, err := s.p.rpc.TaikoL1.WatchTransitionContested(nil, contestedSink, nil)
s.Nil(err)
defer func() {
contestedSub.Unsubscribe()
close(contestedSink)
}()

s.Nil(s.p.proveOp())
proofWithHeader := <-s.p.proofGenerationCh
proofWithHeader.Opts.BlockHash = testutils.RandomHash()
Expand All @@ -271,15 +280,6 @@ func (s *ProverTestSuite) TestContestWrongBlocks() {
s.NotEqual(header.Hash(), common.BytesToHash(event.Tran.BlockHash[:]))
s.Equal(header.ParentHash, common.BytesToHash(event.Tran.ParentHash[:]))

// Contest the transition.
contestedSink := make(chan *bindings.TaikoL1ClientTransitionContested)
contestedSub, err := s.p.rpc.TaikoL1.WatchTransitionContested(nil, contestedSink, nil)
s.Nil(err)
defer func() {
contestedSub.Unsubscribe()
close(contestedSink)
}()

s.Greater(header.Number.Uint64(), uint64(0))
s.Nil(s.p.onTransitionProved(context.Background(), event))

Expand Down

0 comments on commit 9808160

Please sign in to comment.