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

Commit

Permalink
test: more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Oct 29, 2023
1 parent 2024772 commit a2c6537
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions prover/proof_producer/zkevm_rpcd_producer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,29 @@ func TestNewZkevmRpcdProducer(t *testing.T) {

require.Nil(t, dummyZkevmRpcdProducer.Cancel(context.Background(), common.Big1))
}

func TestZkevmRpcdProducerCalls(t *testing.T) {
dummyZkevmRpcdProducer, err := NewZkevmRpcdProducer(
"",
"",
"",
"",
false,
&bindings.TaikoDataConfig{
BlockMaxGasLimit: uint32(randHash().Big().Uint64()),
BlockMaxTxListBytes: randHash().Big(),
},
)
require.Nil(t, err)
require.False(t, dummyZkevmRpcdProducer.Cancellable())

dummyZkevmRpcdProducer.CustomProofHook = func() ([]byte, uint64, error) {
return []byte{0}, CircuitsIdx, nil
}

ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
_, _, err = dummyZkevmRpcdProducer.callProverDaemon(ctx, &ProofRequestOptions{BlockID: common.Big32})

require.Nil(t, err)
}
5 changes: 5 additions & 0 deletions prover/prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ func (s *ProverTestSuite) TestGetSubmitterByTier() {
submitter := s.p.getSubmitterByTier(encoding.TierGuardianID)
s.NotNil(submitter)
s.Equal(encoding.TierGuardianID, submitter.Tier())
s.Nil(s.p.getSubmitterByTier(encoding.TierGuardianID + 1))
}

func (s *ProverTestSuite) TestGetProvingWindowNotFound() {
Expand Down Expand Up @@ -352,6 +353,10 @@ func (s *ProverTestSuite) TestProveOp() {
s.Equal(header.ParentHash, common.BytesToHash(event.ParentHash[:]))
}

func (s *ProverTestSuite) TestReleaseOneCapacity() {
s.NotPanics(func() { s.p.releaseOneCapacity(common.Big1) })
}

func (s *ProverTestSuite) TestStartSubscription() {
s.NotPanics(s.p.initSubscription)
s.NotPanics(s.p.closeSubscription)
Expand Down

0 comments on commit a2c6537

Please sign in to comment.