Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #212 from ConsenSys/fix/NFTSDK-000-polygonUrl
Browse files Browse the repository at this point in the history
NFT-000: fix polygon url
  • Loading branch information
sahar-fehri committed Jun 16, 2023
2 parents d573381 + b3fb1f9 commit 005f5d3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions integration-test/sdk.polygon.gasstation.test-integration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { config as loadEnv } from 'dotenv';

import axios from 'axios';

loadEnv();

describe('E2E Test: Sdk (read)', () => {
// fix to avoid axios open handle
beforeEach(async () => {
await process.nextTick(() => {});
});

describe('It should get gas price from gasstation', () => {
it('Should resolve gassation url correctly', async () => {
const { data } = await axios({
method: 'get',
url: 'https://gasstation.polygon.technology/v2',
});
const gas = data.fast;
expect(gas).toBeDefined;
expect(gas).toMatchObject({
maxPriorityFee: expect.anything(),
maxFee: expect.anything(),
});
});
});
});
2 changes: 1 addition & 1 deletion src/lib/ContractTemplates/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default async function preparePolygonTransaction(nonce: number) {
try {
const { data } = await axios({
method: 'get',
url: 'https://gasstation-mainnet.matic.network/v2',
url: 'https://gasstation.polygon.technology/v2',
});
const gas = data.fast;

Expand Down

0 comments on commit 005f5d3

Please sign in to comment.