From 577ba12e3999124036fb880da32dec6f7380d1b9 Mon Sep 17 00:00:00 2001 From: Sachu Shaji Abraham Date: Mon, 22 Jan 2024 16:49:12 +0530 Subject: [PATCH] fix: add opeth token support to register this change adds token which was missed register function Ticket: WIN-1746 --- modules/sdk-coin-opeth/src/register.ts | 4 ++++ modules/sdk-coin-opeth/test/unit/opethToken.ts | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/sdk-coin-opeth/src/register.ts b/modules/sdk-coin-opeth/src/register.ts index 822b308461..f70c213ee6 100644 --- a/modules/sdk-coin-opeth/src/register.ts +++ b/modules/sdk-coin-opeth/src/register.ts @@ -1,8 +1,12 @@ import { BitGoBase } from '@bitgo/sdk-core'; import { Opeth } from './opeth'; import { Topeth } from './topeth'; +import { OpethToken } from './opethToken'; export const register = (sdk: BitGoBase): void => { sdk.register('opeth', Opeth.createInstance); sdk.register('topeth', Topeth.createInstance); + OpethToken.createTokenConstructors().forEach(({ name, coinConstructor }) => { + sdk.register(name, coinConstructor); + }); }; diff --git a/modules/sdk-coin-opeth/test/unit/opethToken.ts b/modules/sdk-coin-opeth/test/unit/opethToken.ts index 16fc54214d..e11421339d 100644 --- a/modules/sdk-coin-opeth/test/unit/opethToken.ts +++ b/modules/sdk-coin-opeth/test/unit/opethToken.ts @@ -1,7 +1,7 @@ import 'should'; import { TestBitGo, TestBitGoAPI } from '@bitgo/sdk-test'; -import { OpethToken } from '../../src'; +import { register } from '../../src'; import { BitGoAPI } from '@bitgo/sdk-api'; describe('Opeth Token:', function () { @@ -11,9 +11,7 @@ describe('Opeth Token:', function () { before(function () { bitgo = TestBitGo.decorate(BitGoAPI, { env: 'test' }); - OpethToken.createTokenConstructors().forEach(({ name, coinConstructor }) => { - bitgo.safeRegister(name, coinConstructor); - }); + register(bitgo); bitgo.initializeTestVars(); opethTokenCoin = bitgo.coin(tokenName); });