Skip to content

Commit

Permalink
web3-utils types
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstevens19 committed Mar 15, 2019
1 parent eb1d5d4 commit f15fb64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/web3-utils/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function getUnitValue(unit: Unit): string;
export function unitMap(): Units;
export function testAddress(bloom: string, address: string): boolean;
export function testTopic(bloom: string, topic: string): boolean;
export function getSignatureParameters(signature: string): object;
export function getSignatureParameters(signature: string): {r: string; s: string; v: number};

// interfaces
export interface Utils {
Expand Down Expand Up @@ -168,7 +168,7 @@ export interface Utils {
unitMap(): Units;
testAddress(bloom: string, address: string): boolean;
testTopic(bloom: string, topic: string): boolean;
getSignatureParameters(signature: string): object;
getSignatureParameters(signature: string): {r: string; s: string; v: number};
}

export interface Units {
Expand Down
6 changes: 4 additions & 2 deletions packages/web3-utils/types/tests/get-signature-params-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@

import {BN, getSignatureParameters} from 'web3-utils';

// $ExpectType object
getSignatureParameters('0x90dc0e49b5a80eef86fcedcb863dcc727aeae5c11187c001fd3d18780ead2cc7701ba1986099a49164702f3d8b2c8dbbd45a6d1beb37d212d21fb1be4bb762a400');
// $ExpectType {r: string; s: string; v: number}
getSignatureParameters(
'0x90dc0e49b5a80eef86fcedcb863dcc727aeae5c11187c001fd3d18780ead2cc7701ba1986099a49164702f3d8b2c8dbbd45a6d1beb37d212d21fb1be4bb762a400'
);
// $ExpectError
getSignatureParameters(345);
// $ExpectError
Expand Down

0 comments on commit f15fb64

Please sign in to comment.