Commit 740e63d1 authored by Joshua Gutow's avatar Joshua Gutow

op-proposer: Reorganize packge

parent 36245294
......@@ -6,8 +6,8 @@ import (
"github.com/urfave/cli"
proposer "github.com/ethereum-optimism/optimism/op-proposer"
"github.com/ethereum-optimism/optimism/op-proposer/flags"
"github.com/ethereum-optimism/optimism/op-proposer/proposer"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
"github.com/ethereum/go-ethereum/log"
)
......@@ -26,8 +26,7 @@ func main() {
app.Version = fmt.Sprintf("%s-%s-%s", Version, GitCommit, GitDate)
app.Name = "op-proposer"
app.Usage = "L2Output Submitter"
app.Description = "Service for generating and submitting L2 Output " +
"checkpoints to the L2OutputOracle contract"
app.Description = "Service for generating and submitting L2 Output checkpoints to the L2OutputOracle contract"
app.Action = proposer.Main(Version)
err := app.Run(os.Args)
......
package op_proposer
package proposer
import (
"time"
......
package l2output
package proposer
import (
"context"
......@@ -22,7 +22,7 @@ import (
var bigOne = big.NewInt(1)
var supportedL2OutputVersion = eth.Bytes32{}
type Config struct {
type DriverConfig struct {
Log log.Logger
Name string
......@@ -48,14 +48,14 @@ type Config struct {
}
type Driver struct {
cfg Config
cfg DriverConfig
l2ooContract *bindings.L2OutputOracle
rawL2ooContract *bind.BoundContract
walletAddr common.Address
l log.Logger
}
func NewDriver(cfg Config) (*Driver, error) {
func NewDriver(cfg DriverConfig) (*Driver, error) {
l2ooContract, err := bindings.NewL2OutputOracle(cfg.L2OOAddr, cfg.L1Client)
if err != nil {
return nil, err
......
package op_proposer
package proposer
import (
"context"
......@@ -25,7 +25,6 @@ import (
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-proposer/drivers/l2output"
"github.com/ethereum-optimism/optimism/op-proposer/txmgr"
opcrypto "github.com/ethereum-optimism/optimism/op-service/crypto"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
......@@ -210,7 +209,7 @@ func NewL2OutputSubmitterWithSigner(
SafeAbortNonceTooLowCount: cfg.SafeAbortNonceTooLowCount,
}
l2OutputDriver, err := l2output.NewDriver(l2output.Config{
l2OutputDriver, err := NewDriver(DriverConfig{
Log: l,
Name: "L2Output Submitter",
L1Client: l1Client,
......
package op_proposer
package proposer
import (
"context"
......@@ -13,9 +13,9 @@ import (
"github.com/ethereum/go-ethereum/log"
)
// Driver is an interface for creating and submitting transactions for a
// DriverInterface is an interface for creating and submitting transactions for a
// specific contract.
type Driver interface {
type DriverInterface interface {
// Name is an identifier used to prefix logs for a particular service.
Name() string
......@@ -53,7 +53,7 @@ type Driver interface {
type ServiceConfig struct {
Log log.Logger
Context context.Context
Driver Driver
Driver DriverInterface
PollInterval time.Duration
L1Client *ethclient.Client
TxManagerConfig txmgr.Config
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment