From ffe25bc558ff4a06f1388db9b5d26bd1d0314a82 Mon Sep 17 00:00:00 2001 From: Alejandro Busse Date: Mon, 19 Feb 2024 20:06:59 -0300 Subject: [PATCH] fix(sdk-coin-hbar): deprecate hbar deriveKeyWithSeed deprecate hbar deriveKeyWith Seed WP-1401 TICKET: WP-1401 --- modules/sdk-coin-hbar/src/hbar.ts | 13 +++++++------ modules/sdk-coin-hbar/test/unit/hbar.ts | 8 ++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/modules/sdk-coin-hbar/src/hbar.ts b/modules/sdk-coin-hbar/src/hbar.ts index a1df0cfeec..e275ba4c8c 100644 --- a/modules/sdk-coin-hbar/src/hbar.ts +++ b/modules/sdk-coin-hbar/src/hbar.ts @@ -20,6 +20,7 @@ import { TokenEnablementConfig, BaseBroadcastTransactionOptions, BaseBroadcastTransactionResult, + NotSupported, } from '@bitgo/sdk-core'; import { BigNumber } from 'bignumber.js'; import * as stellar from 'stellar-sdk'; @@ -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(); diff --git a/modules/sdk-coin-hbar/test/unit/hbar.ts b/modules/sdk-coin-hbar/test/unit/hbar.ts index 50cd821961..23bb8b3a53 100644 --- a/modules/sdk-coin-hbar/test/unit/hbar.ts +++ b/modules/sdk-coin-hbar/test/unit/hbar.ts @@ -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'); + }); + }); });