Skip to content

Commit

Permalink
fix indexer files
Browse files Browse the repository at this point in the history
  • Loading branch information
starknetdev committed Jun 22, 2024
1 parent 8bee025 commit 4e8c3af
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
14 changes: 1 addition & 13 deletions indexer/src/adventurers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
parseDiscoveredHealth,
parseStartGame,
START_GAME,
PURCHASED_POTIONS,
PURCHASED_ITEMS,
ATTACKED_BY_BEAST,
ADVENTURER_DIED,
Expand Down Expand Up @@ -59,11 +58,10 @@ const filter = {
{ fromAddress: GAME, keys: [ADVENTURER_UPGRADED] },
{ fromAddress: GAME, keys: [DISCOVERED_HEALTH] },
{ fromAddress: GAME, keys: [DISCOVERED_GOLD] },
{ fromAddress: GAME, keys: [DISCOVERED_XP] },
{ fromAddress: GAME, keys: [DISCOVERED_LOOT] },
{ fromAddress: GAME, keys: [DODGED_OBSTACLE] },
{ fromAddress: GAME, keys: [HIT_BY_OBSTACLE] },
{ fromAddress: GAME, keys: [DISCOVERED_BEAST] },
{ fromAddress: GAME, keys: [PURCHASED_POTIONS] },
{ fromAddress: GAME, keys: [PURCHASED_ITEMS] },
{ fromAddress: GAME, keys: [EQUIPPED_ITEMS] },
{ fromAddress: GAME, keys: [DROPPED_ITEMS] },
Expand Down Expand Up @@ -207,16 +205,6 @@ export default function transform({ header, events }: Block) {
}),
];
}
case PURCHASED_POTIONS: {
console.log("PURCHASED_POTIONS", "->", "ADVENTURER UPDATES");
const { value } = parseDiscoveredXp(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
adventurerState: value.adventurerState,
}),
];
}
case PURCHASED_ITEMS: {
console.log("PURCHASED_ITEMS", "->", "ADVENTURER UPDATES");
const { value } = parsePurchasedItems(event.data, 0);
Expand Down
4 changes: 1 addition & 3 deletions indexer/src/discoveries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ import {
DISCOVERED_GOLD,
DISCOVERED_HEALTH,
DISCOVERED_LOOT,
DISCOVERED_XP,
DODGED_OBSTACLE,
HIT_BY_OBSTACLE,
parseAmbushedByBeast,
parseDiscoveredBeast,
parseDiscoveredGold,
parseDiscoveredHealth,
parseDiscoveredLoot,
parseDiscoveredXp,
parseHitByObstacle,
} from "./utils/events.ts";
import { insertDiscovery } from "./utils/helpers.ts";
Expand All @@ -32,7 +30,7 @@ const filter = {
events: [
{ fromAddress: GAME, keys: [DISCOVERED_HEALTH] },
{ fromAddress: GAME, keys: [DISCOVERED_GOLD] },
{ fromAddress: GAME, keys: [DISCOVERED_XP] },
{ fromAddress: GAME, keys: [DISCOVERED_LOOT] },
{ fromAddress: GAME, keys: [HIT_BY_OBSTACLE] },
{ fromAddress: GAME, keys: [DODGED_OBSTACLE] },
{ fromAddress: GAME, keys: [AMBUSHED_BY_BEAST] },
Expand Down
2 changes: 2 additions & 0 deletions indexer/src/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const filter = {
events: [
{ fromAddress: GAME, keys: [START_GAME] },
{ fromAddress: GAME, keys: [PURCHASED_ITEMS] },
{ fromAddress: GAME, keys: [DISCOVERED_LOOT] },
{ fromAddress: GAME, keys: [EQUIPMENT_CHANGED] },
{ fromAddress: GAME, keys: [EQUIPPED_ITEMS] },
{ fromAddress: GAME, keys: [DROPPED_ITEMS] },
{ fromAddress: GAME, keys: [HIT_BY_OBSTACLE] },
Expand Down
1 change: 0 additions & 1 deletion indexer/src/utils/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const ADVENTURER_DIED = eventKey("AdventurerDied");
export const FLEE_FAILED = eventKey("FleeFailed");
export const FLEE_SUCCEEDED = eventKey("FleeSucceeded");

export const PURCHASED_POTIONS = eventKey("PurchasedPotions");
export const PURCHASED_ITEMS = eventKey("PurchasedItems");
export const UPGRADES_AVAILABLE = eventKey("UpgradesAvailable");
export const EQUIPPED_ITEMS = eventKey("EquippedItems");
Expand Down

0 comments on commit 4e8c3af

Please sign in to comment.