11import should from 'should' ;
22import {
3- MIDNIGHT_TNC_HASH ,
3+ getMidnightGlacierDropMsg ,
44 isMessageWhitelisted ,
55 MIDNIGHT_GLACIER_DROP_CLAIM_MESSAGE_TEMPLATE ,
6- } from '../../../../src/utils' ;
6+ MIDNIGHT_TNC_HASH ,
7+ } from '@bitgo/sdk-core' ;
78
89describe ( 'Message validation' , ( ) => {
910 describe ( 'isMessageWhitelisted' , ( ) => {
@@ -12,17 +13,18 @@ describe('Message validation', () => {
1213 const adaTestnetDestinationAddress = 'addr_test1vz7xs7ceu4xx9n5xn57lfe86vrwddqpp77vjwq5ptlkh49cqy3wur' ;
1314 const adaMainnetDestinationAddress =
1415 'addr1q9k6u7lhf467y2f8skr2dafldx2npsd8fymq0mslnj0t44nd4ealwnt4ug5j0pvx5m6n76v4xrq6wjfkqlhpl8y7httq2m9cmu' ;
16+ const allocationAmt = 100 ;
1517
1618 it ( 'should validate testnet message matching the Midnight glacier drop claim template' , ( ) => {
17- const messageRaw = `STAR 100 to ${ adaTestnetDestinationAddress } ${ MIDNIGHT_TNC_HASH } ` ;
19+ const messageRaw = getMidnightGlacierDropMsg ( adaTestnetDestinationAddress , allocationAmt ) ;
1820
1921 const result = isMessageWhitelisted ( whitelistedMessageTemplates , messageRaw ) ;
2022
2123 should . equal ( result , true ) ;
2224 } ) ;
2325
2426 it ( 'should validate mainnet message matching the Midnight glacier drop claim template' , ( ) => {
25- const messageRaw = `STAR 100 to ${ adaMainnetDestinationAddress } ${ MIDNIGHT_TNC_HASH } ` ;
27+ const messageRaw = getMidnightGlacierDropMsg ( adaMainnetDestinationAddress , allocationAmt ) ;
2628
2729 const result = isMessageWhitelisted ( whitelistedMessageTemplates , messageRaw ) ;
2830
0 commit comments