mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Increasing sleep times
This commit is contained in:
parent
5ebca8fec3
commit
dc21fcdf8d
@ -130,7 +130,7 @@ describe('DFRewards tests', async () => {
|
|||||||
datatokenAddress1
|
datatokenAddress1
|
||||||
)
|
)
|
||||||
// check subgraph
|
// check subgraph
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const initialQuery = {
|
const initialQuery = {
|
||||||
query: `query {
|
query: `query {
|
||||||
dfrewards(where: {id:"${user1.toLowerCase()}"}){
|
dfrewards(where: {id:"${user1.toLowerCase()}"}){
|
||||||
@ -190,7 +190,7 @@ describe('DFRewards tests', async () => {
|
|||||||
datatokenAddress1
|
datatokenAddress1
|
||||||
)
|
)
|
||||||
// check subgraph
|
// check subgraph
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const initialQuery = {
|
const initialQuery = {
|
||||||
query: `query {
|
query: `query {
|
||||||
dfrewards(where: {id:"${user2.toLowerCase()}"}){
|
dfrewards(where: {id:"${user2.toLowerCase()}"}){
|
||||||
|
@ -135,7 +135,7 @@ describe('Datatoken tests', async () => {
|
|||||||
datatokenAddress = result.events.TokenCreated.returnValues[0].toLowerCase()
|
datatokenAddress = result.events.TokenCreated.returnValues[0].toLowerCase()
|
||||||
|
|
||||||
// Check values before updating metadata
|
// Check values before updating metadata
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const initialQuery = {
|
const initialQuery = {
|
||||||
query: `query {
|
query: `query {
|
||||||
token(id: "${datatokenAddress}"){
|
token(id: "${datatokenAddress}"){
|
||||||
@ -169,7 +169,7 @@ describe('Datatoken tests', async () => {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(initialQuery)
|
body: JSON.stringify(initialQuery)
|
||||||
})
|
})
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const dt = (await initialResponse.json()).data.token
|
const dt = (await initialResponse.json()).data.token
|
||||||
|
|
||||||
const tx: TransactionReceipt = await web3.eth.getTransactionReceipt(dt.tx)
|
const tx: TransactionReceipt = await web3.eth.getTransactionReceipt(dt.tx)
|
||||||
@ -243,7 +243,7 @@ describe('Datatoken tests', async () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Check values before updating metadata
|
// Check values before updating metadata
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const initialQuery = {
|
const initialQuery = {
|
||||||
query: `query {
|
query: `query {
|
||||||
token(id: "${datatokenAddress}"){
|
token(id: "${datatokenAddress}"){
|
||||||
@ -277,7 +277,7 @@ describe('Datatoken tests', async () => {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(initialQuery)
|
body: JSON.stringify(initialQuery)
|
||||||
})
|
})
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const dt = (await initialResponse.json()).data.token
|
const dt = (await initialResponse.json()).data.token
|
||||||
|
|
||||||
const tx: TransactionReceipt = await web3.eth.getTransactionReceipt(dt.tx)
|
const tx: TransactionReceipt = await web3.eth.getTransactionReceipt(dt.tx)
|
||||||
@ -347,7 +347,7 @@ describe('Datatoken tests', async () => {
|
|||||||
nftParams,
|
nftParams,
|
||||||
erc20Params
|
erc20Params
|
||||||
)
|
)
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const newDtAddress = result.events.TokenCreated.returnValues[0]
|
const newDtAddress = result.events.TokenCreated.returnValues[0]
|
||||||
|
|
||||||
const datatoken = new Datatoken(web3, 8996)
|
const datatoken = new Datatoken(web3, 8996)
|
||||||
@ -361,7 +361,7 @@ describe('Datatoken tests', async () => {
|
|||||||
query: `query {token(id: "${newDtAddress.toLowerCase()}"){id,orderCount,orders {id, nftOwner{id}, lastPriceToken{id}}}}`
|
query: `query {token(id: "${newDtAddress.toLowerCase()}"){id,orderCount,orders {id, nftOwner{id}, lastPriceToken{id}}}}`
|
||||||
}
|
}
|
||||||
|
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
let response = await fetch(subgraphUrl, {
|
let response = await fetch(subgraphUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(query)
|
body: JSON.stringify(query)
|
||||||
@ -407,7 +407,7 @@ describe('Datatoken tests', async () => {
|
|||||||
assert(orderTx, 'Invalid orderTx')
|
assert(orderTx, 'Invalid orderTx')
|
||||||
const orderId = `${orderTx.transactionHash.toLowerCase()}-${newDtAddress.toLowerCase()}-${user1.toLowerCase()}`
|
const orderId = `${orderTx.transactionHash.toLowerCase()}-${newDtAddress.toLowerCase()}-${user1.toLowerCase()}`
|
||||||
|
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
response = await fetch(subgraphUrl, {
|
response = await fetch(subgraphUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(query)
|
body: JSON.stringify(query)
|
||||||
|
@ -18,7 +18,7 @@ import { fetch } from 'cross-fetch'
|
|||||||
import { TransactionReceipt } from 'web3-core'
|
import { TransactionReceipt } from 'web3-core'
|
||||||
import { AbiItem } from 'web3-utils/types'
|
import { AbiItem } from 'web3-utils/types'
|
||||||
|
|
||||||
const sleepMs = 1800
|
const sleepMs = 3000
|
||||||
|
|
||||||
const data = JSON.parse(
|
const data = JSON.parse(
|
||||||
fs.readFileSync(
|
fs.readFileSync(
|
||||||
|
@ -149,7 +149,7 @@ describe('FactoryRouter tests', async () => {
|
|||||||
)
|
)
|
||||||
datatokenAddress = result.events.TokenCreated.returnValues[0].toLowerCase()
|
datatokenAddress = result.events.TokenCreated.returnValues[0].toLowerCase()
|
||||||
await router.addApprovedToken(ownerAccount, datatokenAddress)
|
await router.addApprovedToken(ownerAccount, datatokenAddress)
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const tokens = await getSubgraphApprovedTokens()
|
const tokens = await getSubgraphApprovedTokens()
|
||||||
assert(tokens.includes(datatokenAddress.toLowerCase()))
|
assert(tokens.includes(datatokenAddress.toLowerCase()))
|
||||||
assert(tokens.length === 2)
|
assert(tokens.length === 2)
|
||||||
@ -157,7 +157,7 @@ describe('FactoryRouter tests', async () => {
|
|||||||
|
|
||||||
it('Owner should remove token from the approved list', async () => {
|
it('Owner should remove token from the approved list', async () => {
|
||||||
await router.removeApprovedToken(ownerAccount, datatokenAddress)
|
await router.removeApprovedToken(ownerAccount, datatokenAddress)
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const tokens = await getSubgraphApprovedTokens()
|
const tokens = await getSubgraphApprovedTokens()
|
||||||
assert(!tokens.includes(datatokenAddress.toLowerCase()))
|
assert(!tokens.includes(datatokenAddress.toLowerCase()))
|
||||||
assert(tokens.length === 1)
|
assert(tokens.length === 1)
|
||||||
|
@ -18,7 +18,7 @@ import { TransactionReceipt } from 'web3-core'
|
|||||||
import { AbiItem } from 'web3-utils/types'
|
import { AbiItem } from 'web3-utils/types'
|
||||||
import BN from 'bn.js'
|
import BN from 'bn.js'
|
||||||
|
|
||||||
const sleepMs = 1700
|
const sleepMs = 3000
|
||||||
|
|
||||||
const data = JSON.parse(
|
const data = JSON.parse(
|
||||||
fs.readFileSync(
|
fs.readFileSync(
|
||||||
|
@ -121,7 +121,7 @@ describe('NFT tests', async () => {
|
|||||||
datatokenAddress = result.events.TokenCreated.returnValues[0]
|
datatokenAddress = result.events.TokenCreated.returnValues[0]
|
||||||
|
|
||||||
// Check values before updating metadata
|
// Check values before updating metadata
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
nftAddress = erc721Address.toLowerCase()
|
nftAddress = erc721Address.toLowerCase()
|
||||||
const initialQuery = {
|
const initialQuery = {
|
||||||
query: `query {
|
query: `query {
|
||||||
@ -150,7 +150,7 @@ describe('NFT tests', async () => {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(initialQuery)
|
body: JSON.stringify(initialQuery)
|
||||||
})
|
})
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const nft = (await initialResponse.json()).data.nft
|
const nft = (await initialResponse.json()).data.nft
|
||||||
const tx: TransactionReceipt = await web3.eth.getTransactionReceipt(nft.tx)
|
const tx: TransactionReceipt = await web3.eth.getTransactionReceipt(nft.tx)
|
||||||
assert(nft.id === nftAddress, 'incorrect value for: id')
|
assert(nft.id === nftAddress, 'incorrect value for: id')
|
||||||
@ -211,7 +211,7 @@ describe('NFT tests', async () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// graph tests here
|
// graph tests here
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const query = {
|
const query = {
|
||||||
query: `query {
|
query: `query {
|
||||||
nft(id:"${nftAddress}"){
|
nft(id:"${nftAddress}"){
|
||||||
@ -288,7 +288,7 @@ describe('NFT tests', async () => {
|
|||||||
|
|
||||||
it('Set a key/value in erc725 store', async () => {
|
it('Set a key/value in erc725 store', async () => {
|
||||||
await nft.setData(nftAddress, publisher, 'test_key', 'test_value')
|
await nft.setData(nftAddress, publisher, 'test_key', 'test_value')
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const query = {
|
const query = {
|
||||||
query: `query {
|
query: `query {
|
||||||
nft(id:"${nftAddress}"){
|
nft(id:"${nftAddress}"){
|
||||||
|
@ -148,7 +148,7 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// graph tests here
|
// graph tests here
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const graphNftToken = erc721Address.toLowerCase()
|
const graphNftToken = erc721Address.toLowerCase()
|
||||||
const query = {
|
const query = {
|
||||||
query: `query {
|
query: `query {
|
||||||
@ -184,7 +184,7 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
nftParams,
|
nftParams,
|
||||||
erc20Params
|
erc20Params
|
||||||
)
|
)
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const erc721Address = result.events.NFTCreated.returnValues[0]
|
const erc721Address = result.events.NFTCreated.returnValues[0]
|
||||||
const datatokenAddress = result.events.TokenCreated.returnValues[0]
|
const datatokenAddress = result.events.TokenCreated.returnValues[0]
|
||||||
const graphNftToken = erc721Address.toLowerCase()
|
const graphNftToken = erc721Address.toLowerCase()
|
||||||
@ -228,11 +228,11 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
encryptedResponse,
|
encryptedResponse,
|
||||||
'0x' + metadataHash
|
'0x' + metadataHash
|
||||||
)
|
)
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
|
|
||||||
// Transfer the NFT
|
// Transfer the NFT
|
||||||
await nft.transferNft(graphNftToken, publisherAccount, newOwnerAccount)
|
await nft.transferNft(graphNftToken, publisherAccount, newOwnerAccount)
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const query2 = {
|
const query2 = {
|
||||||
query: `query {
|
query: `query {
|
||||||
nft(id:"${graphNftToken}"){symbol,id,owner{id}, transferable}}`
|
nft(id:"${graphNftToken}"){symbol,id,owner{id}, transferable}}`
|
||||||
@ -286,7 +286,7 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
query: `query {order(id:"${orderId}"){id, providerFee, lastPriceToken{id}}}`
|
query: `query {order(id:"${orderId}"){id, providerFee, lastPriceToken{id}}}`
|
||||||
}
|
}
|
||||||
|
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const response = await fetch(subgraphUrl, {
|
const response = await fetch(subgraphUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(query)
|
body: JSON.stringify(query)
|
||||||
@ -359,7 +359,7 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
const initialQuery = {
|
const initialQuery = {
|
||||||
query: `query {order(id:"${orderId}"){id, providerFee, lastPriceToken{id}}}`
|
query: `query {order(id:"${orderId}"){id, providerFee, lastPriceToken{id}}}`
|
||||||
}
|
}
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const initialResponse = await fetch(subgraphUrl, {
|
const initialResponse = await fetch(subgraphUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(initialQuery)
|
body: JSON.stringify(initialQuery)
|
||||||
@ -429,7 +429,7 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
query: `query {orderReuse(id:"${reusedOrder.transactionHash}"){id, providerFee}}`
|
query: `query {orderReuse(id:"${reusedOrder.transactionHash}"){id, providerFee}}`
|
||||||
}
|
}
|
||||||
|
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const response = await fetch(subgraphUrl, {
|
const response = await fetch(subgraphUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(reuseQuery)
|
body: JSON.stringify(reuseQuery)
|
||||||
|
@ -69,7 +69,7 @@ describe('Tests coverage without provider/aquarius', async () => {
|
|||||||
const erc721Address = result.events.NFTCreated.returnValues[0]
|
const erc721Address = result.events.NFTCreated.returnValues[0]
|
||||||
|
|
||||||
// graph tests here
|
// graph tests here
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const graphNftToken = erc721Address.toLowerCase()
|
const graphNftToken = erc721Address.toLowerCase()
|
||||||
const query = {
|
const query = {
|
||||||
query: `query {
|
query: `query {
|
||||||
@ -106,7 +106,7 @@ describe('Tests coverage without provider/aquarius', async () => {
|
|||||||
nftParams,
|
nftParams,
|
||||||
erc20Params
|
erc20Params
|
||||||
)
|
)
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const erc721Address = result.events.NFTCreated.returnValues[0]
|
const erc721Address = result.events.NFTCreated.returnValues[0]
|
||||||
const nftAddress = erc721Address.toLowerCase()
|
const nftAddress = erc721Address.toLowerCase()
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ describe('Tests coverage without provider/aquarius', async () => {
|
|||||||
newOwnerAccount
|
newOwnerAccount
|
||||||
)
|
)
|
||||||
|
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const query2 = {
|
const query2 = {
|
||||||
query: `query {
|
query: `query {
|
||||||
nft(id:"${nftAddress}"){
|
nft(id:"${nftAddress}"){
|
||||||
|
@ -165,7 +165,7 @@ describe('veOcean tests', async () => {
|
|||||||
}
|
}
|
||||||
currentBalance = await veOcean.getLockedAmount(Alice)
|
currentBalance = await veOcean.getLockedAmount(Alice)
|
||||||
currentLock = await veOcean.lockEnd(Alice)
|
currentLock = await veOcean.lockEnd(Alice)
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const initialQuery = {
|
const initialQuery = {
|
||||||
query: `query {
|
query: `query {
|
||||||
veOCEANs(id:"${Alice.toLowerCase()}"){
|
veOCEANs(id:"${Alice.toLowerCase()}"){
|
||||||
@ -190,7 +190,7 @@ describe('veOcean tests', async () => {
|
|||||||
const newLock = parseInt(String(currentLock)) + 7 * 86400
|
const newLock = parseInt(String(currentLock)) + 7 * 86400
|
||||||
await veOcean.increaseUnlockTime(Alice, newLock)
|
await veOcean.increaseUnlockTime(Alice, newLock)
|
||||||
const newCurrentLock = await veOcean.lockEnd(Alice)
|
const newCurrentLock = await veOcean.lockEnd(Alice)
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const initialQuery = {
|
const initialQuery = {
|
||||||
query: `query {
|
query: `query {
|
||||||
veOCEANs(id:"${Alice.toLowerCase()}"){
|
veOCEANs(id:"${Alice.toLowerCase()}"){
|
||||||
@ -227,7 +227,7 @@ describe('veOcean tests', async () => {
|
|||||||
await veOcean.increaseAmount(Alice, amount)
|
await veOcean.increaseAmount(Alice, amount)
|
||||||
const newCurrentBalance = await veOcean.getLockedAmount(Alice)
|
const newCurrentBalance = await veOcean.getLockedAmount(Alice)
|
||||||
const newCurrentLock = await veOcean.lockEnd(Alice)
|
const newCurrentLock = await veOcean.lockEnd(Alice)
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
const initialQuery = {
|
const initialQuery = {
|
||||||
query: `query {
|
query: `query {
|
||||||
veOCEANs(id:"${Alice.toLowerCase()}"){
|
veOCEANs(id:"${Alice.toLowerCase()}"){
|
||||||
@ -289,7 +289,7 @@ describe('veOcean tests', async () => {
|
|||||||
it('Alice should allocate 10% to NFT1', async () => {
|
it('Alice should allocate 10% to NFT1', async () => {
|
||||||
await veAllocate.setAllocation(Alice, '1000', nft1, chainId)
|
await veAllocate.setAllocation(Alice, '1000', nft1, chainId)
|
||||||
const newTotalAllocation = await veAllocate.getTotalAllocation(Alice)
|
const newTotalAllocation = await veAllocate.getTotalAllocation(Alice)
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
let initialQuery = {
|
let initialQuery = {
|
||||||
query: `query {
|
query: `query {
|
||||||
veAllocateUsers(id:"${Alice.toLowerCase()}"){
|
veAllocateUsers(id:"${Alice.toLowerCase()}"){
|
||||||
@ -341,7 +341,7 @@ describe('veOcean tests', async () => {
|
|||||||
)
|
)
|
||||||
const totalAllocation = await veAllocate.getTotalAllocation(Alice)
|
const totalAllocation = await veAllocate.getTotalAllocation(Alice)
|
||||||
|
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
let initialQuery = {
|
let initialQuery = {
|
||||||
query: `query {
|
query: `query {
|
||||||
veAllocateUsers(id:"${Alice.toLowerCase()}"){
|
veAllocateUsers(id:"${Alice.toLowerCase()}"){
|
||||||
|
@ -18,7 +18,7 @@ import fs from 'fs'
|
|||||||
import { fetch } from 'cross-fetch'
|
import { fetch } from 'cross-fetch'
|
||||||
import { AbiItem } from 'web3-utils/types'
|
import { AbiItem } from 'web3-utils/types'
|
||||||
|
|
||||||
const sleepMs = 1700
|
const sleepMs = 3000
|
||||||
|
|
||||||
const data = JSON.parse(
|
const data = JSON.parse(
|
||||||
fs.readFileSync(
|
fs.readFileSync(
|
||||||
@ -281,7 +281,7 @@ describe('User tests', async () => {
|
|||||||
)
|
)
|
||||||
assert(orderTx.events.OrderStarted, 'Invalid orderTx')
|
assert(orderTx.events.OrderStarted, 'Invalid orderTx')
|
||||||
|
|
||||||
await sleep(2000)
|
await sleep(3000)
|
||||||
|
|
||||||
const user = await userQuery(user3)
|
const user = await userQuery(user3)
|
||||||
assert(user.id === user3, 'incorrect value for: id')
|
assert(user.id === user3, 'incorrect value for: id')
|
||||||
|
Loading…
Reference in New Issue
Block a user