Skip to content

Conversation

@corrideat
Copy link
Member

@corrideat corrideat commented Jan 4, 2026

Comment on lines +950 to +951
const manifestHash = this.config.contracts.manifests[contractName]
if (manifestHash) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hook will only run on the latest version of the contract, is that intentional?

throw new Error('Inside OP_ATOMIC: no matching signing key was defined')
}
await (opFns[u[0]] as (x: unknown) => Promise<void>)(u[1])
sbp('chelonia/private/operationHook', contractID, contractName, message, state, i)
Copy link
Member Author

@corrideat corrideat Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something that should also be done for config.preOp and config.postOp? I mean, should this be something like this? (ignore the broken processOp part, which would need to be adjusted)

   if (config[`preOp_${opT}`]) {
      processOp = config[`preOp_${opT}`]!(message, state, i) !== false && processOp
    }
    if (processOp) {
      await (opFns[u[0]] as (x: unknown) => Promise<void>)(u[1])
      sbp('chelonia/private/operationHook', contractID, contractName, message, state, i)
      config.postOp?.(message, state, i)
      config[`postOp_${opT}`]?.(message, state, i) // hack to fix syntax highlighting `
    }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean to ask whether we should also call postOp/preOp here inside of the OP_ATOMIC, no, I think that's excessive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants