diff --git a/Clarinet.toml b/Clarinet.toml index 0343f19..ca0758c 100644 --- a/Clarinet.toml +++ b/Clarinet.toml @@ -8,8 +8,8 @@ requirements = [] [contracts.counter] path = 'contracts/counter.clar' -clarity_version = 2 -epoch = 2.5 +epoch = 3.0 +clarity_version = 3 [repl.analysis] passes = ['check_checker'] diff --git a/contracts/counter.clar b/contracts/counter.clar index cd41294..b9dcec1 100644 --- a/contracts/counter.clar +++ b/contracts/counter.clar @@ -13,7 +13,7 @@ (define-read-only (get-count-at-block (block uint)) (ok (at-block - (unwrap! (get-block-info? id-header-hash block) ERR_BLOCK_NOT_FOUND) + (unwrap! (get-stacks-block-info? id-header-hash block) ERR_BLOCK_NOT_FOUND) (var-get count) )) ) diff --git a/deployments/default.devnet-plan.yaml b/deployments/default.devnet-plan.yaml index 424a21c..59fb312 100644 --- a/deployments/default.devnet-plan.yaml +++ b/deployments/default.devnet-plan.yaml @@ -11,8 +11,8 @@ plan: - contract-publish: contract-name: counter expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM - cost: 10760 + cost: 10830 path: contracts/counter.clar anchor-block-only: true - clarity-version: 2 - epoch: "2.5" + clarity-version: 3 + epoch: "3.0" diff --git a/deployments/default.simnet-plan.yaml b/deployments/default.simnet-plan.yaml index beb91c2..9b72a2e 100644 --- a/deployments/default.simnet-plan.yaml +++ b/deployments/default.simnet-plan.yaml @@ -53,7 +53,7 @@ plan: contract-name: counter emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM path: contracts/counter.clar - clarity-version: 2 + clarity-version: 3 - emulated-contract-call: contract-id: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.counter emulated-sender: ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5 @@ -65,4 +65,4 @@ plan: mstx-amount: 2222222 cost: 1000 anchor-block-only: true - epoch: "2.5" + epoch: "3.0" diff --git a/package-lock.json b/package-lock.json index 5699d09..1d7a388 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@hirosystems/clarinet-sdk": "^2.7.0", + "@hirosystems/clarinet-sdk": "^2.8.0", "@stacks/transactions": "^6.8.1", "chokidar-cli": "^3.0.0", "typescript": "^5.3.3", @@ -387,15 +387,12 @@ } }, "node_modules/@hirosystems/clarinet-sdk": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@hirosystems/clarinet-sdk/-/clarinet-sdk-2.7.0.tgz", - "integrity": "sha512-JF2l5l3XM/q/GzkQDSlPYQp1KRDgNqcfvArEEtukJHdT8G7OMzjo1mUFK1/qbDitTgWXdSL8f6dg+YZ1DQaCCA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@hirosystems/clarinet-sdk/-/clarinet-sdk-2.8.0.tgz", + "integrity": "sha512-/xxct6Q+TB+WoD/Qc/Y4Oq4vgLybs4EmBWdqmVl7P9ocUxt39qTXpWHUg/AdprCtWHTe4WywmrNAiMHbf6Bc9w==", "license": "GPL-3.0", "dependencies": { - "@hirosystems/clarinet-sdk-wasm": "^2.7.0", - "@stacks/encryption": "^6.13.0", - "@stacks/network": "^6.13.0", - "@stacks/stacking": "^6.13.0", + "@hirosystems/clarinet-sdk-wasm": "^2.8.0", "@stacks/transactions": "^6.13.0", "kolorist": "^1.8.0", "prompts": "^2.4.2", @@ -403,16 +400,16 @@ "yargs": "^17.7.2" }, "bin": { - "clarinet-sdk": "dist/cjs/bin/index.js" + "clarinet-sdk": "dist/cjs/node/src/bin/index.js" }, "engines": { "node": ">=18.0.0" } }, "node_modules/@hirosystems/clarinet-sdk-wasm": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@hirosystems/clarinet-sdk-wasm/-/clarinet-sdk-wasm-2.7.0.tgz", - "integrity": "sha512-Uz4/fx7rGC6hkR+Th44p+damQNvWX+WgwJliStL/WShdI/q7SLtYLkz3EGMLX0f/xv7hZ8H6X5fyE3Ca+RFt2Q==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@hirosystems/clarinet-sdk-wasm/-/clarinet-sdk-wasm-2.8.0.tgz", + "integrity": "sha512-Lkr7YHzirierK50fTKTtVpXUvvUfPT+U70bDzB+13oK3NUtWG18zq6JNQ5A2NLWniU/szPJ4M9C63ba7+U091Q==", "license": "GPL-3.0" }, "node_modules/@jest/schemas": { @@ -665,31 +662,6 @@ "win32" ] }, - "node_modules/@scure/base": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.7.tgz", - "integrity": "sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==", - "license": "MIT", - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@scure/bip39": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.0.tgz", - "integrity": "sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "license": "MIT", - "dependencies": { - "@noble/hashes": "~1.1.1", - "@scure/base": "~1.1.0" - } - }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -706,23 +678,6 @@ "@types/node": "^18.0.4" } }, - "node_modules/@stacks/encryption": { - "version": "6.16.0", - "resolved": "https://registry.npmjs.org/@stacks/encryption/-/encryption-6.16.0.tgz", - "integrity": "sha512-RfCtUts+fWKgL9X9VF4Ob+r7uSNApawnpq+flUJHehzzw3vEEPbkXQnJmXKS0Y9pz74YZqOegExbQIvcRPUkyw==", - "license": "MIT", - "dependencies": { - "@noble/hashes": "1.1.5", - "@noble/secp256k1": "1.7.1", - "@scure/bip39": "1.1.0", - "@stacks/common": "^6.16.0", - "@types/node": "^18.0.4", - "base64-js": "^1.5.1", - "bs58": "^5.0.0", - "ripemd160-min": "^0.0.6", - "varuint-bitcoin": "^1.1.2" - } - }, "node_modules/@stacks/network": { "version": "6.16.0", "resolved": "https://registry.npmjs.org/@stacks/network/-/network-6.16.0.tgz", @@ -733,40 +688,6 @@ "cross-fetch": "^3.1.5" } }, - "node_modules/@stacks/stacking": { - "version": "6.16.0", - "resolved": "https://registry.npmjs.org/@stacks/stacking/-/stacking-6.16.0.tgz", - "integrity": "sha512-FjhKYyaCu/KytP/khWB9KhNOOrZdqM56xn9yxvZCR6McGSZ+hBeLud1E2WugIOzRX0muZbygCz9c1GBTz+pLiA==", - "license": "MIT", - "dependencies": { - "@noble/hashes": "1.1.5", - "@scure/base": "1.1.1", - "@stacks/common": "^6.16.0", - "@stacks/encryption": "^6.16.0", - "@stacks/network": "^6.16.0", - "@stacks/stacks-blockchain-api-types": "^0.61.0", - "@stacks/transactions": "^6.16.0", - "bs58": "^5.0.0" - } - }, - "node_modules/@stacks/stacking/node_modules/@scure/base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", - "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "license": "MIT" - }, - "node_modules/@stacks/stacks-blockchain-api-types": { - "version": "0.61.0", - "resolved": "https://registry.npmjs.org/@stacks/stacks-blockchain-api-types/-/stacks-blockchain-api-types-0.61.0.tgz", - "integrity": "sha512-yPOfTUboo5eA9BZL/hqMcM71GstrFs9YWzOrJFPeP4cOO1wgYvAcckgBRbgiE3NqeX0A7SLZLDAXLZbATuRq9w==", - "license": "ISC" - }, "node_modules/@stacks/transactions": { "version": "6.16.0", "resolved": "https://registry.npmjs.org/@stacks/transactions/-/transactions-6.16.0.tgz", @@ -947,26 +868,6 @@ "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==", "license": "MIT" }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -991,15 +892,6 @@ "node": ">=8" } }, - "node_modules/bs58": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", - "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", - "license": "MIT", - "dependencies": { - "base-x": "^4.0.0" - } - }, "node_modules/c32check": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/c32check/-/c32check-2.0.0.tgz", @@ -1984,14 +1876,6 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "license": "ISC" }, - "node_modules/ripemd160-min": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/ripemd160-min/-/ripemd160-min-0.0.6.tgz", - "integrity": "sha512-+GcJgQivhs6S9qvLogusiTcS9kQUfgR75whKuy5jIhuiOfQuJ8fjqxV6EGD5duH1Y/FawFUMtMhyeq3Fbnib8A==", - "engines": { - "node": ">=8" - } - }, "node_modules/rollup": { "version": "4.18.0", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", @@ -2027,26 +1911,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -2245,15 +2109,6 @@ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "license": "MIT" }, - "node_modules/varuint-bitcoin": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz", - "integrity": "sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==", - "license": "MIT", - "dependencies": { - "safe-buffer": "^5.1.1" - } - }, "node_modules/vite": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.3.tgz", diff --git a/package.json b/package.json index 2c0507e..f920ff8 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "author": "", "license": "ISC", "dependencies": { - "@hirosystems/clarinet-sdk": "^2.7.0", + "@hirosystems/clarinet-sdk": "^2.8.0", "@stacks/transactions": "^6.8.1", "chokidar-cli": "^3.0.0", "typescript": "^5.3.3", diff --git a/settings/Devnet.toml b/settings/Devnet.toml index 10ca3e1..f7e1f6e 100644 --- a/settings/Devnet.toml +++ b/settings/Devnet.toml @@ -75,11 +75,14 @@ balance = 100_000_000_000_000 [devnet] disable_stacks_explorer = false disable_stacks_api = false -bitcoin_controller_block_time = 6000 -# stacks_node_image_url = "localhost:5001/stacks-node:local" -# stacks_signer_image_url = "localhost:5001/stacks-signer:local" -# stacks_node_image_url = "quay.io/hirosystems/stacks-node:devnet-2.5" -# stacks_signer_image_url = "quay.io/hirosystems/stacks-signer:devnet-2.5" + +epoch_3_0 = 144 + +stacks_node_image_url = "quay.io/hirosystems/stacks-node:devnet-3.0" +stacks_signer_image_url = "quay.io/hirosystems/stacks-signer:devnet-3.0" +stacks_api_image_url = "hirosystems/stacks-blockchain-api:7.13.1-beta.1" + +# use_docker_gateway_routing = true # disable_bitcoin_explorer = true # working_dir = "tmp/devnet" @@ -102,7 +105,6 @@ bitcoin_controller_block_time = 6000 # bitcoin_node_image_url = "quay.io/hirosystems/bitcoind:devnet-v2" # stacks_node_image_url = "quay.io/hirosystems/stacks-node:devnet-with-signer-beta4" # stacks_signer_image_url = "quay.io/hirosystems/stacks-node:devnet-with-signer-beta4" -# stacks_api_image_url = "hirosystems/stacks-blockchain-api:7.9.0-nakamoto.1" # stacks_explorer_image_url = "hirosystems/explorer:latest" # bitcoin_explorer_image_url = "quay.io/hirosystems/bitcoin-explorer:devnet" # postgres_image_url = "postgres:14" @@ -113,7 +115,6 @@ bitcoin_controller_block_time = 6000 # epoch_2_2 = 104 # epoch_2_3 = 105 # epoch_2_4 = 106 -# epoch_3_0 = 124 # Send some stacking orders [[devnet.pox_stacking_orders]] diff --git a/tests/counter.test.ts b/tests/counter.test.ts index 37d029a..d27516f 100644 --- a/tests/counter.test.ts +++ b/tests/counter.test.ts @@ -26,7 +26,7 @@ describe("test get counter", () => { "counter", "get-count", [], - address1 + address1, ); expect(result).toHaveClarityType(ClarityType.UInt); @@ -46,7 +46,7 @@ describe("test ", () => { "counter", "increment", [], - address1 + address1, ); expect(result).toBeOk(Cl.bool(true)); @@ -59,7 +59,7 @@ describe("test ", () => { "counter", "increment", [], - address1 + address1, ); expect(events.length).toBe(1); const transferEvent = events[0]; @@ -98,7 +98,7 @@ describe("test ", () => { "counter", "decrement", [], - address1 + address1, ); expect(result).toBeErr(Cl.uint(1001)); }); @@ -110,7 +110,7 @@ describe("test ", () => { "counter", "add", [Cl.uint(3)], - address1 + address1, ); expect(result).toBeOk(Cl.bool(true)); @@ -123,7 +123,7 @@ describe("test ", () => { "counter", "add", [Cl.uint(3)], - address1 + address1, ); expect(events.length).toBe(1); @@ -141,7 +141,7 @@ describe("test ", () => { "counter", "add", [Cl.uint(1)], - address1 + address1, ); expect(result).toBeErr(Cl.uint(1002)); }); @@ -158,14 +158,14 @@ describe("test get counter at block height", () => { "counter", "get-count-at-block", [height1], - address1 + address1, ); expect(atBlock1.result).toBeOk(Cl.uint(initialCount)); const atBlock2 = simnet.callReadOnlyFn( "counter", "get-count-at-block", [height2], - address1 + address1, ); expect(atBlock2.result).toBeOk(Cl.uint(initialCount + 1)); });