Skip to content

Commit

Permalink
Don't rely on bignumber.js in @celo/base (#8923)
Browse files Browse the repository at this point in the history
### Description

There was this small exception to the objective of `@celo/base` not having any dependencies
  • Loading branch information
nambrot authored Nov 3, 2021
1 parent 45c8031 commit d55316c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/sdk/base/src/address.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import BigNumber from 'bignumber.js'

const HEX_REGEX = /^0x[0-9A-F]*$/i

export type Address = string
Expand All @@ -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()

Expand Down

0 comments on commit d55316c

Please sign in to comment.