File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,20 @@ func (cfg *Config) Check() error {
47
47
48
48
// provide dummy values to eigenda client config. Since the client won't be called in this
49
49
// mode it doesn't matter.
50
- if cfg .MemstoreEnabled || ! cfg . VerifierConfig . VerifyCerts {
50
+ if cfg .MemstoreEnabled {
51
51
cfg .EdaClientConfig .SvcManagerAddr = "0x0000000000000000000000000000000000000000"
52
52
cfg .EdaClientConfig .EthRpcUrl = "http://0.0.0.0:666"
53
53
}
54
54
55
+ if ! cfg .MemstoreEnabled {
56
+ if cfg .EdaClientConfig .SvcManagerAddr == "" {
57
+ return fmt .Errorf ("service manager address is required for communication with EigenDA" )
58
+ }
59
+ if cfg .EdaClientConfig .EthRpcUrl == "" {
60
+ return fmt .Errorf ("eth prc url is required for communication with EigenDA" )
61
+ }
62
+ }
63
+
55
64
// cert verification is enabled
56
65
// TODO: move this verification logic to verify/cli.go
57
66
if cfg .VerifierConfig .VerifyCerts {
Original file line number Diff line number Diff line change @@ -90,8 +90,7 @@ func TestConfigVerification(t *testing.T) {
90
90
require .Error (t , err )
91
91
})
92
92
93
- t .Run ("EigenDAClientFieldsAreDefaultSetWhenCertVerifierDisabled" , func (t * testing.T ) {
94
- // 1 - memstore
93
+ t .Run ("EigenDAClientFieldsAreDefaultSetWhenMemStoreEnabled" , func (t * testing.T ) {
95
94
cfg := validCfg ()
96
95
cfg .MemstoreEnabled = true
97
96
cfg .VerifierConfig .VerifyCerts = false
@@ -102,18 +101,16 @@ func TestConfigVerification(t *testing.T) {
102
101
require .NoError (t , err )
103
102
require .True (t , len (cfg .EdaClientConfig .EthRpcUrl ) > 1 )
104
103
require .True (t , len (cfg .EdaClientConfig .SvcManagerAddr ) > 1 )
104
+ })
105
105
106
- // 2 - cert verification disabled
107
- cfg = validCfg ()
106
+ t . Run ( "FailWhenEigenDAClientFieldsAreUnsetAndMemStoreDisabled" , func ( t * testing. T ) {
107
+ cfg : = validCfg ()
108
108
cfg .MemstoreEnabled = false
109
- cfg .VerifierConfig .VerifyCerts = false
110
109
cfg .VerifierConfig .RPCURL = ""
111
110
cfg .VerifierConfig .SvcManagerAddr = ""
112
111
113
- err = cfg .Check ()
114
- require .NoError (t , err )
115
- require .True (t , len (cfg .EdaClientConfig .EthRpcUrl ) > 1 )
116
- require .True (t , len (cfg .EdaClientConfig .SvcManagerAddr ) > 1 )
112
+ err := cfg .Check ()
113
+ require .Error (t , err )
117
114
})
118
115
})
119
116
You can’t perform that action at this time.
0 commit comments