Skip to content

Commit c36c82e

Browse files
authored
fix: tests not working with DB connection (#583)
1 parent 4e5e8ea commit c36c82e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/helpers/mysql.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ hubConfig.connectTimeout = 60e3;
2121
hubConfig.acquireTimeout = 60e3;
2222
hubConfig.timeout = 60e3;
2323
hubConfig.charset = 'utf8mb4';
24-
hubConfig.ssl = { rejectUnauthorized: true };
24+
hubConfig.ssl = { rejectUnauthorized: hubConfig.host !== 'localhost' };
2525

2626
const hubDB = mysql.createPool(hubConfig);
2727

@@ -36,7 +36,7 @@ sequencerConfig.connectTimeout = 60e3;
3636
sequencerConfig.acquireTimeout = 60e3;
3737
sequencerConfig.timeout = 60e3;
3838
sequencerConfig.charset = 'utf8mb4';
39-
sequencerConfig.ssl = { rejectUnauthorized: true };
39+
sequencerConfig.ssl = { rejectUnauthorized: sequencerConfig.host !== 'localhost' };
4040

4141
const sequencerDB = mysql.createPool(sequencerConfig);
4242

test/.env.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
HUB_DATABASE_URL=mysql://root:root@127.0.0.1:3306/snapshot_sequencer_test
2-
SEQ_DATABASE_URL=mysql://root:root@127.0.0.1:3306/snapshot_sequencer_test
1+
HUB_DATABASE_URL=mysql://root:root@localhost:3306/snapshot_sequencer_test
2+
SEQ_DATABASE_URL=mysql://root:root@localhost:3306/snapshot_sequencer_test
33
NETWORK=mainnet
44
RELAYER_PK=01686849e86499c1860ea0afc97f29c11018cbac049abf843df875c60054076e
55
NODE_ENV=test

0 commit comments

Comments
 (0)