Skip to content

Commit

Permalink
Merge pull request #106 from kodadot/main
Browse files Browse the repository at this point in the history
Saving the prod
  • Loading branch information
vikiival authored Sep 30, 2023
2 parents 4db52d7 + 916c171 commit 6888f0c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type NFTEntity @entity {
sn: String! @index
updatedAt: DateTime! @index
version: Int!
token: TokenEntity!
token: TokenEntity
}

type MetadataEntity @entity {
Expand Down
7 changes: 5 additions & 2 deletions speck.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
manifestVersion: subsquid.io/v0.1
name: speck
version: 3
version: 4
description: 'SubSquid indexer for Uniques and Assets on Statemint'
build:
deploy:
Expand Down Expand Up @@ -30,4 +30,7 @@ deploy:
- '1000'

scale:
dedicated: false
dedicated: true
addons:
postgres:
storage: 5G
5 changes: 4 additions & 1 deletion squid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ deploy:
- '1000'

scale:
dedicated: true
dedicated: true
addons:
postgres:
storage: 5G
6 changes: 6 additions & 0 deletions src/mappings/uniques/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { unwrap } from '../utils/extract'
import { debug, pending, success } from '../utils/logger'
import { Action, Context, createTokenId } from '../utils/types'
import { versionOf , calculateCollectionOwnerCountAndDistribution } from '../utils/helper'
import { handleTokenEntity } from '../shared/handleTokenEntity'
import { getCreateTokenEvent } from './getters'

const OPERATION = Action.MINT
Expand Down Expand Up @@ -62,6 +63,11 @@ export async function handleTokenCreate(context: Context): Promise<void> {
final.media = metadata?.animationUrl
}

const token = await handleTokenEntity(context, collection, final)
if (token) {
final.token = token
}

success(OPERATION, `${final.id}`)
await context.store.save(final)
await context.store.save(collection)
Expand Down
2 changes: 1 addition & 1 deletion src/model/generated/nftEntity.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ export class NFTEntity {

@Index_()
@ManyToOne_(() => TokenEntity, {nullable: true})
token!: TokenEntity
token!: TokenEntity | undefined | null
}

0 comments on commit 6888f0c

Please sign in to comment.