Skip to content

Commit

Permalink
empty args
Browse files Browse the repository at this point in the history
  • Loading branch information
trizin authored Jul 22, 2024
1 parent 3788264 commit 55480cf
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/mappings/erc20Templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
const ADDRESS_ZERO = "0x0000000000000000000000000000000000000000"

Check failure on line 30 in src/mappings/erc20Templates.ts

View workflow job for this annotation

GitHub Actions / test

Replace `"0x0000000000000000000000000000000000000000"` with `'0x0000000000000000000000000000000000000000'`

export function handleOrderStarted(event: OrderStarted): void {
log.info("handleOrderStarted")
log.info("handleOrderStarted", [])

Check failure on line 33 in src/mappings/erc20Templates.ts

View workflow job for this annotation

GitHub Actions / test

Replace `"handleOrderStarted"` with `'handleOrderStarted'`
const order = new Order(
getOrderId(
event.transaction.hash.toHex(),
Expand All @@ -39,59 +39,59 @@ export function handleOrderStarted(event: OrderStarted): void {
event.logIndex.toI32()
)
)
log.info("Created order object")
log.info("Created order object", [])

Check failure on line 42 in src/mappings/erc20Templates.ts

View workflow job for this annotation

GitHub Actions / test

Replace `"Created·order·object"` with `'Created·order·object'`
const token = getToken(event.address, true)
log.info("Got the token")
log.info("Got the token", [])

Check failure on line 44 in src/mappings/erc20Templates.ts

View workflow job for this annotation

GitHub Actions / test

Replace `"Got·the·token"` with `'Got·the·token'`
order.datatoken = token.id
token.orderCount = token.orderCount.plus(integer.ONE)
log.info("set data token and order count")
log.info("set data token and order count", [])

Check failure on line 47 in src/mappings/erc20Templates.ts

View workflow job for this annotation

GitHub Actions / test

Replace `"set·data·token·and·order·count"` with `'set·data·token·and·order·count'`

const consumer = getUser(event.params.consumer.toHex())
order.consumer = consumer.id
log.info("got consumer id")
log.info("got consumer id", [])

Check failure on line 51 in src/mappings/erc20Templates.ts

View workflow job for this annotation

GitHub Actions / test

Replace `"got·consumer·id"` with `'got·consumer·id'`

if (token.nft) {
const nft = Nft.load(token.nft as string) as Nft
if (nft) {
log.info("nft loaded and set")
log.info("nft loaded and set", [])

Check failure on line 56 in src/mappings/erc20Templates.ts

View workflow job for this annotation

GitHub Actions / test

Replace `"nft·loaded·and·set"` with `'nft·loaded·and·set'`
const nftOwner = getUser(nft.owner)
order.nftOwner = nftOwner.id
} else {
log.info("nft couldnt load")
log.info("nft couldnt load", [])

Check failure on line 60 in src/mappings/erc20Templates.ts

View workflow job for this annotation

GitHub Actions / test

Replace `"nft·couldnt·load"` with `'nft·couldnt·load'`
order.nftOwner = ADDRESS_ZERO
}
} else {
log.info("nft not found")
log.info("nft not found", [])

Check failure on line 64 in src/mappings/erc20Templates.ts

View workflow job for this annotation

GitHub Actions / test

Replace `"nft·not·found"` with `'nft·not·found'`
}

const payer = getUser(event.params.payer.toHex())
payer.totalOrders = payer.totalOrders.plus(integer.ONE)
payer.save()
log.info("payer saved")
log.info("payer saved", [])

Check failure on line 70 in src/mappings/erc20Templates.ts

View workflow job for this annotation

GitHub Actions / test

Replace `"payer·saved"` with `'payer·saved'`
order.payer = payer.id

order.amount = weiToDecimal(
event.params.amount.toBigDecimal(),
token.decimals
)
log.info("set order amount")
log.info("set order amount", [])

order.serviceIndex = event.params.serviceIndex.toI32()
log.info("set order service index")
log.info("set order service index", [])

const publishMarket = getUser(event.params.publishMarketAddress.toHex())
order.publishingMarket = publishMarket.id
log.info("set order publish market")
log.info("set order publish market", [])

order.createdTimestamp = event.block.timestamp.toI32()
order.tx = event.transaction.hash.toHex()
order.eventIndex = event.logIndex.toI32()
order.block = event.block.number.toI32()
log.info("set created ts tx eventindex and block")
log.info("set created ts tx eventindex and block", [])
const tokenId = token.lastPriceToken
log.info("got token id")
log.info("got token id", [])
if (tokenId) {
log.info("token id setting")
log.info("token id setting", [])
const priceToken = getToken(Address.fromString(tokenId), false)
order.lastPriceToken = priceToken.id
order.lastPriceValue = token.lastPriceValue
Expand All @@ -100,28 +100,28 @@ export function handleOrderStarted(event: OrderStarted): void {
order.lastPriceValue,
order.createdTimestamp
)
log.info("token id is set")
log.info("token id is set", [])
}

if (event.receipt !== null && event.receipt!.gasUsed) {
order.gasUsed = event.receipt!.gasUsed.toBigDecimal()
log.info("LOG1")
log.info("LOG1", [])
} else {
order.gasUsed = BigDecimal.zero()
log.info("LOG2")
log.info("LOG2", [])
}
if (event.transaction.gasPrice) {
order.gasPrice = event.transaction.gasPrice
log.info("LOG3")
log.info("LOG3", [])
} else {
order.gasPrice = BigInt.zero()
log.info("LOG4")
log.info("LOG4", [])
}
log.info("order save start")
log.info("order save start", [])
order.save()
token.save()
addOrder()
log.info("order save done")
log.info("order save done", [])
if (token.nft) {
const nft = Nft.load(token.nft as string) as Nft
if (nft) {
Expand All @@ -131,7 +131,7 @@ export function handleOrderStarted(event: OrderStarted): void {
const owner = getUser(nft.owner)
owner.totalSales = owner.totalSales.plus(integer.ONE)
owner.save()
log.info("owner data updated")
log.info("owner data updated", [])
}
}

Expand Down Expand Up @@ -340,7 +340,7 @@ export function handleProviderFee(event: ProviderFee): void {
event.logIndex.toI32()
)
if (orderReuse) {
log.info('order reuse id in provider fee handler: {}', [orderReuse.id])
log.info('order reuse id in provider fee handler: {}', [orderReuse.id], [])
orderReuse.providerFee = providerFee
orderReuse.providerFeeValidUntil = event.params.validUntil
orderReuse.save()
Expand Down

0 comments on commit 55480cf

Please sign in to comment.