11import _ from 'lodash' ;
22import { BitGoAPI } from '@bitgo/sdk-api' ;
33import { TestBitGo , TestBitGoAPI } from '@bitgo/sdk-test' ;
4- import { ITransactionRecipient , Wallet } from '@bitgo/sdk-core' ;
4+ import { ITransactionRecipient , Wallet , Memo } from '@bitgo/sdk-core' ;
55
66import { Sip10Token } from '../../src' ;
77import * as testData from '../fixtures' ;
@@ -11,7 +11,7 @@ describe('Sip10Token:', function () {
1111 let bitgo : TestBitGoAPI ;
1212 let basecoin : Sip10Token ;
1313 let newTxPrebuild : ( ) => { txHex : string ; txInfo : Record < string , unknown > } ;
14- let newTxParams : ( ) => { recipients : ITransactionRecipient [ ] } ;
14+ let newTxParams : ( ) => { recipients : ITransactionRecipient [ ] ; memo ?: Memo } ;
1515 let wallet : Wallet ;
1616
1717 const txPreBuild = {
@@ -50,13 +50,13 @@ describe('Sip10Token:', function () {
5050 it ( 'should succeed to verify transaction' , async function ( ) {
5151 const txPrebuild = newTxPrebuild ( ) ;
5252 const txParams = newTxParams ( ) ;
53+ txParams . memo = memo ;
5354 const verification = { } ;
5455 const isTransactionVerified = await basecoin . verifyTransaction ( {
5556 txParams,
5657 txPrebuild,
5758 verification,
5859 wallet,
59- memo,
6060 } ) ;
6161 isTransactionVerified . should . equal ( true ) ;
6262 } ) ;
@@ -69,13 +69,14 @@ describe('Sip10Token:', function () {
6969 return { address, amount : Number ( amount ) , memo, tokenName } ;
7070 }
7171 ) ;
72+ txParamsWithNumberAmounts . memo = memo ;
73+
7274 const verification = { } ;
7375 const isTransactionVerified = await basecoin . verifyTransaction ( {
7476 txParams : txParamsWithNumberAmounts ,
7577 txPrebuild,
7678 verification,
7779 wallet,
78- memo,
7980 } ) ;
8081 isTransactionVerified . should . equal ( true ) ;
8182 } ) ;
@@ -85,7 +86,7 @@ describe('Sip10Token:', function () {
8586 txPrebuild . txHex = testData . txForExplainFungibleTokenTransferWithMemoId10 ;
8687 const txParams = newTxParams ( ) ;
8788 const verification = { } ;
88- const memo = {
89+ txParams . memo = {
8990 type : '' ,
9091 value : '10' ,
9192 } ;
@@ -94,7 +95,6 @@ describe('Sip10Token:', function () {
9495 txPrebuild,
9596 verification,
9697 wallet,
97- memo,
9898 } ) ;
9999 isTransactionVerified . should . equal ( true ) ;
100100 } ) ;
@@ -103,7 +103,7 @@ describe('Sip10Token:', function () {
103103 const txPrebuild = newTxPrebuild ( ) ;
104104 const txParams = newTxParams ( ) ;
105105 txPrebuild . txHex = testData . txForExplainFungibleTokenTransferWithMemoZero ;
106- const memo = {
106+ txParams . memo = {
107107 type : '' ,
108108 value : '0' ,
109109 } ;
@@ -113,7 +113,6 @@ describe('Sip10Token:', function () {
113113 txPrebuild,
114114 verification,
115115 wallet,
116- memo,
117116 } ) ;
118117 isTransactionVerified . should . equal ( true ) ;
119118 } ) ;
0 commit comments