Skip to content

Commit 06b02d8

Browse files
committed
fix: code cleanup
1 parent 8754dc1 commit 06b02d8

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

child/src/mappings/child-erc1155.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { BigInt } from '@graphprotocol/graph-ts'
22
import { TransferBatch, TransferSingle } from '../../generated/ChildERC1155/ChildERC1155'
33
import { TransactionEntity, GlobalTransferCounter } from '../../generated/schema'
44
//import { BigDecimal, BigInt } from '@graphprotocol/graph-ts'
5-
import { toDecimal } from '../helpers/numbers'
65

76
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
87

@@ -19,7 +18,7 @@ function getGlobalTransferCounter(): GlobalTransferCounter {
1918

2019
export function handleSingleTransfer(event: TransferSingle): void {
2120

22-
// Try to get what's current global plasma counter's state
21+
// Try to get what's current global counter's state
2322
// when called for very first time, it'll be `0`
2423
let counter = getGlobalTransferCounter()
2524
let updated = counter.current.plus(BigInt.fromI32(1))
@@ -40,13 +39,13 @@ export function handleSingleTransfer(event: TransferSingle): void {
4039
transactionEntity.timestamp = event.block.timestamp
4140
transactionEntity.transaction = event.transaction.hash
4241
transactionEntity.token = event.address
43-
transactionEntity.tokenType = "ERC1155"
42+
transactionEntity.tokenType = 'ERC1155'
4443
transactionEntity.isPos = true
4544
transactionEntity.save()
4645
}
4746

4847
export function handleBatchTransfer(event: TransferBatch): void {
49-
// Try to get what's current global plasma counter's state
48+
// Try to get what's current global counter's state
5049
// when called for very first time, it'll be `0`
5150
let counter = getGlobalTransferCounter()
5251
let updated = counter.current.plus(BigInt.fromI32(1))
@@ -67,7 +66,7 @@ export function handleBatchTransfer(event: TransferBatch): void {
6766
transactionEntity.timestamp = event.block.timestamp
6867
transactionEntity.transaction = event.transaction.hash
6968
transactionEntity.token = event.address
70-
transactionEntity.tokenType = "ERC1155"
69+
transactionEntity.tokenType = 'ERC1155'
7170
transactionEntity.isPos = true
7271
transactionEntity.save()
7372
}

child/src/mappings/child-erc20.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { BigInt, Address } from '@graphprotocol/graph-ts'
22
import { LogTransfer, Withdraw, Transfer } from '../../generated/ChildERC20/ChildERC20'
33
import { TransactionEntity, GlobalTransferCounter } from '../../generated/schema'
4-
import { toDecimal } from '../helpers/numbers'
54

65
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
76

@@ -36,7 +35,7 @@ export function handleLogTransfer(event: LogTransfer): void {
3635

3736
export function handleWithdraw(event: Withdraw): void {
3837

39-
// Try to get what's current global plasma counter's state
38+
// Try to get what's current globalcounter's state
4039
// when called for very first time, it'll be `0`
4140
let counter = getGlobalTransferCounter()
4241
let updated = counter.current.plus(BigInt.fromI32(1))
@@ -55,14 +54,14 @@ export function handleWithdraw(event: Withdraw): void {
5554
transactionEntity.transaction = event.transaction.hash
5655
transactionEntity.token = event.address
5756
transactionEntity.type = 'withdraw'
58-
transactionEntity.tokenType = "ERC20"
57+
transactionEntity.tokenType = 'ERC20'
5958
transactionEntity.isPos = false
6059
transactionEntity.save()
6160
}
6261

6362
export function handleTransfer(event: Transfer): void {
6463

65-
// Try to get what's current global transfer counter's state
64+
// Try to get what's current global counter's state
6665
// when called for very first time, it'll be `0`
6766
let counter = getGlobalTransferCounter()
6867
let updated = counter.current.plus(BigInt.fromI32(1))
@@ -82,7 +81,7 @@ export function handleTransfer(event: Transfer): void {
8281
transactionEntity.timestamp = event.block.timestamp
8382
transactionEntity.transaction = event.transaction.hash
8483
transactionEntity.token = event.address
85-
transactionEntity.tokenType = "ERC20"
84+
transactionEntity.tokenType = 'ERC20'
8685
transactionEntity.isPos = true
8786
transactionEntity.save()
8887
}

child/src/mappings/child-erc721.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { BigInt } from '@graphprotocol/graph-ts'
22
import { Transfer } from '../../generated/ChildERC721/ChildERC721'
33
import { TransactionEntity, GlobalTransferCounter } from '../../generated/schema'
44
//import { BigDecimal, BigInt } from '@graphprotocol/graph-ts'
5-
import { toDecimal } from '../helpers/numbers'
65

76
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
87

@@ -34,7 +33,7 @@ function getGlobalTransferCounter(): GlobalTransferCounter {
3433

3534
export function handleTransfer(event: Transfer): void {
3635

37-
// Try to get what's current global plasma counter's state
36+
// Try to get what's current global counter's state
3837
// when called for very first time, it'll be `0`
3938
let counter = getGlobalTransferCounter()
4039
let updated = counter.current.plus(BigInt.fromI32(1))
@@ -54,7 +53,7 @@ export function handleTransfer(event: Transfer): void {
5453
transactionEntity.timestamp = event.block.timestamp
5554
transactionEntity.transaction = event.transaction.hash
5655
transactionEntity.token = event.address
57-
transactionEntity.tokenType = "ERC721"
56+
transactionEntity.tokenType = 'ERC721'
5857
transactionEntity.isPos = true
5958
transactionEntity.save()
6059
}

0 commit comments

Comments
 (0)