added another condition.

This commit is contained in:
Maria Carmina 2023-04-11 14:06:56 +03:00
parent d7d74da57b
commit 632abdf74a
3 changed files with 8 additions and 7 deletions

View File

@ -261,7 +261,7 @@ export function handleProviderFee(event: ProviderFee): void {
event.params.validUntil event.params.validUntil
}"}` }"}`
log.info('event address in provider fee handler: {}', [ log.info('event address in provider fee handler: {}', [
event.address.toString() event.address.toHexString()
]) ])
const order = searchOrderForEvent( const order = searchOrderForEvent(

View File

@ -53,7 +53,12 @@ export function searchOrderForEvent(
} }
} }
// return an Order just for compilation schema // return an Order just for compilation schema
return getOrder(transactionHash, address, transactionFrom, eventIndex) let tempEventIndex = eventIndex - 1
log.info('return the default order: {}', [tempEventIndex.toString()])
if (tempEventIndex < 0) {
tempEventIndex = eventIndex
}
return getOrder(transactionHash, address, transactionFrom, tempEventIndex)
} }
export function searchOrderReusedForEvent( export function searchOrderReusedForEvent(

View File

@ -466,11 +466,7 @@ describe('Simple Publish & consume test', async () => {
// Check the new provider fee has been set in OrderReuse // Check the new provider fee has been set in OrderReuse
const reuseQuery = { const reuseQuery = {
query: `query {orderReuse(id:"${ query: `query {orderReuse(id:"${reusedOrder.transactionHash}-${reusedOrder.events.OrderReused.logIndex}"){id, providerFee, eventIndex}}`
reusedOrder.transactionHash
}-${reusedOrder.events.OrderReused.logIndex.toFixed(
1
)}"){id, providerFee, eventIndex}}`
} }
await sleep(2000) await sleep(2000)