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

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp committed Jan 18, 2024
1 parent 716259b commit b0491f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 4 additions & 1 deletion prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) {
}

p.proverAddress = crypto.PubkeyToAddress(p.cfg.L1ProverPrivKey.PublicKey)

chBufferSize := p.protocolConfigs.BlockMaxProposals
p.proofGenerationCh = make(chan *proofProducer.ProofWithHeader, chBufferSize)
p.proofWindowExpiredCh = make(chan *bindings.TaikoL1ClientBlockProposed, chBufferSize)
p.proveNotify = make(chan struct{}, 1)

if err := p.initL1Current(cfg.StartingBlockID); err != nil {
Expand Down Expand Up @@ -439,7 +443,6 @@ func (p *Prover) eventLoop() {
blockVerifiedSub := rpc.SubscribeBlockVerified(p.rpc.TaikoL1, blockVerifiedCh)
transitionProvedSub := rpc.SubscribeTransitionProved(p.rpc.TaikoL1, transitionProvedCh)
transitionContestedSub := rpc.SubscribeTransitionContested(p.rpc.TaikoL1, transitionContestedCh)

defer func() {
blockProposedSub.Unsubscribe()
blockVerifiedSub.Unsubscribe()
Expand Down
5 changes: 0 additions & 5 deletions prover/prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,6 @@ func (s *ProverTestSuite) TestProveOp() {
s.Equal(header.ParentHash, common.BytesToHash(event.Tran.ParentHash[:]))
}

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

func (s *ProverTestSuite) TestSetApprovalAmount() {
opts, err := bind.NewKeyedTransactorWithChainID(s.p.proverPrivateKey, s.p.rpc.L1ChainID)
s.Nil(err)
Expand Down

0 comments on commit b0491f9

Please sign in to comment.