Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions modules/bitgo/test/v2/unit/accountConsolidations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ describe('Account Consolidations:', function () {
scope.isDone().should.be.True();
});

it('should forward tokenName to the build request', async function () {
const tokenName = 'talgo:USDt';
const scope = nock(bgUrl)
.post(`/api/v2/${wallet.coin()}/wallet/${wallet.id()}/consolidateAccount/build`, { tokenName })
.query({})
.reply(200, fixtures.buildAccountConsolidation);

const accountConsolidationBuild = await wallet.buildAccountConsolidations({ tokenName });

accountConsolidationBuild.length.should.equal(2);

scope.isDone().should.be.True();
});

it('should throw if the result is an empty array', async function () {
const scope = nock(bgUrl)
.post(`/api/v2/${wallet.coin()}/wallet/${wallet.id()}/consolidateAccount/build`)
Expand Down
1 change: 1 addition & 0 deletions modules/sdk-core/src/bitgo/wallet/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ export class Wallet implements IWallet {
prebuildConsolidateAccountParams(): string[] {
return [
'consolidateAddresses',
'tokenName',
'nftCollectionId',
'nftId',
'feeRate',
Expand Down
Loading