Skip to content

Commit 1873607

Browse files
committed
fix: indent space
1 parent 06b02d8 commit 1873607

File tree

3 files changed

+53
-54
lines changed

3 files changed

+53
-54
lines changed

child/src/mappings/child-erc1155.ts

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,67 +6,67 @@ import { TransactionEntity, GlobalTransferCounter } from '../../generated/schema
66
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
77

88
function getGlobalTransferCounter(): GlobalTransferCounter {
9-
// Only one entry will be kept in this entity
10-
let id = 'global-transfer-counter'
11-
let entity = GlobalTransferCounter.load(id)
12-
if (entity === null) {
13-
entity = new GlobalTransferCounter(id)
14-
entity.current = BigInt.fromI32(0)
15-
}
16-
return entity as GlobalTransferCounter
9+
// Only one entry will be kept in this entity
10+
let id = 'global-transfer-counter'
11+
let entity = GlobalTransferCounter.load(id)
12+
if (entity === null) {
13+
entity = new GlobalTransferCounter(id)
14+
entity.current = BigInt.fromI32(0)
15+
}
16+
return entity as GlobalTransferCounter
1717
}
1818

1919
export function handleSingleTransfer(event: TransferSingle): void {
2020

21-
// Try to get what's current global counter's state
22-
// when called for very first time, it'll be `0`
23-
let counter = getGlobalTransferCounter()
24-
let updated = counter.current.plus(BigInt.fromI32(1))
21+
// Try to get what's current global counter's state
22+
// when called for very first time, it'll be `0`
23+
let counter = getGlobalTransferCounter()
24+
let updated = counter.current.plus(BigInt.fromI32(1))
2525

26-
// Updating global counter's state
27-
counter.current = updated
28-
counter.save()
26+
// Updating global counter's state
27+
counter.current = updated
28+
counter.save()
2929

30-
const isWithdraw = event.params.to.toHex() === ZERO_ADDRESS || event.params.to === event.address ? true : false
30+
const isWithdraw = event.params.to.toHex() === ZERO_ADDRESS || event.params.to === event.address ? true : false
3131

32-
let transactionEntity = new TransactionEntity(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + (isWithdraw ? '-withdraw' : '-transfer'))
33-
transactionEntity.type = isWithdraw ? 'withdraw' : 'transfer'
34-
transactionEntity.from = event.params.from
35-
transactionEntity.to = event.params.to
36-
transactionEntity.amount = event.params.value
37-
transactionEntity.tokenId = event.params.id
38-
transactionEntity.block = event.block.number
39-
transactionEntity.timestamp = event.block.timestamp
40-
transactionEntity.transaction = event.transaction.hash
41-
transactionEntity.token = event.address
42-
transactionEntity.tokenType = 'ERC1155'
43-
transactionEntity.isPos = true
44-
transactionEntity.save()
32+
let transactionEntity = new TransactionEntity(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + (isWithdraw ? '-withdraw' : '-transfer'))
33+
transactionEntity.type = isWithdraw ? 'withdraw' : 'transfer'
34+
transactionEntity.from = event.params.from
35+
transactionEntity.to = event.params.to
36+
transactionEntity.amount = event.params.value
37+
transactionEntity.tokenId = event.params.id
38+
transactionEntity.block = event.block.number
39+
transactionEntity.timestamp = event.block.timestamp
40+
transactionEntity.transaction = event.transaction.hash
41+
transactionEntity.token = event.address
42+
transactionEntity.tokenType = 'ERC1155'
43+
transactionEntity.isPos = true
44+
transactionEntity.save()
4545
}
4646

