Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client/ts-web: bump @types/elliptic from 6.4.14 to 6.4.18 in /client-sdk/ts-web #1562

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions client-sdk/ts-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client-sdk/ts-web/rt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"tweetnacl": "^1.0.3"
},
"devDependencies": {
"@types/elliptic": "^6.4.14",
"@types/elliptic": "^6.4.18",
"@types/jest": "^29.5.4",
"@types/randombytes": "^2.0.0",
"buffer": "^6.0.3",
Expand Down
2 changes: 1 addition & 1 deletion client-sdk/ts-web/rt/src/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function fromSigspec(spec: types.SignatureAddressSpec) {
} else if (spec.secp256k1eth) {
// Use a scheme such that we can compute Secp256k1 addresses from Ethereum
// addresses as this makes things more interoperable.
const untaggedPk = SECP256K1.keyFromPublic(Array.from(spec.secp256k1eth))
const untaggedPk = SECP256K1.keyFromPublic(spec.secp256k1eth)
.getPublic(false, 'array')
.slice(1);
const hash = new Keccak(256);
Expand Down
10 changes: 4 additions & 6 deletions client-sdk/ts-web/rt/src/signature_secp256k1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ export async function verify(
publicKey: Uint8Array,
) {
const signerMessage = await oasis.signature.prepareSignerMessage(context, message);
const signerMessageA = Array.from(signerMessage);
const signatureA = Array.from(signature);
const publicKeyA = Array.from(publicKey);
// @ts-expect-error acceptance of array-like types is not modeled
return SECP256K1.verify(signerMessageA, signatureA, publicKeyA);
// @ts-expect-error acceptance of array-like encoded public key is not modeled
return SECP256K1.verify(signerMessage, signature, publicKeyA);
}

export class BlindContextSigner implements ContextSigner {
Expand Down Expand Up @@ -57,15 +55,15 @@ export class EllipticSigner implements Signer {
}

static fromPrivate(priv: Uint8Array, note: string) {
return new EllipticSigner(SECP256K1.keyFromPrivate(Array.from(priv)), note);
return new EllipticSigner(SECP256K1.keyFromPrivate(priv), note);
}

public(): Uint8Array {
return new Uint8Array(this.key.getPublic(true, 'array'));
}

async sign(message: Uint8Array): Promise<Uint8Array> {
const sig = this.key.sign(Array.from(message), {canonical: true});
const sig = this.key.sign(message, {canonical: true});
return new Uint8Array(sig.toDER());
}
}
Loading