Skip to content

Commit

Permalink
fix adventurer model
Browse files Browse the repository at this point in the history
  • Loading branch information
starknetdev committed Oct 9, 2023
1 parent e9503e0 commit fa20b04
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions indexer/src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,15 @@ export function updateAdventurer({
timestamp: string;
}) {
const { adventurer } = adventurerState;
const entity = {
id: checkExistsInt(BigInt(adventurerState.adventurerId)),
owner: checkExistsInt(BigInt(adventurerState.owner)),
};
return {
entity: {
id: checkExistsInt(BigInt(adventurerState.adventurerId)),
},
entity,
update: {
$set: {
id: checkExistsInt(BigInt(adventurerState.adventurerId)),
owner: checkExistsInt(BigInt(adventurerState.owner)),
...entity,
lastAction: encodeIntAsBytes(BigInt(adventurer.lastActionBlock)),
health: encodeIntAsBytes(BigInt(adventurer.health)),
xp: encodeIntAsBytes(BigInt(adventurer.xp)),
Expand Down

0 comments on commit fa20b04

Please sign in to comment.