Added ethereumjs util.
This commit is contained in:
parent
c5fcb2d95c
commit
8826654764
|
@ -11,7 +11,8 @@
|
|||
"dependencies": {
|
||||
"@oceanprotocol/contracts": "^1.1.12",
|
||||
"@oceanprotocol/lib": "^2.7.0",
|
||||
"cross-fetch": "^3.1.4"
|
||||
"cross-fetch": "^3.1.4",
|
||||
"ethereumjs-util": "^7.1.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@graphprotocol/graph-cli": "^0.38.0",
|
||||
|
|
|
@ -74,7 +74,8 @@
|
|||
"dependencies": {
|
||||
"@oceanprotocol/contracts": "^1.1.12",
|
||||
"@oceanprotocol/lib": "^2.7.0",
|
||||
"cross-fetch": "^3.1.4"
|
||||
"cross-fetch": "^3.1.4",
|
||||
"ethereumjs-util": "^7.1.5"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -263,7 +263,7 @@ export function handleProviderFee(event: ProviderFee): void {
|
|||
|
||||
const order = searchOrderForEvent(
|
||||
event.transaction.hash.toHex(),
|
||||
event.address.toString(),
|
||||
event.address.toHex(),
|
||||
event.transaction.from.toHex(),
|
||||
event.logIndex.toI32()
|
||||
)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { Order, OrderReuse } from '../../@types/schema'
|
||||
import { log } from '@graphprotocol/graph-ts'
|
||||
import { toChecksumAddress } from 'ethereumjs-util'
|
||||
|
||||
export function getOrderId(
|
||||
tx: string,
|
||||
|
@ -52,7 +53,10 @@ export function searchOrderForEvent(
|
|||
)
|
||||
log.info('orderId as trial: {}', [orderId])
|
||||
const order = Order.load(orderId)
|
||||
if (order !== null && order.datatoken === address) {
|
||||
if (
|
||||
order !== null &&
|
||||
toChecksumAddress(order.datatoken) === toChecksumAddress(address)
|
||||
) {
|
||||
log.info('order datatoken: {}', [order.datatoken])
|
||||
log.info('event address: {}', [address])
|
||||
log.info('typeof order datatoken: {}', [typeof order.datatoken])
|
||||
|
|
Loading…
Reference in New Issue