Skip to content

Commit

Permalink
chore: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
njokuScript committed Feb 5, 2024
1 parent 50b7290 commit 5daf9f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ async function create(
collateral: ICollateral;
},
) {
const supportedNetworks = [SupportedNetwork.BASE_GOERLI, SupportedNetwork.BASE_SEPOLIA];

// Validate required options
if (!options.collateral) {
throw new Error('Missing required options');
Expand All @@ -286,10 +288,7 @@ async function create(
}
const chainId = (await provider.getNetwork()).chainId.toString(10);

if (
![chainId].includes(SupportedNetwork.BASE_GOERLI) ||
![chainId].includes(SupportedNetwork.BASE_SEPOLIA)
) {
if (!supportedNetworks.includes(chainId)) {
throw new Error(`chainId '${chainId}' is not supported.`);
}

Expand Down
2 changes: 1 addition & 1 deletion test/getters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ config();
describe('Descent Protocol SDK Test', () => {
let descent: DescentClass;
let owner = '0x459D7FB72ac3dFB0666227B30F25A424A5583E9c';
let rpcUrl = 'https://goerli.base.org';
let rpcUrl = 'https://sepolia.base.org';

beforeAll(async () => {
descent = await Descent.create('https', {
Expand Down

0 comments on commit 5daf9f4

Please sign in to comment.