Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sdk-core): do not treat sol as a utxo-coin for approval #3687

Merged
merged 1 commit into from
Jun 22, 2023
Merged
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
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