diff --git a/types/sawtooth-sdk/signing/secp256k1.d.ts b/types/sawtooth-sdk/signing/secp256k1.d.ts index 2e0d4728e3..39385dccac 100644 --- a/types/sawtooth-sdk/signing/secp256k1.d.ts +++ b/types/sawtooth-sdk/signing/secp256k1.d.ts @@ -43,13 +43,13 @@ export class Secp256k1PrivateKey extends PrivateKey { * @return a private key instance * @throws if the private key is not valid */ - static fromHex(privateKeyHex: string): PrivateKey; + static fromHex(privateKeyHex: string): Secp256k1PrivateKey; /** * @return generates a random PrivateKey * */ - static newRandom(): PrivateKey; + static newRandom(): Secp256k1PrivateKey; } /** @@ -75,10 +75,7 @@ export class Secp256k1PublicKey extends PublicKey { * @return a public key instance * @throws if the public key is not valid */ - static fromHex(publicKeyHex: string): PublicKey; - - /** Generate a new random public key */ - static newRandom(): PublicKey; + static fromHex(publicKeyHex: string): Secp256k1PublicKey; } export class Secp256k1Context extends Context { diff --git a/types/sawtooth-sdk/test/signing-tests.ts b/types/sawtooth-sdk/test/signing-tests.ts index 6227da7dc2..d70bd4fed1 100644 --- a/types/sawtooth-sdk/test/signing-tests.ts +++ b/types/sawtooth-sdk/test/signing-tests.ts @@ -66,10 +66,10 @@ const privAlgoName = privateKey.getAlgorithmName(); // $ExpectType Buffer const privAsBytes = privateKey.asBytes(); -// $ExpectType PrivateKey +// $ExpectType Secp256k1PrivateKey const privFromHex = Secp256k1PrivateKey.fromHex('test'); -// $ExpectType PrivateKey +// $ExpectType Secp256k1PrivateKey const privNewRandom = Secp256k1PrivateKey.newRandom(); // $ExpectType Buffer @@ -81,12 +81,9 @@ const pubAlgoName = publicKey.getAlgorithmName(); // $ExpectType Buffer const pubAsBytes = publicKey.asBytes(); -// $ExpectType PublicKey +// $ExpectType Secp256k1PublicKey const pubFromHex = Secp256k1PublicKey.fromHex('test'); -// $ExpectType PublicKey -const pubNewRandom = Secp256k1PublicKey.newRandom(); - // $ExpectType string const contextAlgoName = cryptoContext.getAlgorithmName();