Skip to content

Commit

Permalink
feat(signer): always return string signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
delaaxe committed Mar 3, 2022
1 parent fa29b6a commit 0e9dd6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/types/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ec as EC } from 'elliptic';
import type { BigNumberish } from '../utils/number';

export type KeyPair = EC.KeyPair;
export type Signature = BigNumberish[];
export type Signature = string[];
export type RawCalldata = BigNumberish[];

export type DeployContractPayload = {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ellipticCurve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function sign(keyPair: KeyPair, msgHash: string): Signature {
assertInRange(r, ONE, toBN(addHexPrefix(MAX_ECDSA_VAL)), 'r');
assertInRange(s, ONE, toBN(addHexPrefix(EC_ORDER)), 's');
assertInRange(w, ONE, toBN(addHexPrefix(MAX_ECDSA_VAL)), 'w');
return [r, s];
return [r.toString(), s.toString()];
}

function chunkArray(arr: any[], n: number): any[][] {
Expand Down

0 comments on commit 0e9dd6c

Please sign in to comment.