Skip to content

Commit

Permalink
Merge pull request #3687 from BitGo/bg-79393-sol-approval-fix
Browse files Browse the repository at this point in the history
fix(sdk-core): do not treat sol as a utxo-coin for approval
  • Loading branch information
brandonblack authored Jun 22, 2023
2 parents e8bf1cc + a1cc144 commit c2a341a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/sdk-core/src/bitgo/pendingApproval/pendingApproval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import * as _ from 'lodash';
import * as common from '../../common';
import * as utxolib from '@bitgo/utxo-lib';
import { IBaseCoin } from '../baseCoin';
import { BitGoBase } from '../bitgoBase';
import {
Expand Down Expand Up @@ -183,9 +184,9 @@ export class PendingApproval implements IPendingApproval {
const recipients = this.info()?.transactionRequest?.buildParams?.recipients || [];
const type = this.info()?.transactionRequest?.buildParams?.type;

// We only want to not recreate transactions with no recipients if it is an UTXO coin.
// There is no easy way to do this in sdk-core, but `network` is only set on UTXO coins.
if ('network' in this.baseCoin && recipients.length === 0 && type !== 'consolidate') {
// We only want to not recreate transactions with no recipients if it is a UTXO coin.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (utxolib.isValidNetwork((this.baseCoin as any).network) && recipients.length === 0 && type !== 'consolidate') {
canRecreateTransaction = false;
}

Expand Down

0 comments on commit c2a341a

Please sign in to comment.