4747
export function handleBatchTransfer(event: TransferBatch): void {
48-
// Try to get what's current global counter's state
49-
// when called for very first time, it'll be `0`
50-
let counter = getGlobalTransferCounter()
51-
let updated = counter.current.plus(BigInt.fromI32(1))
48+
// Try to get what's current global counter's state
49+
// when called for very first time, it'll be `0`
50+
let counter = getGlobalTransferCounter()
51+
let updated = counter.current.plus(BigInt.fromI32(1))
5252

53-
// Updating global counter's state
54-
counter.current = updated
55-
counter.save()
53+
// Updating global counter's state
54+
counter.current = updated
55+
counter.save()
5656

57-
const isWithdraw = event.params.to.toHex() === ZERO_ADDRESS || event.params.to === event.address ? true : false
57+
const isWithdraw = event.params.to.toHex() === ZERO_ADDRESS || event.params.to === event.address ? true : false
5858

59-
let transactionEntity = new TransactionEntity(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + (isWithdraw ? '-withdraw' : '-transfer'))
59+
let transactionEntity = new TransactionEntity(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + (isWithdraw ? '-withdraw' : '-transfer'))
6060

61-
transactionEntity.type = isWithdraw ? 'withdraw' : 'transfer'
62-
transactionEntity.from = event.params.from
63-
transactionEntity.to = event.params.to
64-
transactionEntity.amounts = event.params.values
65-
transactionEntity.tokenIds = event.params.ids
66-
transactionEntity.timestamp = event.block.timestamp
67-
transactionEntity.transaction = event.transaction.hash
68-
transactionEntity.token = event.address
69-
transactionEntity.tokenType = 'ERC1155'
70-
transactionEntity.isPos = true
71-
transactionEntity.save()
61+
transactionEntity.type = isWithdraw ? 'withdraw' : 'transfer'
62+
transactionEntity.from = event.params.from
63+
transactionEntity.to = event.params.to
64+
transactionEntity.amounts = event.params.values
65+
transactionEntity.tokenIds = event.params.ids
66+
transactionEntity.timestamp = event.block.timestamp
67+
transactionEntity.transaction = event.transaction.hash
68+
transactionEntity.token = event.address
69+
transactionEntity.tokenType = 'ERC1155'
70+
transactionEntity.isPos = true
71+
transactionEntity.save()
7272
}

child/src/mappings/child-erc20.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function handleLogTransfer(event: LogTransfer): void {
3535

3636
export function handleWithdraw(event: Withdraw): void {
3737

38-
// Try to get what's current globalcounter's state
38+
// Try to get what's current globalcounter's state
3939
// when called for very first time, it'll be `0`
4040
let counter = getGlobalTransferCounter()
4141
let updated = counter.current.plus(BigInt.fromI32(1))
@@ -60,7 +60,6 @@ export function handleWithdraw(event: Withdraw): void {
6060
}
6161

6262
export function handleTransfer(event: Transfer): void {
63-
6463
// Try to get what's current global counter's state
6564
// when called for very first time, it'll be `0`
6665
let counter = getGlobalTransferCounter()
@@ -71,7 +70,7 @@ export function handleTransfer(event: Transfer): void {
7170
counter.save()
7271

7372
const isWithdraw = event.params.to.toHex() === ZERO_ADDRESS || event.params.to === event.address ? true : false
74-
73+
7574
let transactionEntity = new TransactionEntity(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + (isWithdraw ? '-withdraw' : '-transfer'))
7675
transactionEntity.type = isWithdraw ? 'withdraw' : 'transfer'
7776
transactionEntity.from = event.params.from

child/src/mappings/child-erc721.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export function handleTransfer(event: Transfer): void {
4444

4545
const isWithdraw = event.params.to.toHex() === ZERO_ADDRESS || event.params.to === event.address ? true : false
4646

47-
let transactionEntity = new TransactionEntity(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + (isWithdraw ? '-withdraw' : '-transfer'))
48-
transactionEntity.type = isWithdraw ? 'withdraw' : 'transfer'
47+
let transactionEntity = new TransactionEntity(event.transaction.hash.toHex() + '-' + event.logIndex.toString() + (isWithdraw ? '-withdraw' : '-transfer'))
48+
transactionEntity.type = isWithdraw ? 'withdraw' : 'transfer'
4949
transactionEntity.from = event.params.from
5050
transactionEntity.to = event.params.to
5151
transactionEntity.tokenId = event.params.tokenId

0 commit comments

Comments
 (0)