Skip to content

Commit dfaa4cc

Browse files
committed
feat(sdk-core): use common isMessageWhitelisted() function
TICKET: SC-2419
1 parent b5dbd70 commit dfaa4cc

File tree

21 files changed

+52
-56
lines changed

21 files changed

+52
-56
lines changed

examples/ts/build-message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import {BitGoAPI} from '@bitgo/sdk-api';
1111
import {MessageStandardType} from "@bitgo/sdk-core";
1212
import {Hteth} from "@bitgo/sdk-coin-eth";
13-
import {MIDNIGHT_TNC_HASH} from "@bitgo/account-lib";
13+
import {MIDNIGHT_TNC_HASH} from "@bitgo/sdk-core";
1414
require('dotenv').config({ path: '../../.env' });
1515

1616
const bitgo = new BitGoAPI({

examples/ts/sign-message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
import { BitGo } from 'bitgo';
77
import { MessageStandardType } from '@bitgo/sdk-core';
8-
import { MIDNIGHT_TNC_HASH } from "@bitgo/account-lib";
8+
import { MIDNIGHT_TNC_HASH } from "@bitgo/sdk-core";
99

1010
const bitgo = new BitGo({ env: 'test' });
1111

modules/account-lib/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ export { Vet };
206206
import * as CosmosSharedCoin from '@bitgo/sdk-coin-cosmos';
207207
export { CosmosSharedCoin };
208208

209-
import { isMessageWhitelisted, MIDNIGHT_TNC_HASH, MIDNIGHT_GLACIER_DROP_CLAIM_MESSAGE_TEMPLATE } from './utils';
210-
export { isMessageWhitelisted, MIDNIGHT_TNC_HASH, MIDNIGHT_GLACIER_DROP_CLAIM_MESSAGE_TEMPLATE };
211-
212209
const coinBuilderMap = {
213210
trx: Trx.WrappedBuilder,
214211
ttrx: Trx.WrappedBuilder,

modules/account-lib/src/utils/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ export function register(coinName: string): BaseUtils {
1818
}
1919
throw new NotSupported(`${coinName} util factory not supported`);
2020
}
21-
22-
export * from './messages';

modules/account-lib/src/utils/messages/index.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

modules/account-lib/test/unit/utils/messages/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import should from 'should';
2-
import {
3-
MIDNIGHT_TNC_HASH,
4-
isMessageWhitelisted,
5-
MIDNIGHT_GLACIER_DROP_CLAIM_MESSAGE_TEMPLATE,
6-
} from '../../../../src/utils';
2+
import { MIDNIGHT_TNC_HASH, isMessageWhitelisted, MIDNIGHT_GLACIER_DROP_CLAIM_MESSAGE_TEMPLATE } from '@bitgo/sdk-core';
73

84
describe('Message validation', () => {
95
describe('isMessageWhitelisted', () => {

modules/account-lib/test/unit/verifyMessage.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import should from 'should';
22
import * as accountLib from '../../src';
3-
import { MessageStandardType } from '@bitgo/sdk-core';
4-
import { MIDNIGHT_TNC_HASH } from '../../src/utils';
3+
import { MessageStandardType, MIDNIGHT_TNC_HASH } from '@bitgo/sdk-core';
54

65
describe('verifyMessage', () => {
76
const adaTestnetOriginAddress = 'addr_test1wz4h6068hs93n8j5ar88fgzz6sfnw8krng09xx0mmf36m8c7j9yap';

modules/sdk-coin-ada/src/lib/messages/cip8/cip8MessageBuilder.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { Cip8Message } from './cip8Message';
22
import { BaseCoin as CoinConfig } from '@bitgo/statics';
3-
import { BaseMessageBuilder, IMessage, MessageOptions, MessageStandardType } from '@bitgo/sdk-core';
4-
import { MIDNIGHT_GLACIER_DROP_CLAIM_MESSAGE_TEMPLATE } from '@bitgo/account-lib';
3+
import {
4+
BaseMessageBuilder,
5+
IMessage,
6+
MessageOptions,
7+
MessageStandardType,
8+
MIDNIGHT_GLACIER_DROP_CLAIM_MESSAGE_TEMPLATE,
9+
} from '@bitgo/sdk-core';
510

611
/**
712
* Builder for CIP-8 messages

modules/sdk-core/src/account-lib/baseCoin/messages/baseMessage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
MessageOptions,
66
MessagePayload,
77
MessageStandardType,
8-
} from '../../../bitgo';
8+
} from './messageTypes';
99
import { IMessage } from './iface';
1010
import { serializeSignatures, Signature } from '../iface';
1111

modules/sdk-core/src/account-lib/baseCoin/messages/baseMessageBuilder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { BroadcastableMessage, MessageOptions, MessagePayload, MessageStandardType } from '../../../bitgo';
1+
import { BroadcastableMessage, MessageOptions, MessagePayload, MessageStandardType } from './messageTypes';
22
import { BaseCoin as CoinConfig } from '@bitgo/statics';
33
import { IMessage, IMessageBuilder } from './iface';
44
import { deserializeSignatures, Signature } from '../iface';
5-
import { isMessageWhitelisted } from '@bitgo/account-lib';
5+
import { isMessageWhitelisted } from './index';
66

77
/**
88
* Base Message Builder

0 commit comments

Comments
 (0)