Skip to content

Commit

Permalink
Don't accept undefined in numberToRpcQuantity
Browse files Browse the repository at this point in the history
  • Loading branch information
fvictorio committed Mar 31, 2021
1 parent 67a21fc commit fcda6cb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export interface RpcLogOutput {

// tslint:disable only-hardhat-error

export function numberToRpcQuantity(n: number | BN | undefined): string {
export function numberToRpcQuantity(n: number | BN): string {
// This is here because we have some any's from dependencies
if (typeof n !== "number" && Buffer.isBuffer(n)) {
throw new Error(`Expected a number and got ${n}`);
Expand All @@ -87,7 +87,7 @@ export function numberToRpcQuantity(n: number | BN | undefined): string {
n = new BN(n);
}

return `0x${n?.toString(16)}`;
return `0x${n.toString(16)}`;
}

export function bufferToRpcData(buffer: Buffer, pad: number = 0): string {
Expand Down

0 comments on commit fcda6cb

Please sign in to comment.