From b94c7ce961285fc558fd3d4b9900f9c87bec174c Mon Sep 17 00:00:00 2001 From: Asia Date: Tue, 8 Aug 2023 15:47:30 +0200 Subject: [PATCH] v1.4.15-beta.27 --- package.json | 4 ++-- src/contract/HandlerBasedContract.ts | 11 +++-------- yarn.lock | 12 ++++++------ 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 58bd20b5..090b980f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "warp-contracts", - "version": "1.4.15-rc.4", + "version": "1.4.15-beta.27", "description": "An implementation of the SmartWeave smart contract protocol.", "types": "./lib/types/index.d.ts", "main": "./lib/cjs/index.js", @@ -123,7 +123,7 @@ "warp-contracts-plugin-deploy": "1.0.8", "warp-contracts-plugin-vm2": "1.0.1", "warp-contracts-plugin-vrf": "^1.0.3", - "warp-contracts-sqlite": "^1.0.2", + "warp-contracts-sqlite": "1.0.3-beta.9", "ws": "^8.11.0" }, "resolutions": { diff --git a/src/contract/HandlerBasedContract.ts b/src/contract/HandlerBasedContract.ts index 0f9de409..1be5b680 100644 --- a/src/contract/HandlerBasedContract.ts +++ b/src/contract/HandlerBasedContract.ts @@ -636,14 +636,9 @@ export class HandlerBasedContract implements Contract { } private async fetchRemoteContractState(contractId: string): Promise | null> { - return this._warpFetchWrapper - .fetch(`${this._evaluationOptions.remoteStateSyncSource}?id=${contractId}&events=false`) - .then((res) => { - return res.ok ? res.json() : Promise.reject(res); - }) - .catch((error) => { - throw new Error(`Unable to read contract state from DRE. ${error.status}. ${error.body?.message}`); - }); + return getJsonResponse( + this._warpFetchWrapper.fetch(`${this._evaluationOptions.remoteStateSyncSource}?id=${contractId}&events=false`) + ); } private getToSortKey(upToSortKey?: string) { diff --git a/yarn.lock b/yarn.lock index b2046b9b..2fce92ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2553,7 +2553,7 @@ bech32@1.1.4: resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== -better-sqlite3@^8.3.0, better-sqlite3@^8.5.0: +better-sqlite3@^8.5.0: version "8.5.0" resolved "https://registry.yarnpkg.com/better-sqlite3/-/better-sqlite3-8.5.0.tgz#b13d12d0e477be69191a39628fc8b723ee1c79d4" integrity sha512-vbPcv/Hx5WYdyNg/NbcfyaBZyv9s/NVbxb7yCeC5Bq1pVocNxeL2tZmSu3Rlm4IEOTjYdGyzWQgyx0OSdORBzw== @@ -7658,12 +7658,12 @@ warp-contracts-plugin-vrf@^1.0.3: "@idena/vrf-js" "^1.0.1" elliptic "^6.5.4" -warp-contracts-sqlite@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/warp-contracts-sqlite/-/warp-contracts-sqlite-1.0.2.tgz#f690f3ad5832b8522baed2420437d1aa5214bab1" - integrity sha512-mBDTfexgBTEeUhddC3P438y03T4mEfDadzC32cyYOE8jQE1wfYF3GTFhTkz0eT+Z5o+DAT+4Ed+2Mxk5BSQMmw== +warp-contracts-sqlite@1.0.3-beta.9: + version "1.0.3-beta.9" + resolved "https://registry.yarnpkg.com/warp-contracts-sqlite/-/warp-contracts-sqlite-1.0.3-beta.9.tgz#e4d4f052364721a7c7bde2007bb250761060c48e" + integrity sha512-anJ+jjUWWmlDKTq0xNimh+qsbCJmJOb5+c+CffqG2qETvLXDOC5FPxFQBlccsJ46eJnhOXlgvpOADEl5hxrJ9Q== dependencies: - better-sqlite3 "^8.3.0" + better-sqlite3 "^8.5.0" safe-stable-stringify "^2.4.3" warp-contracts@1.4.15-rc.4: