|
1 | 1 | import should from 'should';
|
2 | 2 | import {
|
3 |
| - getMidnightGlacierDropMsg, |
| 3 | + getMidnightGlacierDropClaimMsg, |
4 | 4 | isMessageWhitelisted,
|
5 | 5 | MIDNIGHT_GLACIER_DROP_CLAIM_MESSAGE_TEMPLATE,
|
6 | 6 | MIDNIGHT_TNC_HASH,
|
7 | 7 | } from '@bitgo/sdk-core';
|
8 | 8 |
|
9 | 9 | describe('Message validation', () => {
|
10 | 10 | describe('isMessageWhitelisted', () => {
|
11 |
| - const whitelistedMessageTemplates = [MIDNIGHT_GLACIER_DROP_CLAIM_MESSAGE_TEMPLATE]; |
| 11 | + const whitelistedMessageTemplates: Record<string, string> = { |
| 12 | + midnightGDClaimMsgTemplate: MIDNIGHT_GLACIER_DROP_CLAIM_MESSAGE_TEMPLATE, |
| 13 | + }; |
12 | 14 |
|
13 | 15 | const adaTestnetDestinationAddress = 'addr_test1vz7xs7ceu4xx9n5xn57lfe86vrwddqpp77vjwq5ptlkh49cqy3wur';
|
14 | 16 | const adaMainnetDestinationAddress =
|
15 | 17 | 'addr1q9k6u7lhf467y2f8skr2dafldx2npsd8fymq0mslnj0t44nd4ealwnt4ug5j0pvx5m6n76v4xrq6wjfkqlhpl8y7httq2m9cmu';
|
16 | 18 | const allocationAmt = 100;
|
17 | 19 |
|
18 | 20 | it('should validate testnet message matching the Midnight glacier drop claim template', () => {
|
19 |
| - const messageRaw = getMidnightGlacierDropMsg(adaTestnetDestinationAddress, allocationAmt); |
| 21 | + const messageRaw = getMidnightGlacierDropClaimMsg(adaTestnetDestinationAddress, allocationAmt); |
20 | 22 |
|
21 | 23 | const result = isMessageWhitelisted(whitelistedMessageTemplates, messageRaw);
|
22 | 24 |
|
23 | 25 | should.equal(result, true);
|
24 | 26 | });
|
25 | 27 |
|
26 | 28 | it('should validate mainnet message matching the Midnight glacier drop claim template', () => {
|
27 |
| - const messageRaw = getMidnightGlacierDropMsg(adaMainnetDestinationAddress, allocationAmt); |
| 29 | + const messageRaw = getMidnightGlacierDropClaimMsg(adaMainnetDestinationAddress, allocationAmt); |
28 | 30 |
|
29 | 31 | const result = isMessageWhitelisted(whitelistedMessageTemplates, messageRaw);
|
30 | 32 |
|
|
0 commit comments