@@ -56,6 +56,8 @@ let gatewayRunner: SATPGatewayRunner;
56
56
57
57
const testNetwork = "test-network" ;
58
58
59
+ const gatewayAddress = "gateway.satp-hermes" ;
60
+
59
61
afterAll ( async ( ) => {
60
62
await gatewayRunner . stop ( ) ;
61
63
await gatewayRunner . destroy ( ) ;
@@ -152,7 +154,7 @@ describe("SATPGateway sending a token from Besu to Fabric", () => {
152
154
) ;
153
155
} ) ;
154
156
it ( "should realize a transfer" , async ( ) => {
155
- const address : Address = `http://localhost ` ;
157
+ const address : Address = `http://${ gatewayAddress } ` ;
156
158
157
159
// gateway setup:
158
160
const gatewayIdentity = {
@@ -199,17 +201,18 @@ describe("SATPGateway sending a token from Besu to Fabric", () => {
199
201
logsPath : files . logsPath ,
200
202
ontologiesPath : files . ontologiesPath ,
201
203
networkName : testNetwork ,
204
+ url : gatewayAddress ,
202
205
} ;
203
206
204
207
gatewayRunner = new SATPGatewayRunner ( gatewayRunnerOptions ) ;
205
208
log . debug ( "starting gatewayRunner..." ) ;
206
209
await gatewayRunner . start ( false ) ;
207
210
log . debug ( "gatewayRunner started sucessfully" ) ;
208
211
209
- const port = await gatewayRunner . getHostPort ( DEFAULT_PORT_GATEWAY_OAPI ) ;
210
-
211
212
const approveAddressApi = new GetApproveAddressApi (
212
- new Configuration ( { basePath : `${ address } :${ port } ` } ) ,
213
+ new Configuration ( {
214
+ basePath : `http://${ await gatewayRunner . getOApiHost ( ) } ` ,
215
+ } ) ,
213
216
) ;
214
217
215
218
const reqApproveBesuAddress = await approveAddressApi . getApproveAddress ( {
@@ -248,7 +251,9 @@ describe("SATPGateway sending a token from Besu to Fabric", () => {
248
251
await fabricEnv . giveRoleToBridge ( "Org2MSP" ) ;
249
252
250
253
const satpApi = new TransactionApi (
251
- new Configuration ( { basePath : `${ address } :${ port } ` } ) ,
254
+ new Configuration ( {
255
+ basePath : `http://${ await gatewayRunner . getOApiHost ( ) } ` ,
256
+ } ) ,
252
257
) ;
253
258
254
259
const req = getTransactRequest (
@@ -316,7 +321,7 @@ describe("SATPGateway sending a token from Fabric to Besu", () => {
316
321
) ;
317
322
} ) ;
318
323
it ( "should realize a transfer" , async ( ) => {
319
- const address : Address = `http://localhost ` ;
324
+ const address : Address = `http://${ gatewayAddress } ` ;
320
325
321
326
// gateway setup:
322
327
const gatewayIdentity = {
@@ -330,7 +335,7 @@ describe("SATPGateway sending a token from Fabric to Besu", () => {
330
335
} ,
331
336
] ,
332
337
proofID : "mockProofID10" ,
333
- address : "http://localhost" as Address ,
338
+ address,
334
339
} as GatewayIdentity ;
335
340
336
341
// ethereumConfig Json object setup:
@@ -360,17 +365,18 @@ describe("SATPGateway sending a token from Fabric to Besu", () => {
360
365
logsPath : files . logsPath ,
361
366
ontologiesPath : files . ontologiesPath ,
362
367
networkName : testNetwork ,
368
+ url : gatewayAddress ,
363
369
} ;
364
370
365
371
gatewayRunner = new SATPGatewayRunner ( gatewayRunnerOptions ) ;
366
372
log . debug ( "starting gatewayRunner..." ) ;
367
373
await gatewayRunner . start ( true ) ;
368
374
log . debug ( "gatewayRunner started sucessfully" ) ;
369
375
370
- const port = await gatewayRunner . getHostPort ( DEFAULT_PORT_GATEWAY_OAPI ) ;
371
-
372
376
const approveAddressApi = new GetApproveAddressApi (
373
- new Configuration ( { basePath : `${ address } :${ port } ` } ) ,
377
+ new Configuration ( {
378
+ basePath : `http://${ await gatewayRunner . getOApiHost ( ) } ` ,
379
+ } ) ,
374
380
) ;
375
381
376
382
const reqApproveFabricAddress = await approveAddressApi . getApproveAddress ( {
@@ -409,7 +415,9 @@ describe("SATPGateway sending a token from Fabric to Besu", () => {
409
415
await besuEnv . giveRoleToBridge ( reqApproveBesuAddress . data . approveAddress ) ;
410
416
411
417
const satpApi = new TransactionApi (
412
- new Configuration ( { basePath : `${ address } :${ port } ` } ) ,
418
+ new Configuration ( {
419
+ basePath : `http://${ await gatewayRunner . getOApiHost ( ) } ` ,
420
+ } ) ,
413
421
) ;
414
422
415
423
const req = getTransactRequest (
@@ -478,7 +486,7 @@ describe("SATPGateway sending a token from Besu to Ethereum", () => {
478
486
) ;
479
487
} ) ;
480
488
it ( "should realize a transfer" , async ( ) => {
481
- const address : Address = `http://localhost ` ;
489
+ const address : Address = `http://${ gatewayAddress } ` ;
482
490
483
491
// gateway setup:
484
492
const gatewayIdentity = {
@@ -525,17 +533,18 @@ describe("SATPGateway sending a token from Besu to Ethereum", () => {
525
533
logsPath : files . logsPath ,
526
534
ontologiesPath : files . ontologiesPath ,
527
535
networkName : testNetwork ,
536
+ url : gatewayAddress ,
528
537
} ;
529
538
530
539
gatewayRunner = new SATPGatewayRunner ( gatewayRunnerOptions ) ;
531
540
log . debug ( "starting gatewayRunner..." ) ;
532
541
await gatewayRunner . start ( true ) ;
533
542
log . debug ( "gatewayRunner started sucessfully" ) ;
534
543
535
- const port = await gatewayRunner . getHostPort ( DEFAULT_PORT_GATEWAY_OAPI ) ;
536
-
537
544
const approveAddressApi = new GetApproveAddressApi (
538
- new Configuration ( { basePath : `${ address } :${ port } ` } ) ,
545
+ new Configuration ( {
546
+ basePath : `http://${ await gatewayRunner . getOApiHost ( ) } ` ,
547
+ } ) ,
539
548
) ;
540
549
541
550
const reqApproveBesuAddress = await approveAddressApi . getApproveAddress ( {
@@ -579,7 +588,9 @@ describe("SATPGateway sending a token from Besu to Ethereum", () => {
579
588
) ;
580
589
581
590
const satpApi = new TransactionApi (
582
- new Configuration ( { basePath : `${ address } :${ port } ` } ) ,
591
+ new Configuration ( {
592
+ basePath : `http://${ await gatewayRunner . getOApiHost ( ) } ` ,
593
+ } ) ,
583
594
) ;
584
595
585
596
const req = getTransactRequest (
0 commit comments