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

chore(sdk-core): change unstaking wallet id for btc unstaking #5081

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion modules/sdk-core/src/bitgo/staking/stakingWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ export class StakingWallet implements IStakingWallet {
}
return {
transaction: transaction,
result: await (await this.getWalletForBuildingAndSigning()).prebuildTransaction(transaction.buildParams),
result: await (this.wallet.baseCoin.getFamily() === 'btc'
? await this.getDescriptorWallet(transaction)
: await this.getWalletForBuildingAndSigning()
).prebuildTransaction(transaction.buildParams),
};
}
}
Expand Down Expand Up @@ -314,4 +317,8 @@ export class StakingWallet implements IStakingWallet {
return true;
}
}

private async getDescriptorWallet(transaction: StakingTransaction): Promise<IWallet> {
return await this.wallet.baseCoin.wallets().get({ id: transaction.buildParams?.senderWalletId });
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there any tests you could update/add for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question, but I cannot find any test in sdk-core for wallet/stakingWallet at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good chance to add some!

}
1 change: 1 addition & 0 deletions modules/sdk-core/src/bitgo/wallet/iWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export interface PrebuildTransactionOptions {
* This feature is supported only for specific coins, like ADA.
*/
senderAddress?: string;
senderWalletId?: string;
changeAddress?: string;
allowExternalChangeAddress?: boolean;
type?: string;
Expand Down
Loading