Skip to content

Commit

Permalink
fix(sui): add missing field for ctx (#1093)
Browse files Browse the repository at this point in the history
  • Loading branch information
zfy0701 authored Dec 30, 2024
1 parent 5e6afe5 commit 6bb376e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/x2y2-database/src/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ ERC20Processor.bind({ address: '0x1e4ede388cbc9f4b5c79681b7f94d36a11abebc9' }).o
tokenCounter.add(ctx, val)
// exporter.emit(ctx, event)
const from = new User({
name: 'from',
id: event.args.from
})

await ctx.store.upsert(from)
const to = new User({
name: 'to',
id: event.args.to
})
await ctx.store.upsert(to)
const transfer = new Transfer({
arrayValue: [],
bigIntValue: 0n,
id: event.transactionHash,
amount: val
})
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/src/sui/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export class SuiAddressContext extends MoveAccountContext<
export class SuiObjectContext extends SuiAddressContext {
contractName = 'object'
objectId: string
objectVersion: bigint

constructor(
network: SuiNetwork,
Expand All @@ -190,5 +191,6 @@ export class SuiObjectContext extends SuiAddressContext {
) {
super(network, objectId, checkpoint, timestamp, baseLabels)
this.objectId = objectId
this.objectVersion = objectVersion
}
}

0 comments on commit 6bb376e

Please sign in to comment.