Commit 2698fe83 authored by Sabnock01's avatar Sabnock01

fix: signer config tests

parent bb56249f
......@@ -5,6 +5,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/urfave/cli/v2"
optls "github.com/ethereum-optimism/optimism/op-service/tls"
)
func TestDefaultCLIOptionsMatchDefaultConfig(t *testing.T) {
......@@ -22,26 +24,26 @@ func TestInvalidConfig(t *testing.T) {
tests := []struct {
name string
expected string
configChange func(config *CLIConfig)
configChange func(config *optls.SignerCLIConfig)
}{
{
name: "MissingEndpoint",
expected: "signer endpoint and address must both be set or not set",
configChange: func(config *CLIConfig) {
configChange: func(config *optls.SignerCLIConfig) {
config.Address = "0x1234"
},
},
{
name: "MissingAddress",
expected: "signer endpoint and address must both be set or not set",
configChange: func(config *CLIConfig) {
configChange: func(config *optls.SignerCLIConfig) {
config.Endpoint = "http://localhost"
},
},
{
name: "InvalidTLSConfig",
expected: "all tls flags must be set if at least one is set",
configChange: func(config *CLIConfig) {
configChange: func(config *optls.SignerCLIConfig) {
config.TLSConfig.TLSKey = ""
},
},
......@@ -56,11 +58,11 @@ func TestInvalidConfig(t *testing.T) {
}
}
func configForArgs(args ...string) CLIConfig {
func configForArgs(args ...string) optls.SignerCLIConfig {
app := cli.NewApp()
app.Flags = CLIFlags("TEST_")
app.Name = "test"
var config CLIConfig
var config optls.SignerCLIConfig
app.Action = func(ctx *cli.Context) error {
config = ReadCLIConfig(ctx)
return nil
......
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