Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
justraman committed Oct 12, 2023
1 parent a68b59b commit 1fa0fec
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions src/mappings/fuelTanks/events/fuelTankDestroyed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,18 @@ export async function fuelTankDestroyed(

const tankId = u8aToHex(eventData.tankId)

await ctx.store.delete(PermittedExtrinsics, { ruleSet: { tank: { id: tankId } } })
const pE = await ctx.store.find(PermittedExtrinsics, {
relations: { ruleSet: true },
where: { ruleSet: { tank: { id: tankId } } },
})

await ctx.store.remove(pE)
await Promise.all([
ctx.store.delete(FuelTankRuleSet, { tank: { id: tankId } }),
ctx.store.delete(FuelTankAccountRules, { tank: { id: tankId } }),
])

ctx.store.delete(FuelTank, { tank: { id: tankId } })
ctx.store.delete(FuelTank, { id: tankId })

return new EventModel({
id: item.event.id,
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/multiTokens/events/attribute_set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export async function attributeSet(
updatedAt: new Date(block.timestamp),
})

ctx.store.insert(Attribute, attribute as any)
await ctx.store.insert(Attribute, attribute as any)

if (token) {
if (!token.metadata) {
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/multiTokens/events/minted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export async function minted(

const { account } = tokenAccount
account.tokenValues += data.amount * (token.unitPrice ?? 10_000_000_000_000n)
ctx.store.save(account)
await ctx.store.save(account)

syncCollectionStats(data.collectionId.toString())

Expand Down
2 changes: 1 addition & 1 deletion src/mappings/multiTokens/events/token_created.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ export async function tokenCreated(
createdAt: new Date(block.timestamp),
})

ctx.store.insert(Token, token as any)
await ctx.store.insert(Token, token as any)

return getEvent(item, eventData)
}
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/multiTokens/events/token_destroyed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export async function tokenDestroyed(
])
}

ctx.store.remove(token)
await ctx.store.remove(token)
syncCollectionStats(data.collectionId.toString())
computeTraits(data.collectionId.toString())

Expand Down
2 changes: 1 addition & 1 deletion src/mappings/multiTokens/events/token_mutated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export async function tokenMutated(
}

token.nonFungible = isNonFungible(token)
ctx.store.save(token)
await ctx.store.save(token)

return getEvent(item, data)
}

0 comments on commit 1fa0fec

Please sign in to comment.