Skip to content

Commit

Permalink
Merge pull request #4270 from BitGo/WIN-1885-enable-v4-forwarders
Browse files Browse the repository at this point in the history
fix(sdk-core): allow v4 forwarders
  • Loading branch information
gianchandania authored Feb 8, 2024
2 parents 4e0af62 + 90104b8 commit 2b4e960
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/bitgo/test/v2/unit/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,8 +881,8 @@ describe('V2 Wallet:', function () {
// @ts-expect-error checking type mismatch
await wallet.createAddress({ allowSkipVerifyAddress: null }).should.be.rejectedWith(message);

message = 'forwarderVersion has to be an integer 0, 1, 2 or 3';
await wallet.createAddress({ forwarderVersion: 4 }).should.be.rejectedWith(message);
message = 'forwarderVersion has to be an integer 0, 1, 2, 3 or 4';
await wallet.createAddress({ forwarderVersion: 5 }).should.be.rejectedWith(message);
await wallet.createAddress({ forwarderVersion: -1 }).should.be.rejectedWith(message);
});

Expand Down
4 changes: 2 additions & 2 deletions modules/sdk-core/src/bitgo/wallet/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1143,8 +1143,8 @@ export class Wallet implements IWallet {
}

if (!_.isUndefined(forwarderVersion)) {
if (!_.isInteger(forwarderVersion) || forwarderVersion < 0 || forwarderVersion > 3) {
throw new Error('forwarderVersion has to be an integer 0, 1, 2 or 3');
if (!_.isInteger(forwarderVersion) || forwarderVersion < 0 || forwarderVersion > 4) {
throw new Error('forwarderVersion has to be an integer 0, 1, 2, 3 or 4');
}
addressParams.forwarderVersion = forwarderVersion;
} else if (this._wallet.multisigType === 'tss' && this.baseCoin.getMPCAlgorithm() === 'ecdsa') {
Expand Down

0 comments on commit 2b4e960

Please sign in to comment.