Skip to content

Commit 3588ba7

Browse files
committed
feat(api): Add testnet addresses
1 parent 7044eb8 commit 3588ba7

File tree

2 files changed

+44
-19
lines changed

2 files changed

+44
-19
lines changed

src/bridges/chainport.service.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ describe.skip('ChainportService', () => {
205205

206206
describe('getStatus', () => {
207207
it('returns the status of the chainport bridge', () => {
208+
jest.spyOn(config, 'isProduction').mockImplementation(() => {
209+
return true;
210+
});
211+
208212
const status = chainport.getStatus();
209213
expect(status).toMatchObject({
210214
active: config.get('CHAINPORT_ACTIVE'),

src/bridges/chainport.service.ts

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -399,28 +399,49 @@ Chainport: ${token.decimals}`;
399399
}
400400

401401
getStatus(): BridgeStatus {
402+
const testnetOutgoingAddresses = [
403+
'06102d319ab7e77b914a1bd135577f3e266fd82a3e537a02db281421ed8b3d13',
404+
'db2cf6ec67addde84cc1092378ea22e7bb2eecdeecac5e43febc1cb8fb64b5e5',
405+
'3be494deb669ff8d943463bb6042eabcf0c5346cf444d569e07204487716cb85',
406+
];
407+
const testnetIncomingAddresses = [
408+
'06102d319ab7e77b914a1bd135577f3e266fd82a3e537a02db281421ed8b3d13',
409+
];
410+
411+
const mainnetOutgoingAddresses = [
412+
'576ffdcc27e11d81f5180d3dc5690294941170d492b2d9503c39130b1f180405',
413+
'7ac2d6a59e19e66e590d014af013cd5611dc146e631fa2aedf0ee3ed1237eebe',
414+
];
415+
const mainnetIncomingAddresses = [
416+
'1216302193e8f1ad020f458b54a163039403d803e98673c6a85e59b5f4a1a900',
417+
];
418+
const mainnetMetadata = {
419+
outgoing_addresses: {
420+
'576ffdcc27e11d81f5180d3dc5690294941170d492b2d9503c39130b1f180405':
421+
'Send Iron Fish custom assets here to bridge to other chains',
422+
'7ac2d6a59e19e66e590d014af013cd5611dc146e631fa2aedf0ee3ed1237eebe':
423+
'Send native IRON to bridge to other chains',
424+
},
425+
incoming_addresses: {
426+
'1216302193e8f1ad020f458b54a163039403d803e98673c6a85e59b5f4a1a900':
427+
'User will receive tokens and IRON from this address from other chains',
428+
},
429+
};
430+
431+
const outgoingAddresses = this.config.isProduction()
432+
? mainnetOutgoingAddresses
433+
: testnetOutgoingAddresses;
434+
const incomingAddresses = this.config.isProduction()
435+
? mainnetIncomingAddresses
436+
: testnetIncomingAddresses;
437+
const metadata = this.config.isProduction() ? mainnetMetadata : undefined;
438+
402439
return {
403440
active: this.config.get<boolean>('CHAINPORT_ACTIVE'),
404441
maintenance: this.config.get<boolean>('CHAINPORT_MAINTENANCE'),
405-
outgoing_addresses: [
406-
'576ffdcc27e11d81f5180d3dc5690294941170d492b2d9503c39130b1f180405',
407-
'7ac2d6a59e19e66e590d014af013cd5611dc146e631fa2aedf0ee3ed1237eebe',
408-
],
409-
incoming_addresses: [
410-
'1216302193e8f1ad020f458b54a163039403d803e98673c6a85e59b5f4a1a900',
411-
],
412-
metadata: {
413-
outgoing_addresses: {
414-
'576ffdcc27e11d81f5180d3dc5690294941170d492b2d9503c39130b1f180405':
415-
'Send Iron Fish custom assets here to bridge to other chains',
416-
'7ac2d6a59e19e66e590d014af013cd5611dc146e631fa2aedf0ee3ed1237eebe':
417-
'Send native IRON to bridge to other chains',
418-
},
419-
incoming_addresses: {
420-
'1216302193e8f1ad020f458b54a163039403d803e98673c6a85e59b5f4a1a900':
421-
'User will receive tokens and IRON from this address from other chains',
422-
},
423-
},
442+
outgoing_addresses: outgoingAddresses,
443+
incoming_addresses: incomingAddresses,
444+
metadata,
424445
};
425446
}
426447
}

0 commit comments

Comments
 (0)