diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b663d4d2..ce32863f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v2 with: - node-version: '16' + node-version: '20' - name: Cache node_modules uses: actions/cache@v2 env: @@ -37,7 +37,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v2 with: - node-version: '16' + node-version: '20' - name: Cache node_modules uses: actions/cache@v2 env: @@ -83,7 +83,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v2 with: - node-version: '16' + node-version: '20' - name: Cache node_modules uses: actions/cache@v2 env: @@ -155,7 +155,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - node: ['15', '16'] + node: ['20', '18'] steps: - uses: actions/checkout@v3 @@ -199,7 +199,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v2 with: - node-version: '16' + node-version: '20' - name: checkout ocean.js repo uses: actions/checkout@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 277bc9f22..91684ab5c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v2 with: - node-version: '16' + node-version: '20' registry-url: https://registry.npmjs.org/ - run: npm ci diff --git a/.nvmrc b/.nvmrc index 19c7bdba7..2edeafb09 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 \ No newline at end of file +20 \ No newline at end of file diff --git a/src/utils/ContractUtils.ts b/src/utils/ContractUtils.ts index 6d7be84c7..fa4e18b42 100644 --- a/src/utils/ContractUtils.ts +++ b/src/utils/ContractUtils.ts @@ -1,11 +1,13 @@ import { ethers, Signer, providers, Contract, ContractFunction, BigNumber } from 'ethers' import { Config } from '../config' -import { minAbi } from '.' +import { LoggerInstance, minAbi } from '.' const MIN_GAS_FEE_POLYGON = 30000000000 // minimum recommended 30 gwei polygon main and mumbai fees +const MIN_GAS_FEE_SEPOLIA = 4000000000 // minimum 4 gwei for eth sepolia testnet const POLYGON_NETWORK_ID = 137 const MUMBAI_NETWORK_ID = 80001 +const SEPOLIA_NETWORK_ID = 11155111 export function setContractDefaults(contract: Contract, config: Config): Contract { // TO DO - since ethers does not provide this @@ -134,11 +136,18 @@ export async function sendTx( (chainId === MUMBAI_NETWORK_ID || chainId === POLYGON_NETWORK_ID) && Number(aggressiveFeePriorityFeePerGas) < MIN_GAS_FEE_POLYGON ? MIN_GAS_FEE_POLYGON + : chainId === SEPOLIA_NETWORK_ID && + Number(aggressiveFeePriorityFeePerGas) < MIN_GAS_FEE_SEPOLIA + ? MIN_GAS_FEE_SEPOLIA : Number(aggressiveFeePriorityFeePerGas), + maxFeePerGas: (chainId === MUMBAI_NETWORK_ID || chainId === POLYGON_NETWORK_ID) && Number(aggressiveFeePerGas) < MIN_GAS_FEE_POLYGON ? MIN_GAS_FEE_POLYGON + : chainId === SEPOLIA_NETWORK_ID && + Number(aggressiveFeePerGas) < MIN_GAS_FEE_SEPOLIA + ? MIN_GAS_FEE_SEPOLIA : Number(aggressiveFeePerGas) } } else { @@ -149,8 +158,10 @@ export async function sendTx( overrides.gasLimit = estGas.add(20000) try { const trxReceipt = await functionToSend(...args, overrides) + await trxReceipt.wait() return trxReceipt } catch (e) { + LoggerInstance.error('Send tx error: ', e) return null } } diff --git a/test/integration/PublishEditConsume.test.ts b/test/integration/PublishEditConsume.test.ts index 3569bd339..c140f6076 100644 --- a/test/integration/PublishEditConsume.test.ts +++ b/test/integration/PublishEditConsume.test.ts @@ -95,7 +95,7 @@ const grapqlFile: Files = { files: [ { type: 'graphql', - url: 'https://v4.subgraph.goerli.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph', + url: 'https://v4.subgraph.sepolia.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph', query: `" query{ nfts(orderBy: createdTimestamp,orderDirection:desc){ @@ -392,7 +392,7 @@ describe('Publish consume test', async () => { providerUrl ) assert(grapqlOrderTx, 'Ordering graphql dataset failed.') - }) + }).timeout(40000) it('Should download the datasets files', async () => { const urlDownloadUrl = await ProviderInstance.getDownloadUrl( diff --git a/test/integration/PublishFlows.test.ts b/test/integration/PublishFlows.test.ts index 66af328e2..993756919 100644 --- a/test/integration/PublishFlows.test.ts +++ b/test/integration/PublishFlows.test.ts @@ -196,12 +196,12 @@ describe('Publish tests', async () => { ) }) - delay(10000) + delay(19000) it('should resolve the fixed price dataset', async () => { const resolvedDDO = await aquarius.waitForAqua(fixedPricedDID) assert(resolvedDDO, 'Cannot fetch DDO from Aquarius') - }) + }).timeout(40000) it('should publish a dataset with dispenser (create NFT + Datatoken + dispenser) with no defined MetadataProof', async () => { const dispenserDdo: DDO = { ...genericAsset } @@ -289,7 +289,7 @@ describe('Publish tests', async () => { ) }) - delay(10000) + delay(19000) it('should resolve the free dataset', async () => { const resolvedDDO = await aquarius.waitForAqua(dispenserDID)