fix : runtime testcases

This commit is contained in:
Shivam Sharma 2023-06-26 12:54:08 +05:30
parent 43e114beda
commit 64486d0a82
3 changed files with 12 additions and 11 deletions

View file

@ -420,6 +420,7 @@ func (pool *TxPool) loop() {
// Handle stats reporting ticks
case <-report.C:
pool.mu.RLock()
pending, queued := pool.stats()
pool.mu.RUnlock()
stales := int(pool.priced.stales.Load())

View file

@ -189,8 +189,6 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
gpoParams.Default = config.Miner.GasPrice
}
ethereum.APIBackend.gpo = gasprice.NewOracle(ethereum.APIBackend, gpoParams)
// Override the chain config with provided settings.
var overrides core.ChainOverrides
if config.OverrideShanghai != nil {
@ -258,6 +256,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
ethereum.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, config.Genesis, &overrides, ethereum.engine, vmConfig, ethereum.shouldPreserve, &config.TxLookupLimit, checker)
}
ethereum.APIBackend.gpo = gasprice.NewOracle(ethereum.APIBackend, gpoParams)
if err != nil {
return nil, err
}
@ -530,17 +530,17 @@ func (s *Ethereum) StartMining(threads int) error {
cli.Authorize(eb, wallet.SignData)
}
}
if bor, ok := s.engine.(*bor.Bor); ok {
wallet, err := s.accountManager.Find(accounts.Account{Address: eb})
if wallet == nil || err != nil {
log.Error("Etherbase account unavailable locally", "err", err)
if bor, ok := s.engine.(*bor.Bor); ok {
wallet, err := s.accountManager.Find(accounts.Account{Address: eb})
if wallet == nil || err != nil {
log.Error("Etherbase account unavailable locally", "err", err)
return fmt.Errorf("signer missing: %v", err)
return fmt.Errorf("signer missing: %v", err)
}
bor.Authorize(eb, wallet.SignData)
}
bor.Authorize(eb, wallet.SignData)
}
// If mining is started, we can disable the transaction rejection mechanism

View file

@ -1678,7 +1678,7 @@ func (w *worker) commitWork(ctx context.Context, interrupt *atomic.Int32, noempt
}()
if !noempty && w.interruptCommitFlag {
block := w.chain.GetBlockByHash(w.chain.CurrentBlock().TxHash)
block := w.chain.GetBlockByHash(w.chain.CurrentBlock().Hash())
interruptCtx, stopFn = getInterruptTimer(ctx, work, block)
// nolint : staticcheck
interruptCtx = vm.PutCache(interruptCtx, w.interruptedTxCache)