Skip to content

Commit a02ce4d

Browse files
authored
Merge pull request #76 from kodadot/main
🔖 Basick v13
2 parents 82d98b4 + 129ea99 commit a02ce4d

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/workflows/subsquid.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
sqd auth -k ${{ secrets.DEPLOYMENT_KEY }}
2424
- name: deploy subsquid
2525
id: deploy
26-
run: sqd deploy -o kodadot -u -m ${{ env.VERSION }}.yaml .
26+
run: sqd deploy -o kodadot --allow-update --no-interactive --no-stream-logs -m ${{ env.VERSION }}.yaml .

src/mappings/erc7572/setMetadata.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11

22
import { merge } from '@kodadot1/metasquid'
33
import { getOptional } from '@kodadot1/metasquid/entity'
4-
import { warn } from 'console'
54
import { CollectionEntity as CE } from '../../model'
65
import { createEvent } from '../shared/event'
76
import { handleMetadata } from '../shared/metadata'
87
import { contractOf, toBaseEvent } from '../utils/extract'
9-
import { pending, success } from '../utils/logger'
8+
import { pending, success, warn } from '../utils/logger'
109
import { CollectionStateUpdate, Context, eventFrom, Log } from '../utils/types'
11-
import { ContractMetadataUpdate, decode7572ContractUpdate } from './utils'
10+
import { ContractMetadataUpdate, safeDecode7572Update } from './utils'
1211

1312
const OPERATION = 'METADATA' as any
1413

@@ -36,11 +35,16 @@ export async function handleCollectionMetadataSet(context: Log, process: Context
3635
pending(OPERATION, `[COLLECTION/${OPERATION}]: ${context.block.height}`)
3736
const contract = contractOf(context)
3837
const base = toBaseEvent(context)
39-
const event = decode7572ContractUpdate(context)
38+
const event = safeDecode7572Update(context)
4039
const final = await getOptional(process.store, CE, contract)
4140

41+
if (!event) {
42+
warn(OPERATION, `[COLLECTION/${OPERATION}]: ${contract} wrong event`)
43+
return
44+
}
45+
4246
if (!final) {
43-
warn(`[COLLECTION/${OPERATION}]: ${contract} not found`)
47+
warn(OPERATION, `[COLLECTION/${OPERATION}]: ${contract} not found`)
4448
return
4549
}
4650

0 commit comments

Comments
 (0)