From d55316c94c873313dec7f2478163e32b5f7492eb Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Wed, 3 Nov 2021 14:20:42 -0400 Subject: [PATCH] Don't rely on bignumber.js in @celo/base (#8923) ### Description There was this small exception to the objective of `@celo/base` not having any dependencies --- packages/sdk/base/src/address.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/sdk/base/src/address.ts b/packages/sdk/base/src/address.ts index 2f066f10d1c..32b484f440d 100644 --- a/packages/sdk/base/src/address.ts +++ b/packages/sdk/base/src/address.ts @@ -1,5 +1,3 @@ -import BigNumber from 'bignumber.js' - const HEX_REGEX = /^0x[0-9A-F]*$/i export type Address = string @@ -8,7 +6,7 @@ export const eqAddress = (a: Address, b: Address) => normalizeAddress(a) === nor export const normalizeAddress = (a: Address) => trimLeading0x(a).toLowerCase() -export const isNullAddress = (a: Address) => new BigNumber(normalizeAddress(a)).isZero() +export const isNullAddress = (a: Address) => normalizeAddress(a) === NULL_ADDRESS export const normalizeAddressWith0x = (a: Address) => ensureLeading0x(a).toLowerCase()