Skip to content

Commit f93497e

Browse files
committed
fix: remove check
1 parent 984ce33 commit f93497e

File tree

4 files changed

+11
-37
lines changed

4 files changed

+11
-37
lines changed

src/mappings/diamond.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ import {
131131
RealmDiamond,
132132
ResyncParcel,
133133
} from "../../generated/AavegotchiDiamond/RealmDiamond";
134-
import { shouldSkipTransfer } from "./helpers";
135134
import { updateOwnership } from "./helpers";
136135

137136
export function handleBuyPortals(event: BuyPortals): void {
@@ -1105,7 +1104,9 @@ export function handleMintParcel(event: MintParcel): void {
11051104
}
11061105

11071106
// WearablesConfig
1108-
export function handleWearablesConfigCreated(event: WearablesConfigCreated): void {
1107+
export function handleWearablesConfigCreated(
1108+
event: WearablesConfigCreated
1109+
): void {
11091110
createOrUpdateWearablesConfig(
11101111
event.params.owner,
11111112
event.params.tokenId,
@@ -1114,7 +1115,9 @@ export function handleWearablesConfigCreated(event: WearablesConfigCreated): voi
11141115
);
11151116
}
11161117

1117-
export function handleWearablesConfigUpdated(event: WearablesConfigUpdated): void {
1118+
export function handleWearablesConfigUpdated(
1119+
event: WearablesConfigUpdated
1120+
): void {
11181121
createOrUpdateWearablesConfig(
11191122
event.params.owner,
11201123
event.params.tokenId,
@@ -1983,10 +1986,6 @@ export function handleERC1155BuyOrderCancel(
19831986
}
19841987

19851988
export function handleTransferSingle(event: TransferSingle): void {
1986-
if (shouldSkipTransfer(event)) {
1987-
return;
1988-
}
1989-
19901989
const from = event.params._from;
19911990
const to = event.params._to;
19921991
const id = event.params._id.toString();
@@ -2003,8 +2002,6 @@ export function handleTransferSingle(event: TransferSingle): void {
20032002
}
20042003

20052004
export function handleTransferBatch(event: TransferBatch): void {
2006-
if (shouldSkipTransfer(event)) return;
2007-
20082005
const from = event.params._from;
20092006
const to = event.params._to;
20102007
const ids = event.params._ids;

src/mappings/helpers.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@ export const WEARABLE_TOKEN_ADDRESS = Address.fromString(
1111
"0x58de9AaBCaeEC0f69883C94318810ad79Cc6a44f"
1212
);
1313

14-
export function shouldSkipTransfer(event: ethereum.Event): boolean {
15-
if (!isWearableTransfer(event.address)) return true;
16-
17-
// if (
18-
// event.address == AAVEGOTCHI_ADDRESS &&
19-
// event.block.number.gt(MIGRATION_BLOCK)
20-
// ) {
21-
// return true;
22-
// }
23-
24-
return false;
25-
}
26-
2714
export function updateOwnership(
2815
itemTypeId: string,
2916
owner: Address,
@@ -49,11 +36,3 @@ export function updateOwnership(
4936
ownership.save();
5037
}
5138
}
52-
53-
export function isWearableTransfer(tokenAddress: Address): boolean {
54-
// Check if the token address in the event matches the wearable token address
55-
return (
56-
tokenAddress.equals(WEARABLE_TOKEN_ADDRESS) ||
57-
tokenAddress.equals(AAVEGOTCHI_ADDRESS)
58-
);
59-
}

src/mappings/itemTransfers.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
import { Address } from "@graphprotocol/graph-ts";
22

3-
import { shouldSkipTransfer, updateOwnership } from "./helpers";
3+
import { updateOwnership } from "./helpers";
44
import {
55
TransferBatch,
66
TransferSingle,
77
} from "../../generated/AavegotchiDiamond/AavegotchiDiamond";
88

99
export function handleTransferSingle(event: TransferSingle): void {
10-
if (shouldSkipTransfer(event)) {
11-
return;
12-
}
13-
1410
const from = event.params._from;
1511
const to = event.params._to;
1612
const id = event.params._id.toString();
@@ -27,8 +23,6 @@ export function handleTransferSingle(event: TransferSingle): void {
2723
}
2824

2925
export function handleTransferBatch(event: TransferBatch): void {
30-
if (shouldSkipTransfer(event)) return;
31-
3226
const from = event.params._from;
3327
const to = event.params._to;
3428
const ids = event.params._ids;

subgraph.template.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,12 @@ dataSources:
171171
handler: handleERC1155BuyOrderCancel
172172
- event: TransferSingle(indexed address,indexed address,indexed address,uint256,uint256)
173173
handler: handleTransferSingle
174+
filter:
175+
blockRange: { from: 11500000, to: 35999792 }
174176
- event: TransferBatch(indexed address,indexed address,indexed address,uint256[],uint256[])
175177
handler: handleTransferBatch
178+
filter:
179+
blockRange: { from: 11500000, to: 35999792 }
176180
- event: WearablesConfigCreated(indexed address,indexed uint256,indexed uint16,uint16[16],uint256)
177181
handler: handleWearablesConfigCreated
178182
- event: WearablesConfigUpdated(indexed address,indexed uint256,indexed uint16,uint16[16])

0 commit comments

Comments
 (0)