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

op-proposer: Reorganize packge

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