Skip to content

Commit 3dca489

Browse files
authored
Merge pull request #7985 from BitGo/WIN-8740-add-dummy-witness
feat(sdk-coin-ada): add dummy witness for sponsored txn
2 parents 69bcad6 + 83caec1 commit 3dca489

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

modules/sdk-coin-ada/src/lib/transactionBuilder.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,11 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
455455
if (this._type !== TransactionType.Send) {
456456
vkeyWitnesses.add(vkeyWitness);
457457
}
458+
if (this._sponsorshipInfo) {
459+
const sponsorPrv = CardanoWasm.PrivateKey.generate_ed25519();
460+
const sponsorVkeyWitness = CardanoWasm.make_vkey_witness(txHash, sponsorPrv);
461+
vkeyWitnesses.add(sponsorVkeyWitness);
462+
}
458463
}
459464
witnessSet.set_vkeys(vkeyWitnesses);
460465

modules/sdk-coin-ada/test/unit/tokenWithdrawal.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ describe('ADA Token Operations', async () => {
399399
feeAddressChangeOutput.length.should.equal(1);
400400
// Fee address change should not have any tokens
401401
should.not.exist(feeAddressChangeOutput[0].multiAssets);
402+
403+
tx.getFee.should.equal('182485'); // Fee with two witnesses
402404
});
403405

404406
describe('AdaToken verifyTransaction', () => {

0 commit comments

Comments
 (0)