Skip to content

Commit 31b8ae2

Browse files
committed
fix(sdk-core): include coredao family for acceleration
TICKET: COIN-6534
1 parent 3fcdd3d commit 31b8ae2

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

modules/bitgo/test/v2/unit/wallet.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3158,6 +3158,28 @@ describe('V2 Wallet:', function () {
31583158
intent.intentType.should.equal('acceleration');
31593159
});
31603160

3161+
it('populate intent should return valid coredao acceleration intent', async function () {
3162+
const mpcUtils = new ECDSAUtils.EcdsaUtils(bitgo, bitgo.coin('coredao'));
3163+
3164+
const feeOptions = {
3165+
maxFeePerGas: 3000000000,
3166+
maxPriorityFeePerGas: 2000000000,
3167+
};
3168+
const lowFeeTxid = '0x6ea07f9420f4676be6478ab1660eb92444a7c663e0e24bece929f715e882e0cf';
3169+
3170+
const intent = mpcUtils.populateIntent(bitgo.coin('coredao'), {
3171+
reqId,
3172+
intentType: 'acceleration',
3173+
lowFeeTxid,
3174+
feeOptions,
3175+
});
3176+
3177+
intent.should.have.property('recipients', undefined);
3178+
intent.feeOptions!.should.deepEqual(feeOptions);
3179+
intent.txid!.should.equal(lowFeeTxid);
3180+
intent.intentType.should.equal('acceleration');
3181+
});
3182+
31613183
it('populate intent should return valid eth acceleration intent for receive address', async function () {
31623184
const mpcUtils = new ECDSAUtils.EcdsaUtils(bitgo, bitgo.coin('hteth'));
31633185

modules/sdk-core/src/bitgo/utils/mpcUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export abstract class MpcUtils {
191191
isTestTransaction: params.isTestTransaction,
192192
};
193193

194-
if (baseCoin.getFamily() === 'eth' || baseCoin.getFamily() === 'polygon' || baseCoin.getFamily() === 'bsc') {
194+
if (['eth', 'polygon', 'bsc', 'coredao'].includes(baseCoin.getFamily())) {
195195
switch (params.intentType) {
196196
case 'payment':
197197
case 'transferToken':

0 commit comments

Comments
 (0)