Skip to content

Commit

Permalink
change load contracts interface
Browse files Browse the repository at this point in the history
  • Loading branch information
H34D committed Sep 5, 2022
1 parent c72a3f0 commit f5bd696
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/common/helpers/contracts/index.ts
Expand Up @@ -12,7 +12,13 @@ const addresses = {
alfajores,
};

export const loadContracts = async (provider?: any, network = 'alfajores') => {
export const loadContracts = async ({
provider,
network = 'alfajores',
}: {
provider?: any;
network?: string;
}) => {
const p =
// take provider as is if supplied
provider ||
Expand Down
4 changes: 2 additions & 2 deletions test/contracts.test.tsx
Expand Up @@ -11,13 +11,13 @@ describe('Contracts', () => {
});

it('should load contracts', async () => {
const contracts = await loadContracts(provider);
const contracts = await loadContracts({ provider });
expect(contracts.SoulboundIdentityContract).toBeDefined();
expect(contracts.SoulboundCreditReportContract).toBeDefined();
});

it('should display contracts addresses properly', async () => {
const contracts = await loadContracts(provider);
const contracts = await loadContracts({ provider });
console.log(
'SoulboundIdentityContract Address',
contracts.SoulboundIdentityContract.address
Expand Down

0 comments on commit f5bd696

Please sign in to comment.