mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Updating query for shares and transactions
This commit is contained in:
parent
5e20c75006
commit
07523aac27
@ -523,7 +523,7 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
const erc20Token =
|
const erc20Token =
|
||||||
txReceipt.events.TokenCreated.returnValues.newTokenAddress
|
txReceipt.events.TokenCreated.returnValues.newTokenAddress
|
||||||
const tx = txReceipt.transactionHash.toLowerCase()
|
const tx = txReceipt.transactionHash.toLowerCase()
|
||||||
const txBlockHash = txReceipt.blockHash.toLowerCase()
|
const txBlock = txReceipt.blockNumber
|
||||||
|
|
||||||
const poolQuery = {
|
const poolQuery = {
|
||||||
query: `query {pool(id:"${poolAddress.toLocaleLowerCase()}"){
|
query: `query {pool(id:"${poolAddress.toLocaleLowerCase()}"){
|
||||||
@ -553,8 +553,8 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
createdTimestamp,
|
createdTimestamp,
|
||||||
tx,
|
tx,
|
||||||
block,
|
block,
|
||||||
shares,
|
shares{id},
|
||||||
transactions,
|
transactions{id},
|
||||||
publishMarketFeeAddress }}`
|
publishMarketFeeAddress }}`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,8 +566,6 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
|
|
||||||
const poolData = (await response.json()).data.pool
|
const poolData = (await response.json()).data.pool
|
||||||
|
|
||||||
console.log('poolData', poolData)
|
|
||||||
|
|
||||||
// assert(poolData.controller === controller, 'controller is null')
|
// assert(poolData.controller === controller, 'controller is null')
|
||||||
assert(poolData.isFinalized === true, 'isFinalized is false')
|
assert(poolData.isFinalized === true, 'isFinalized is false')
|
||||||
assert(poolData.symbol === ecr20Symbol, 'invalid symbol')
|
assert(poolData.symbol === ecr20Symbol, 'invalid symbol')
|
||||||
@ -577,8 +575,8 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
poolData.baseToken.id === addresses.MockDAI.toLowerCase(),
|
poolData.baseToken.id === addresses.MockDAI.toLowerCase(),
|
||||||
'invalid baseToken'
|
'invalid baseToken'
|
||||||
)
|
)
|
||||||
assert(poolData.baseTokenLiquidity !== null, 'baseTokenLiquidity is null')
|
assert(poolData.baseTokenLiquidity, 'baseTokenLiquidity is null')
|
||||||
assert(poolData.baseTokenWeight !== null, 'baseTokenWeight is null')
|
assert(poolData.baseTokenWeight, 'baseTokenWeight is null')
|
||||||
assert(
|
assert(
|
||||||
poolData.datatoken.id === erc20Token.toLowerCase(),
|
poolData.datatoken.id === erc20Token.toLowerCase(),
|
||||||
'invalid datatoken'
|
'invalid datatoken'
|
||||||
@ -587,37 +585,31 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
poolData.datatokenLiquidity === poolLiquidity,
|
poolData.datatokenLiquidity === poolLiquidity,
|
||||||
'invalid datatokenLiquidity'
|
'invalid datatokenLiquidity'
|
||||||
)
|
)
|
||||||
assert(poolData.datatokenWeight !== null, 'datatokenWeight is null')
|
assert(poolData.datatokenWeight, 'datatokenWeight is null')
|
||||||
|
assert(poolData.publishMarketSwapFee, 'publishMarketSwapFee is null')
|
||||||
assert(
|
assert(
|
||||||
poolData.publishMarketSwapFee !== null,
|
poolData.publishMarketSwapFeeAmount,
|
||||||
'publishMarketSwapFee is null'
|
|
||||||
)
|
|
||||||
assert(
|
|
||||||
poolData.publishMarketSwapFeeAmount !== null,
|
|
||||||
'publishMarketSwapFeeAmount is null'
|
'publishMarketSwapFeeAmount is null'
|
||||||
)
|
)
|
||||||
assert(
|
assert(
|
||||||
poolData.liquidityProviderSwapFee !== null,
|
poolData.liquidityProviderSwapFee,
|
||||||
'liquidityProviderSwapFee is null'
|
'liquidityProviderSwapFee is null'
|
||||||
)
|
)
|
||||||
assert(
|
assert(
|
||||||
poolData.liquidityProviderSwapFeeAmount !== null,
|
poolData.liquidityProviderSwapFeeAmount,
|
||||||
'liquidityProviderSwapFeeAmount is null'
|
'liquidityProviderSwapFeeAmount is null'
|
||||||
)
|
)
|
||||||
assert(poolData.totalShares !== null, 'totalShares is null')
|
assert(poolData.totalShares, 'totalShares is null')
|
||||||
assert(poolData.totalSwapVolume !== null, 'totalSwapVolume is null')
|
assert(poolData.totalSwapVolume !== null, 'totalSwapVolume is null')
|
||||||
assert(poolData.spotPrice !== null, 'spotPrice is null')
|
assert(poolData.spotPrice, 'spotPrice is null')
|
||||||
assert(poolData.exitCount !== null, 'exitCount is null')
|
assert(poolData.exitCount, 'exitCount is null')
|
||||||
assert(poolData.swapCount !== null, 'swapCount is null')
|
assert(poolData.swapCount, 'swapCount is null')
|
||||||
assert(poolData.transactionCount !== null, 'transactionCount is null')
|
assert(poolData.transactionCount, 'transactionCount is null')
|
||||||
assert(poolData.createdTimestamp !== null, 'createdTimestamp is null')
|
assert(poolData.createdTimestamp !== null, 'createdTimestamp is null')
|
||||||
assert(poolData.tx === tx, 'invalid tx')
|
assert(poolData.tx === tx, 'invalid tx')
|
||||||
assert(poolData.block === txBlockHash, 'invalid block')
|
assert(poolData.block === txBlock, 'invalid block')
|
||||||
assert(poolData.shares !== null, 'shares is null')
|
assert(poolData.shares, 'shares is null')
|
||||||
assert(poolData.transactions >= 1, 'transactions are zero')
|
assert(poolData.transactions, 'transactions are null')
|
||||||
assert(
|
assert(poolData.publishMarketFeeAddress, 'publishMarketFeeAddress is null')
|
||||||
poolData.publishMarketFeeAddress !== null,
|
|
||||||
'publishMarketFeeAddress is null'
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user