From 71a23aaa51137d8a42faab2efeeda17ebecb8a29 Mon Sep 17 00:00:00 2001 From: robal Date: Wed, 22 Mar 2023 15:04:22 +0100 Subject: [PATCH] chore: warp-contracts 1.3.1 --- .../atomic-asset-test/tests/atomic-asset.spec.ts | 12 ++++++------ contracts/erc20/tests/erc20.spec.ts | 8 ++++---- contracts/pst/tests/contract.spec.ts | 9 +++++---- examples/staking/tests/staking.spec.ts | 14 +++++++------- package.json | 4 ++-- yarn.lock | 16 ++++++++-------- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/contracts/atomic-asset-test/tests/atomic-asset.spec.ts b/contracts/atomic-asset-test/tests/atomic-asset.spec.ts index addc39e..b5ac6f7 100644 --- a/contracts/atomic-asset-test/tests/atomic-asset.spec.ts +++ b/contracts/atomic-asset-test/tests/atomic-asset.spec.ts @@ -1,7 +1,7 @@ import ArLocal from 'arlocal'; import { JWKInterface } from 'arweave/node/lib/wallet'; import { getTag } from 'warp-contract-utils'; -import { LoggerFactory, Warp, WarpFactory, SmartWeaveTags } from 'warp-contracts'; +import { LoggerFactory, Warp, WarpFactory, SMART_WEAVE_TAGS, WARP_TAGS } from 'warp-contracts'; import { AtomicAssetState, AtomicAssetContract } from "atomic-asset-js-bindings"; import { connectAtomicAsset, deployAtomicAsset as rustDeploy } from '../rust-impl'; import { deployAtomicAsset as tsDeploy } from '../ts-impl'; @@ -82,13 +82,13 @@ describe('Atomic Assets', () => { expect(contractTx).not.toBeNull(); - const contractSrcTx = await warp.arweave.transactions.get(getTag(contractTx, SmartWeaveTags.CONTRACT_SRC_TX_ID)); + const contractSrcTx = await warp.arweave.transactions.get(getTag(contractTx, SMART_WEAVE_TAGS. CONTRACT_SRC_TX_ID)); if (implementation === "Rust") { - expect(getTag(contractSrcTx, SmartWeaveTags.CONTENT_TYPE)).toEqual('application/wasm'); - expect(getTag(contractSrcTx, SmartWeaveTags.WASM_LANG)).toEqual('rust'); + expect(getTag(contractSrcTx, SMART_WEAVE_TAGS. CONTENT_TYPE)).toEqual('application/wasm'); + expect(getTag(contractSrcTx, WARP_TAGS. WASM_LANG)).toEqual('rust'); } else if (implementation === "Typescript") { - expect(getTag(contractSrcTx, SmartWeaveTags.CONTENT_TYPE)).toEqual('application/javascript'); - expect(getTag(contractSrcTx, SmartWeaveTags.WASM_LANG)).toEqual(false); + expect(getTag(contractSrcTx, SMART_WEAVE_TAGS. CONTENT_TYPE)).toEqual('application/javascript'); + expect(getTag(contractSrcTx, WARP_TAGS. WASM_LANG)).toEqual(false); } }); diff --git a/contracts/erc20/tests/erc20.spec.ts b/contracts/erc20/tests/erc20.spec.ts index 4ccf066..ae77f36 100644 --- a/contracts/erc20/tests/erc20.spec.ts +++ b/contracts/erc20/tests/erc20.spec.ts @@ -2,7 +2,7 @@ import ArLocal from 'arlocal'; import { JWKInterface } from 'arweave/node/lib/wallet'; import { assert } from 'console'; import { getTag } from 'warp-contract-utils'; -import { LoggerFactory, Warp, WarpFactory, SmartWeaveTags, ContractError } from 'warp-contracts'; +import { LoggerFactory, Warp, WarpFactory, SMART_WEAVE_TAGS, WARP_TAGS } from 'warp-contracts'; import { DeployPlugin } from 'warp-contracts-plugin-deploy'; import { connectERC20, deployERC20, ERC20Contract, ERC20State } from '../bindings/erc20-js-binding'; @@ -73,9 +73,9 @@ describe('Testing the ERC20 Token', () => { expect(contractTx).not.toBeNull(); - const contractSrcTx = await warp.arweave.transactions.get(getTag(contractTx, SmartWeaveTags.CONTRACT_SRC_TX_ID)); - expect(getTag(contractSrcTx, SmartWeaveTags.CONTENT_TYPE)).toEqual('application/wasm'); - expect(getTag(contractSrcTx, SmartWeaveTags.WASM_LANG)).toEqual('rust'); + const contractSrcTx = await warp.arweave.transactions.get(getTag(contractTx, SMART_WEAVE_TAGS. CONTRACT_SRC_TX_ID)); + expect(getTag(contractSrcTx, SMART_WEAVE_TAGS. CONTENT_TYPE)).toEqual('application/wasm'); + expect(getTag(contractSrcTx, WARP_TAGS.WASM_LANG)).toEqual('rust'); }); it('should read erc20 state and balance data', async () => { diff --git a/contracts/pst/tests/contract.spec.ts b/contracts/pst/tests/contract.spec.ts index 17b2bec..56b696c 100644 --- a/contracts/pst/tests/contract.spec.ts +++ b/contracts/pst/tests/contract.spec.ts @@ -9,7 +9,8 @@ import { PstState, Warp, WarpFactory, - SmartWeaveTags, + SMART_WEAVE_TAGS, + WARP_TAGS, } from 'warp-contracts'; import path from 'path'; import { getTag } from 'warp-contract-utils'; @@ -111,9 +112,9 @@ describe('Testing the Profit Sharing Token', () => { expect(contractTx).not.toBeNull(); - const contractSrcTx = await warp.arweave.transactions.get(getTag(contractTx, SmartWeaveTags.CONTRACT_SRC_TX_ID)); - expect(getTag(contractSrcTx, SmartWeaveTags.CONTENT_TYPE)).toEqual('application/wasm'); - expect(getTag(contractSrcTx, SmartWeaveTags.WASM_LANG)).toEqual('rust'); + const contractSrcTx = await warp.arweave.transactions.get(getTag(contractTx, SMART_WEAVE_TAGS. CONTRACT_SRC_TX_ID)); + expect(getTag(contractSrcTx, SMART_WEAVE_TAGS. CONTENT_TYPE)).toEqual('application/wasm'); + expect(getTag(contractSrcTx, WARP_TAGS. WASM_LANG)).toEqual('rust'); }); it('should read pst state and balance data', async () => { diff --git a/examples/staking/tests/staking.spec.ts b/examples/staking/tests/staking.spec.ts index 9331a38..6208da0 100644 --- a/examples/staking/tests/staking.spec.ts +++ b/examples/staking/tests/staking.spec.ts @@ -1,6 +1,6 @@ import ArLocal from 'arlocal'; import { JWKInterface } from 'arweave/node/lib/wallet'; -import { LoggerFactory, Warp, WarpFactory, SmartWeaveTags } from 'warp-contracts'; +import { LoggerFactory, Warp, WarpFactory, SMART_WEAVE_TAGS, WARP_TAGS } from 'warp-contracts'; import { connectERC20, deployERC20, ERC20Contract, ERC20State } from 'erc20/bindings/erc20-js-binding'; @@ -95,9 +95,9 @@ describe('Testing the Staking Logic', () => { expect(contractTx).not.toBeNull(); - const contractSrcTx = await warp.arweave.transactions.get(getTag(contractTx, SmartWeaveTags.CONTRACT_SRC_TX_ID)); - expect(getTag(contractSrcTx, SmartWeaveTags.CONTENT_TYPE)).toEqual('application/wasm'); - expect(getTag(contractSrcTx, SmartWeaveTags.WASM_LANG)).toEqual('rust'); + const contractSrcTx = await warp.arweave.transactions.get(getTag(contractTx, SMART_WEAVE_TAGS. CONTRACT_SRC_TX_ID)); + expect(getTag(contractSrcTx, SMART_WEAVE_TAGS. CONTENT_TYPE)).toEqual('application/wasm'); + expect(getTag(contractSrcTx, WARP_TAGS. WASM_LANG)).toEqual('rust'); expect(await erc20.currentState()).toEqual(initialERC20State); }); @@ -107,9 +107,9 @@ describe('Testing the Staking Logic', () => { expect(contractTx).not.toBeNull(); - const contractSrcTx = await warp.arweave.transactions.get(getTag(contractTx, SmartWeaveTags.CONTRACT_SRC_TX_ID)); - expect(getTag(contractSrcTx, SmartWeaveTags.CONTENT_TYPE)).toEqual('application/wasm'); - expect(getTag(contractSrcTx, SmartWeaveTags.WASM_LANG)).toEqual('rust'); + const contractSrcTx = await warp.arweave.transactions.get(getTag(contractTx, SMART_WEAVE_TAGS. CONTRACT_SRC_TX_ID)); + expect(getTag(contractSrcTx, SMART_WEAVE_TAGS. CONTENT_TYPE)).toEqual('application/wasm'); + expect(getTag(contractSrcTx, WARP_TAGS. WASM_LANG)).toEqual('rust'); expect(await staking.currentState()).toEqual(initialStakingState); }); diff --git a/package.json b/package.json index 8111ef9..137940a 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,8 @@ "arweave": "1.11.4", "ts-jest": "^28.0.7", "typescript": "^4.7.4", - "warp-contracts": "1.2.55", - "warp-contracts-plugin-deploy": "^1.0.0", + "warp-contracts": "1.3.1", + "warp-contracts-plugin-deploy": "^1.0.1", "yargs": "17.5.1" }, "resolutions": { diff --git a/yarn.lock b/yarn.lock index 82c089c..2031b96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6420,19 +6420,19 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -warp-contracts-plugin-deploy@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/warp-contracts-plugin-deploy/-/warp-contracts-plugin-deploy-1.0.0.tgz#c3d8ab88b8b838f59e34653589a82ae09dc4c86e" - integrity sha512-HU4A0GZAP6XATFv7fuHA2EUP6V+h0ZluGiv2JjH6AE6LTqFBtP+PixgtNZds5YcOf+eLO01gv15vaT7pea0W6w== +warp-contracts-plugin-deploy@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/warp-contracts-plugin-deploy/-/warp-contracts-plugin-deploy-1.0.1.tgz#8111c5a541878877c661ec02c1dbab8ceb83b765" + integrity sha512-bREwz3ICBBapMQnm+nMpvgQeZphHi6cylE/s1eF/f3AnIOi93UHOK74oCuBYcbhnqncIlSF1i77jSGLd1P8Z5g== dependencies: arbundles "^0.7.3" arlocal "^1.1.59" node-stdlib-browser "^1.2.0" -warp-contracts@1.2.55: - version "1.2.55" - resolved "https://registry.yarnpkg.com/warp-contracts/-/warp-contracts-1.2.55.tgz#278e3498b0eec099921f57a3c888ee9cd3b48b4f" - integrity sha512-bhP/5vBYjOI/qqxp8AMhO1jGjOT1w5ux11UkuELeiTI+5UCc9lTL0usBiixTWZdrIn5MzG6yOpO1K9RM3V66tQ== +warp-contracts@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/warp-contracts/-/warp-contracts-1.3.1.tgz#a64665029a0336665ce511ce82146fc8517773a1" + integrity sha512-atT9LaJ4SOhoAtvuP5CBuSHH2K5gs2vpuNJnJGkQhtlIf/nZELy/5TJQLeUtp8u8c8JSi9BkCI/er0V8dq2M/g== dependencies: "@idena/vrf-js" "^1.0.1" archiver "^5.3.0"