Skip to content

Commit

Permalink
machine: fix executeError -> executionError
Browse files Browse the repository at this point in the history
  • Loading branch information
VandeurenGlenn committed Mar 31, 2024
1 parent c48aa94 commit d09dbfe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/chain/src/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class Machine {
break
}

case 'executionError': {
case 'executeError': {
// console.warn(`error executing transaction ${data.message}`);
pubsub.publish(data.id, { error: data.message })
break
Expand Down Expand Up @@ -172,6 +172,7 @@ export default class Machine {
const id = randombytes(20).toString('hex')
const onmessage = (message) => {
pubsub.unsubscribe(id, onmessage)

if (message?.error) reject(message.error)
else resolve(message)
}
Expand Down Expand Up @@ -217,8 +218,10 @@ export default class Machine {
return new Promise((resolve, reject) => {
// @ts-ignore
const id = randombytes(20).toString('hex')

const onmessage = (message) => {
pubsub.unsubscribe(id, onmessage)

if (message?.error) reject(new ExecutionError(message.error))
else resolve(message)
}
Expand Down

0 comments on commit d09dbfe

Please sign in to comment.