mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #45493 fix(sawtooth-sdk): use correct return types on secp256k1 functions by @Patrick-Erichsen
* fix: use correct return types on secp256k1 functions Signed-off-by: Patrick-Erichsen <Patrick.Erichsen@target.com> * fix(sawtooth-sdk): update tests Signed-off-by: Patrick-Erichsen <Patrick.Erichsen@target.com>
This commit is contained in:
parent
f9f8e5ac0f
commit
c6091aad00
9
types/sawtooth-sdk/signing/secp256k1.d.ts
vendored
9
types/sawtooth-sdk/signing/secp256k1.d.ts
vendored
@ -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 {
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user