mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-05 03:23:46 +00:00
* add nccc docker * update mock ccc * update * update * update * format codes --------- Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
34 lines
782 B
Go
34 lines
782 B
Go
//go:build !circuit_capacity_checker
|
|
|
|
package circuitcapacitychecker
|
|
|
|
import (
|
|
"math/rand"
|
|
|
|
"github.com/scroll-tech/go-ethereum/core/types"
|
|
)
|
|
|
|
type CircuitCapacityChecker struct {
|
|
ID uint64
|
|
}
|
|
|
|
func NewCircuitCapacityChecker() *CircuitCapacityChecker {
|
|
return &CircuitCapacityChecker{ID: rand.Uint64()}
|
|
}
|
|
|
|
func (ccc *CircuitCapacityChecker) Reset() {
|
|
}
|
|
|
|
func (ccc *CircuitCapacityChecker) ApplyTransaction(traces *types.BlockTrace) (*types.RowConsumption, error) {
|
|
return &types.RowConsumption{types.SubCircuitRowUsage{
|
|
Name: "mock",
|
|
RowNumber: 1,
|
|
}}, nil
|
|
}
|
|
|
|
func (ccc *CircuitCapacityChecker) ApplyBlock(traces *types.BlockTrace) (*types.RowConsumption, error) {
|
|
return &types.RowConsumption{types.SubCircuitRowUsage{
|
|
Name: "mock",
|
|
RowNumber: 2,
|
|
}}, nil
|
|
}
|