Skip to content

Commit

Permalink
fix(sdk-coin-hbar): deprecate hbar deriveKeyWithSeed
Browse files Browse the repository at this point in the history
deprecate hbar deriveKeyWith Seed

WP-1401

TICKET: WP-1401
  • Loading branch information
alebusse committed Feb 20, 2024
1 parent b0f9b6f commit 402b856
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 7 additions & 6 deletions modules/sdk-coin-hbar/src/hbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
TokenEnablementConfig,
BaseBroadcastTransactionOptions,
BaseBroadcastTransactionResult,
NotSupported,
} from '@bitgo/sdk-core';
import { BigNumber } from 'bignumber.js';
import * as stellar from 'stellar-sdk';
Expand Down Expand Up @@ -174,12 +175,12 @@ export class Hbar extends BaseCoin {
}
}

/**
* Generate Hedera Hashgraph key pair
*
* @param seed
* @returns {Object} object with generated pub, prv
*/
/** inheritdoc */
deriveKeyWithSeed(): { derivationPath: string; key: string } {
throw new NotSupported('method deriveKeyWithSeed not supported for eddsa curve');
}

/** inheritdoc */
generateKeyPair(seed?: Buffer): KeyPair {
const keyPair = seed ? new HbarKeyPair({ seed }) : new HbarKeyPair();
const keys = keyPair.getKeys();
Expand Down
8 changes: 8 additions & 0 deletions modules/sdk-coin-hbar/test/unit/hbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -939,4 +939,12 @@ describe('Hedera Hashgraph:', function () {
);
});
});

describe('deriveKeyWithSeed', function () {
it('should derive key with seed', function () {
(() => {
basecoin.deriveKeyWithSeed('test');
}).should.throw('method deriveKeyWithSeed not supported for eddsa curve');
});
});
});

0 comments on commit 402b856

Please sign in to comment.