Skip to content

Commit

Permalink
fix(core): export Address module from root
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyslbw committed Oct 29, 2021
1 parent 3659ec6 commit 2a1d775
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * as Address from './Address';
export * as Asset from './Asset';
export * as Cardano from './Cardano';
export * from './Genesis';
Expand Down
18 changes: 9 additions & 9 deletions packages/core/test/Address/util.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable max-len */
import { isAddress } from '../../src/Address/util';
import { Address } from '../../src';

export const addresses = {
byron: {
Expand Down Expand Up @@ -30,16 +30,16 @@ describe('Address', () => {
describe('util', () => {
describe('isAddress', () => {
it('returns true if the input is a valid Shelley or Byron-era address, on either the mainnet or testnets', async () => {
expect(isAddress(addresses.shelley.testnet)).toBe(true);
expect(isAddress(addresses.shelley.mainnet)).toBe(true);
expect(isAddress(addresses.byron.mainnet.daedalus)).toBe(true);
expect(isAddress(addresses.byron.mainnet.icarus)).toBe(true);
expect(isAddress(addresses.byron.testnet.daedalus)).toBe(true);
expect(isAddress(addresses.byron.testnet.icarus)).toBe(true);
expect(Address.util.isAddress(addresses.shelley.testnet)).toBe(true);
expect(Address.util.isAddress(addresses.shelley.mainnet)).toBe(true);
expect(Address.util.isAddress(addresses.byron.mainnet.daedalus)).toBe(true);
expect(Address.util.isAddress(addresses.byron.mainnet.icarus)).toBe(true);
expect(Address.util.isAddress(addresses.byron.testnet.daedalus)).toBe(true);
expect(Address.util.isAddress(addresses.byron.testnet.icarus)).toBe(true);
});
test('returns false if the input is not a Cardano address', async () => {
expect(isAddress(addresses.invalid.short)).toBe(false);
expect(isAddress(addresses.invalid.networkMagic)).toBe(false);
expect(Address.util.isAddress(addresses.invalid.short)).toBe(false);
expect(Address.util.isAddress(addresses.invalid.networkMagic)).toBe(false);
});
});
});
Expand Down

0 comments on commit 2a1d775

Please sign in to comment.