diff --git a/jest.config.js b/jest.config.js index c04ae8fc..f15c89dc 100644 --- a/jest.config.js +++ b/jest.config.js @@ -16,5 +16,5 @@ module.exports = { '^.+\\.(ts|js)$': 'ts-jest' }, - silent: false + silent: true }; diff --git a/package.json b/package.json index fd0d33f0..584c0bc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "warp-contracts", - "version": "1.4.19", + "version": "1.4.20-beta.0", "description": "An implementation of the SmartWeave smart contract protocol.", "types": "./lib/types/index.d.ts", "main": "./lib/cjs/index.js", diff --git a/src/__tests__/integration/basic/pst.test.ts b/src/__tests__/integration/basic/pst.test.ts index c85a5332..ab993ace 100644 --- a/src/__tests__/integration/basic/pst.test.ts +++ b/src/__tests__/integration/basic/pst.test.ts @@ -7,12 +7,12 @@ import path from 'path'; import { mineBlock } from '../_helpers'; import { PstState, PstContract } from '../../../contract/PstContract'; import { InteractionResult } from '../../../core/modules/impl/HandlerExecutorFactory'; -import { Warp } from "../../../core/Warp"; +import { Warp } from '../../../core/Warp'; import { WarpFactory } from '../../../core/WarpFactory'; import { LoggerFactory } from '../../../logging/LoggerFactory'; import { DeployPlugin } from 'warp-contracts-plugin-deploy'; import { VM2Plugin } from 'warp-contracts-plugin-vm2'; -import { InteractionCompleteEvent } from "../../../core/modules/StateEvaluator"; +import { InteractionCompleteEvent } from '../../../core/modules/StateEvaluator'; describe('Testing the Profit Sharing Token', () => { let contractSrc: string; @@ -118,14 +118,13 @@ describe('Testing the Profit Sharing Token', () => { }); it('should properly dispatch en event', async () => { - let handlerCalled = false; const interactionResult = await pst.writeInteraction({ - function: 'dispatchEvent', + function: 'dispatchEvent' }); await mineBlock(warp); - warp.eventTarget.addEventListener("interactionCompleted", interactionCompleteHandler); + warp.eventTarget.addEventListener('interactionCompleted', interactionCompleteHandler); await pst.readState(); expect(handlerCalled).toBeTruthy(); @@ -136,16 +135,14 @@ describe('Testing the Profit Sharing Token', () => { expect(event.detail.caller).toEqual(walletAddress); expect(event.detail.transactionId).toEqual(interactionResult.originalTxId); expect(event.detail.data).toEqual({ - value1: "foo", - value2: "bar" - } - ); + value1: 'foo', + value2: 'bar' + }); expect(event.detail.input).toEqual({ - function: 'dispatchEvent' - } - ); + function: 'dispatchEvent' + }); handlerCalled = true; - warp.eventTarget.removeEventListener("interactionCompleted", interactionCompleteHandler); + warp.eventTarget.removeEventListener('interactionCompleted', interactionCompleteHandler); } }); diff --git a/src/core/modules/impl/DefaultStateEvaluator.ts b/src/core/modules/impl/DefaultStateEvaluator.ts index ea7f0d0d..5217eb33 100644 --- a/src/core/modules/impl/DefaultStateEvaluator.ts +++ b/src/core/modules/impl/DefaultStateEvaluator.ts @@ -366,7 +366,7 @@ export abstract class DefaultStateEvaluator implements StateEvaluator { } } - private parseInput(inputTag: GQLTagInterface): unknown | null { + private parseInput(inputTag: GQLTagInterface): { function: string } | null { try { return JSON.parse(inputTag.value); } catch (e) {