@@ -1519,6 +1519,37 @@ describe('ADA', function () {
15191519 } ) ;
15201520
15211521 describe ( 'Verify token consolidation transaction:' , ( ) => {
1522+ it ( 'should verify a sponsored token consolidation when fee address output is present' , async ( ) => {
1523+ // This transaction has two outputs:
1524+ // 1. rootAddress — main consolidation output
1525+ // 2. feeAddress — ADA change returned to the fee sponsor
1526+ // Both must be permitted by verifyTransaction when consolidationToBaseAddress is true.
1527+ const consolidationTx = {
1528+ txRequestId : '1b5c79c5-ab7c-4f47-912b-de6a95fb0779' ,
1529+ walletId : '64fa31a94db65a0007c9691b' ,
1530+ txHex :
1531+ '84a40082825820227f65d20ac6e49602d79c623c51911ead824235e01eb2a1e7e33a72f0747cbb00825820227f65d20ac6e49602d79c623c51911ead824235e01eb2a1e7e33a72f0747cbb0201828258390022098270a5c19c9fb706dce0e7e4566b234ec5f0010623cd63f198ad22098270a5c19c9fb706dce0e7e4566b234ec5f0010623cd63f198ad1a0098968082581d60cf90f9fb02c88bad3c5294d90587458c4f160a2db26ba8af3da255b11a05d42fb8021a0002a491031a06d8c048a0f5f6' ,
1532+ txInfo : {
1533+ feeAddress : 'addr_test1vr8ep70mqtyghtfu222djpv8gkxy79s29kexh2908k39tvge02d5j' ,
1534+ } ,
1535+ } ;
1536+
1537+ const mockedWallet = {
1538+ coinSpecific : ( ) => ( {
1539+ rootAddress :
1540+ 'addr_test1qq3qnqns5hqee8ahqmwwpely2e4jxnk97qqsvg7dv0ce3tfzpxp8pfwpnj0mwpkuurn7g4ntyd8vtuqpqc3u6cl3nzksvggu82' ,
1541+ } ) ,
1542+ } ;
1543+
1544+ const isVerified = await basecoin . verifyTransaction ( {
1545+ txParams : { } ,
1546+ txPrebuild : consolidationTx ,
1547+ wallet : mockedWallet ,
1548+ verification : { consolidationToBaseAddress : true } ,
1549+ } ) ;
1550+ isVerified . should . equal ( true ) ;
1551+ } ) ;
1552+
15221553 it ( 'should fail to verify a spoofed token consolidation transaction with incorrect address' , async ( ) => {
15231554 const consolidationTx = {
15241555 txRequestId : '4fdd0cae-2563-43b1-b5cf-94865158ca10' ,
0 commit comments