Skip to content

Commit

Permalink
fix: minor fixes
Browse files Browse the repository at this point in the history
TICKET: WIN-4296
  • Loading branch information
yash-bitgo committed Jan 28, 2025
1 parent b316032 commit e127534
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
10 changes: 9 additions & 1 deletion modules/abstract-substrate/src/abstractSubstrateCoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,15 @@ export class SubstrateCoin extends BaseCoin {

/** @inheritDoc **/
generateKeyPair(seed?: Buffer): SubstrateKeyPair {
throw new Error('Method not implemented.');
const keyPair = seed ? utils.keyPairFromSeed(new Uint8Array(seed)) : new SubstrateKeyPair();
const keys = keyPair.getKeys();
if (!keys.prv) {
throw new Error('Missing prv in key generation.');
}
return {
pub: keys.pub,
prv: keys.prv,
};
}

/** @inheritDoc **/
Expand Down
15 changes: 1 addition & 14 deletions modules/sdk-coin-tao/src/tao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import {
VerifyTransactionOptions,
} from '@bitgo/sdk-core';
import { BaseCoin as StaticsBaseCoin } from '@bitgo/statics';
import { Interface, KeyPair, SubstrateCoin, Utils } from '@bitgo/abstract-substrate';

const utils = Utils.default;
import { Interface, KeyPair, SubstrateCoin } from '@bitgo/abstract-substrate';

export const DEFAULT_SCAN_FACTOR = 20; // default number of receive addresses to scan for funds

Expand Down Expand Up @@ -73,17 +71,6 @@ export class Tao extends SubstrateCoin {
return {};
}

generateKeyPair(seed?: Buffer): KeyPair {
const keyPair = seed ? utils.keyPairFromSeed(new Uint8Array(seed)) : new KeyPair();
const keys = keyPair.getKeys();
if (!keys.prv) {
throw new Error('Missing prv in key generation.');
}
return {
pub: keys.pub,
prv: keys.prv,
};
}
verifySignTransactionParams(params: SignTransactionOptions): VerifiedTransactionParameters {
const prv = params.prv;

Expand Down

0 comments on commit e127534

Please sign in to comment.