Skip to content

Commit

Permalink
Hook up Rust lib logic for reconstructing signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
jurevans committed Jul 20, 2023
1 parent 6d82708 commit d4016a4
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 47 deletions.
33 changes: 9 additions & 24 deletions apps/extension/src/background/ledger/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,9 @@ export class LedgerService {
signatures: ResponseSign
): Promise<void> {
const {
wrapperSignature: {
raw: { data: wrapperSig },
},
rawSignature: {
raw: { data: rawSig },
},
// TODO: We need the correct type updated in ResponseSign
} = signatures as any; // eslint-disable-line
wrapperSignature: { raw: wrapperSig },
rawSignature: { raw: rawSig },
} = signatures;

if (!wrapperSig) {
throw new Error("No wrapper signature was produced!");
Expand Down Expand Up @@ -153,14 +148,9 @@ export class LedgerService {
}

const {
wrapperSignature: {
raw: { data: wrapperSig },
},
rawSignature: {
raw: { data: rawSig },
},
// TODO: We need the correct type updated in ResponseSign
} = signatures as any; // eslint-disable-line
wrapperSignature: { raw: wrapperSig },
rawSignature: { raw: rawSig },
} = signatures;

if (!wrapperSig) {
throw new Error("No wrapper signature was produced!");
Expand Down Expand Up @@ -234,14 +224,9 @@ export class LedgerService {
}

const {
wrapperSignature: {
raw: { data: wrapperSig },
},
rawSignature: {
raw: { data: rawSig },
},
// TODO: We need the correct type updated in ResponseSign
} = signatures as any; // eslint-disable-line
wrapperSignature: { raw: wrapperSig },
rawSignature: { raw: rawSig },
} = signatures;

if (!wrapperSig) {
throw new Error("No wrapper signature was produced!");
Expand Down
4 changes: 2 additions & 2 deletions packages/ledger-namada/dist/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export declare const ERROR_CODE: {
NoError: number;
};
export declare const enum SignatureType {
WrapperSignature = 0,
RawSignature = 1
RawSignature = 0,
WrapperSignature = 1
}
export declare enum LedgerError {
U2FUnknown = 1,
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-namada/dist/common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ledger-namada/dist/namadaApp.js

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

9 changes: 3 additions & 6 deletions packages/ledger-namada/dist/processResponses.js

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

2 changes: 1 addition & 1 deletion packages/ledger-namada/dist/processResponses.js.map

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

4 changes: 2 additions & 2 deletions packages/ledger-namada/dist/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ export interface ResponseNullifier extends ResponseBase {
export interface ISignature {
raw: Buffer;
salt: Buffer;
hashes: Buffer[];
indicies: Buffer;
pubkey: Buffer;
signature: Buffer | null;
}
export declare class Signature implements ISignature {
raw: Buffer;
salt: Buffer;
hashes: Buffer[];
indicies: Buffer;
pubkey: Buffer;
signature: Buffer | null;
isFilled: boolean;
Expand Down
4 changes: 2 additions & 2 deletions packages/ledger-namada/dist/types.js

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

Loading

0 comments on commit d4016a4

Please sign in to comment.