@@ -49,7 +49,7 @@ func TestReadConfigSidecar(t *testing.T) {
4949 ChannelID : "mychannel" ,
5050 },
5151 Committer : sidecar.CoordinatorConfig {
52- Endpoint : * makeEndpoint ("localhost" , 9001 ),
52+ Config : makeClientConfig ("localhost" , 9001 ),
5353 },
5454 Ledger : sidecar.LedgerConfig {
5555 Path : "./ledger/" ,
@@ -84,7 +84,7 @@ func TestReadConfigSidecar(t *testing.T) {
8484 ChannelID : "mychannel" ,
8585 },
8686 Committer : sidecar.CoordinatorConfig {
87- Endpoint : * makeEndpoint ("coordinator" , 9001 ),
87+ Config : makeClientConfig ("coordinator" , 9001 ),
8888 },
8989 Ledger : sidecar.LedgerConfig {
9090 Path : "/root/sc/ledger" ,
@@ -128,14 +128,10 @@ func TestReadConfigCoordinator(t *testing.T) {
128128 name : "sample" ,
129129 configFilePath : "samples/coordinator.yaml" ,
130130 expectedConfig : & coordinator.Config {
131- Server : makeServer ("" , 9001 ),
132- Monitoring : makeMonitoring ("" , 2119 ),
133- VerifierConfig : connection.ClientConfig {
134- Endpoints : []* connection.Endpoint {makeEndpoint ("signature-verifier" , 5001 )},
135- },
136- ValidatorCommitterConfig : connection.ClientConfig {
137- Endpoints : []* connection.Endpoint {makeEndpoint ("validator-persister" , 6001 )},
138- },
131+ Server : makeServer ("" , 9001 ),
132+ Monitoring : makeMonitoring ("" , 2119 ),
133+ VerifierConfig : * makeClientConfig ("signature-verifier" , 5001 ),
134+ ValidatorCommitterConfig : * makeClientConfig ("validator-persister" , 6001 ),
139135 DependencyGraphConfig : & coordinator.DependencyGraphConfig {
140136 NumOfLocalDepConstructors : 1 ,
141137 WaitingTxsLimit : 10_000 ,
@@ -334,7 +330,7 @@ func TestReadConfigLoadGen(t *testing.T) {
334330 },
335331 Adapter : adapters.AdapterConfig {
336332 OrdererClient : & adapters.OrdererClientConfig {
337- SidecarEndpoint : makeEndpoint ("sidecar" , 4001 ),
333+ SidecarConfig : makeClientConfig ("sidecar" , 4001 ),
338334 Orderer : broadcastdeliver.Config {
339335 Connection : broadcastdeliver.ConnectionConfig {
340336 Endpoints : connection .NewOrdererEndpoints (
@@ -438,10 +434,11 @@ func defaultSampleDBConfig() *vc.DatabaseConfig {
438434 }
439435}
440436
441- func makeEndpoint (host string , port int ) * connection.Endpoint {
442- return & connection.Endpoint {
443- Host : host ,
444- Port : port ,
437+ func makeClientConfig (host string , port int ) * connection.ClientConfig {
438+ return & connection.ClientConfig {
439+ Endpoints : []* connection.Endpoint {
440+ makeEndpoint (host , port ),
441+ },
445442 }
446443}
447444
@@ -451,6 +448,13 @@ func makeServer(host string, port int) *connection.ServerConfig {
451448 }
452449}
453450
451+ func makeEndpoint (host string , port int ) * connection.Endpoint {
452+ return & connection.Endpoint {
453+ Host : host ,
454+ Port : port ,
455+ }
456+ }
457+
454458func makeMonitoring (host string , port int ) monitoring.Config {
455459 return monitoring.Config {Server : makeServer (host , port )}
456460}
0 commit comments