From 448fc0e58b14e0016f45fd548a47e41ce7cb660f Mon Sep 17 00:00:00 2001 From: open-junius Date: Fri, 20 Feb 2026 20:28:57 +0800 Subject: [PATCH 1/3] try with fixed cargo contract version --- contract-tests/package.json | 2 +- contract-tests/run-ci.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contract-tests/package.json b/contract-tests/package.json index 3acf069c1d..6b5eda8146 100644 --- a/contract-tests/package.json +++ b/contract-tests/package.json @@ -1,6 +1,6 @@ { "scripts": { - "test": "TS_NODE_PREFER_TS_EXTS=1 TS_NODE_TRANSPILE_ONLY=1 mocha --timeout 999999 --retries 3 --file src/setup.ts --require ts-node/register --extension ts \"test/**/*.ts\"" + "test": "TS_NODE_PREFER_TS_EXTS=1 TS_NODE_TRANSPILE_ONLY=1 mocha --timeout 999999 --retries 3 --file src/setup.ts --require ts-node/register --extension ts \"test/wasm.contract.test.ts\"" }, "keywords": [], "author": "", diff --git a/contract-tests/run-ci.sh b/contract-tests/run-ci.sh index 0ea0e72297..2190e15455 100755 --- a/contract-tests/run-ci.sh +++ b/contract-tests/run-ci.sh @@ -7,9 +7,11 @@ cd contract-tests cd bittensor rustup component add rust-src -cargo install cargo-contract +cargo install cargo-contract --force --locked 5.0.3 cargo contract build --release +cargo contract --version + cd ../.. scripts/localnet.sh &>/dev/null & From 3517f2805a8a79f48e9a3309edee47b532b48036 Mon Sep 17 00:00:00 2001 From: open-junius Date: Fri, 20 Feb 2026 22:48:07 +0800 Subject: [PATCH 2/3] correct parameter to install contract --- contract-tests/run-ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contract-tests/run-ci.sh b/contract-tests/run-ci.sh index 2190e15455..042320445f 100755 --- a/contract-tests/run-ci.sh +++ b/contract-tests/run-ci.sh @@ -7,7 +7,7 @@ cd contract-tests cd bittensor rustup component add rust-src -cargo install cargo-contract --force --locked 5.0.3 +cargo install cargo-contract --force --locked --version 5.0.3 cargo contract build --release cargo contract --version From 8badadf770bd2ff0e9b2e3a1fc1a0c8f2b74ec91 Mon Sep 17 00:00:00 2001 From: open-junius Date: Mon, 23 Feb 2026 16:37:10 +0800 Subject: [PATCH 3/3] put wasm and json in repo --- contract-tests/bittensor.json | 1404 +++++++++++++++++++++ contract-tests/bittensor.wasm | Bin 0 -> 12284 bytes contract-tests/get-metadata.sh | 2 +- contract-tests/package.json | 2 +- contract-tests/run-ci.sh | 12 - contract-tests/test/wasm.contract.test.ts | 2 +- 6 files changed, 1407 insertions(+), 15 deletions(-) create mode 100644 contract-tests/bittensor.json create mode 100644 contract-tests/bittensor.wasm diff --git a/contract-tests/bittensor.json b/contract-tests/bittensor.json new file mode 100644 index 0000000000..34d9775c4f --- /dev/null +++ b/contract-tests/bittensor.json @@ -0,0 +1,1404 @@ +{ + "source": { + "hash": "0x42d943ac418b71ee6039a637f60c645292dfe21bdff171a1b9490a53538ae37c", + "language": "ink! 5.1.1", + "compiler": "rustc 1.89.0", + "build_info": { + "build_mode": "Release", + "cargo_contract_version": "5.0.3", + "rust_toolchain": "stable-x86_64-unknown-linux-gnu", + "wasm_opt_settings": { + "keep_debug_symbols": false, + "optimization_passes": "Z" + } + } + }, + "contract": { + "name": "bittensor", + "version": "0.1.0", + "authors": [ + "[your_name] <[your_email]>" + ] + }, + "image": null, + "spec": { + "constructors": [ + { + "args": [], + "default": false, + "docs": [ + "Constructor" + ], + "label": "new", + "payable": false, + "returnType": { + "displayName": [ + "ink_primitives", + "ConstructorResult" + ], + "type": 1 + }, + "selector": "0x9bae9d5e" + }, + { + "args": [], + "default": false, + "docs": [ + "Constructor" + ], + "label": "default", + "payable": false, + "returnType": { + "displayName": [ + "ink_primitives", + "ConstructorResult" + ], + "type": 1 + }, + "selector": "0xed4b9d1b" + } + ], + "docs": [], + "environment": { + "accountId": { + "displayName": [ + "AccountId" + ], + "type": 11 + }, + "balance": { + "displayName": [ + "Balance" + ], + "type": 14 + }, + "blockNumber": { + "displayName": [ + "BlockNumber" + ], + "type": 24 + }, + "chainExtension": { + "displayName": [ + "ChainExtension" + ], + "type": 25 + }, + "hash": { + "displayName": [ + "Hash" + ], + "type": 23 + }, + "maxEventTopics": 4, + "staticBufferSize": 16384, + "timestamp": { + "displayName": [ + "Timestamp" + ], + "type": 14 + } + }, + "events": [], + "lang_error": { + "displayName": [ + "ink", + "LangError" + ], + "type": 3 + }, + "messages": [ + { + "args": [ + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "coldkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + } + ], + "default": false, + "docs": [], + "label": "get_stake_info_for_hotkey_coldkey_netuid", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 7 + }, + "selector": "0x5b73b8b9" + }, + { + "args": [ + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "amount", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + } + ], + "default": false, + "docs": [], + "label": "add_stake", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0x3a656e31" + }, + { + "args": [ + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "amount", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + } + ], + "default": false, + "docs": [], + "label": "remove_stake", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0x7758d434" + }, + { + "args": [ + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + } + ], + "default": false, + "docs": [], + "label": "unstake_all", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0x3f525cc7" + }, + { + "args": [ + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + } + ], + "default": false, + "docs": [], + "label": "unstake_all_alpha", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0xab74c422" + }, + { + "args": [ + { + "label": "origin_hotkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "destination_hotkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "origin_netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "destination_netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "amount", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + } + ], + "default": false, + "docs": [], + "label": "move_stake", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0xa06b0c55" + }, + { + "args": [ + { + "label": "destination_coldkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "origin_netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "destination_netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "amount", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + } + ], + "default": false, + "docs": [], + "label": "transfer_stake", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0x3528ef5e" + }, + { + "args": [ + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "origin_netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "destination_netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "amount", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + } + ], + "default": false, + "docs": [], + "label": "swap_stake", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0x04f7ca30" + }, + { + "args": [ + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "amount", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + }, + { + "label": "limit_price", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + }, + { + "label": "allow_partial", + "type": { + "displayName": [ + "bool" + ], + "type": 17 + } + } + ], + "default": false, + "docs": [], + "label": "add_stake_limit", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0x30013b98" + }, + { + "args": [ + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "amount", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + }, + { + "label": "limit_price", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + }, + { + "label": "allow_partial", + "type": { + "displayName": [ + "bool" + ], + "type": 17 + } + } + ], + "default": false, + "docs": [], + "label": "remove_stake_limit", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0xc3ce39c8" + }, + { + "args": [ + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "origin_netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "destination_netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "amount", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + }, + { + "label": "limit_price", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + }, + { + "label": "allow_partial", + "type": { + "displayName": [ + "bool" + ], + "type": 17 + } + } + ], + "default": false, + "docs": [], + "label": "swap_stake_limit", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0x212ef7ad" + }, + { + "args": [ + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + }, + { + "label": "netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "limit_price", + "type": { + "displayName": [ + "u64" + ], + "type": 14 + } + } + ], + "default": false, + "docs": [], + "label": "remove_stake_full_limit", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0xa6d6ea64" + }, + { + "args": [ + { + "label": "netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + }, + { + "label": "hotkey", + "type": { + "displayName": [], + "type": 4 + } + } + ], + "default": false, + "docs": [], + "label": "set_coldkey_auto_stake_hotkey", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0xe24f0d8a" + }, + { + "args": [ + { + "label": "delegate", + "type": { + "displayName": [], + "type": 4 + } + } + ], + "default": false, + "docs": [], + "label": "add_proxy", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0x528b6757" + }, + { + "args": [ + { + "label": "delegate", + "type": { + "displayName": [], + "type": 4 + } + } + ], + "default": false, + "docs": [], + "label": "remove_proxy", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 19 + }, + "selector": "0x129d4f75" + }, + { + "args": [ + { + "label": "netuid", + "type": { + "displayName": [ + "u16" + ], + "type": 6 + } + } + ], + "default": false, + "docs": [], + "label": "get_alpha_price", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 21 + }, + "selector": "0x08adc2e2" + } + ] + }, + "storage": { + "root": { + "layout": { + "struct": { + "fields": [], + "name": "Bittensor" + } + }, + "root_key": "0x00000000", + "ty": 0 + } + }, + "types": [ + { + "id": 0, + "type": { + "def": { + "composite": {} + }, + "path": [ + "bittensor", + "bittensor", + "Bittensor" + ] + } + }, + { + "id": 1, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 2 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 3 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 2 + }, + { + "name": "E", + "type": 3 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 2, + "type": { + "def": { + "tuple": [] + } + } + }, + { + "id": 3, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 1, + "name": "CouldNotReadInput" + } + ] + } + }, + "path": [ + "ink_primitives", + "LangError" + ] + } + }, + { + "id": 4, + "type": { + "def": { + "array": { + "len": 32, + "type": 5 + } + } + } + }, + { + "id": 5, + "type": { + "def": { + "primitive": "u8" + } + } + }, + { + "id": 6, + "type": { + "def": { + "primitive": "u16" + } + } + }, + { + "id": 7, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 8 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 3 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 8 + }, + { + "name": "E", + "type": 3 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 8, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 9 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 18 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 9 + }, + { + "name": "E", + "type": 18 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 9, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 10 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 10 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 10, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "hotkey", + "type": 11, + "typeName": "AccountId" + }, + { + "name": "coldkey", + "type": 11, + "typeName": "AccountId" + }, + { + "name": "netuid", + "type": 12, + "typeName": "Compact" + }, + { + "name": "stake", + "type": 13, + "typeName": "Compact" + }, + { + "name": "locked", + "type": 15, + "typeName": "Compact" + }, + { + "name": "emission", + "type": 13, + "typeName": "Compact" + }, + { + "name": "tao_emission", + "type": 16, + "typeName": "Compact" + }, + { + "name": "drain", + "type": 15, + "typeName": "Compact" + }, + { + "name": "is_registered", + "type": 17, + "typeName": "bool" + } + ] + } + }, + "params": [ + { + "name": "AccountId", + "type": 11 + } + ], + "path": [ + "bittensor", + "StakeInfo" + ] + } + }, + { + "id": 11, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 4, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_primitives", + "types", + "AccountId" + ] + } + }, + { + "id": 12, + "type": { + "def": { + "compact": { + "type": 6 + } + } + } + }, + { + "id": 13, + "type": { + "def": { + "compact": { + "type": 14 + } + } + } + }, + { + "id": 14, + "type": { + "def": { + "primitive": "u64" + } + } + }, + { + "id": 15, + "type": { + "def": { + "compact": { + "type": 14 + } + } + } + }, + { + "id": 16, + "type": { + "def": { + "compact": { + "type": 14 + } + } + } + }, + { + "id": 17, + "type": { + "def": { + "primitive": "bool" + } + } + }, + { + "id": 18, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "ReadFailed" + }, + { + "index": 1, + "name": "WriteFailed" + } + ] + } + }, + "path": [ + "bittensor", + "ReadWriteErrorCode" + ] + } + }, + { + "id": 19, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 20 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 3 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 20 + }, + { + "name": "E", + "type": 3 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 20, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 2 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 18 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 2 + }, + { + "name": "E", + "type": 18 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 21, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 22 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 3 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 22 + }, + { + "name": "E", + "type": 3 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 22, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 14 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 18 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 14 + }, + { + "name": "E", + "type": 18 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 23, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 4, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_primitives", + "types", + "Hash" + ] + } + }, + { + "id": 24, + "type": { + "def": { + "primitive": "u32" + } + } + }, + { + "id": 25, + "type": { + "def": { + "variant": {} + }, + "path": [ + "bittensor", + "RuntimeReadWrite" + ] + } + } + ], + "version": 5 +} \ No newline at end of file diff --git a/contract-tests/bittensor.wasm b/contract-tests/bittensor.wasm new file mode 100644 index 0000000000000000000000000000000000000000..ea10e2d3325fbc7f9ad56cc4ce977f68803a62d7 GIT binary patch literal 12284 zcmds-Yiu0Xb%5_b(niab$rRelMwHkfkbVXE6G&>pL|)2z zP!wUOsY%!d&)MqAr`I7N^mMPK>R7EXa6 z>UZv)nO%ycWEo6Qgar29IWu$ad7pF79d+#NgIX!2CkKw2r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*s4er~_;FHQ_rEjzSv@2M#UEh`iZG8Kwj1_jHYx?%aWW0}c9pfjPT0efvg>Kxsry@wd zb@#iwn{3_34I6&HZI>PYC;UpXkvHrZ!*_7({P|9&=0j_n0-i2#R!n1^2U&+I)PaM& zPdik?RVv|XUJ1)YDq;4K)>p%PD=d#jigrrm&UzR!U^wtuTB$w7;f( z!7C4>ys7IZKU1dE1SpjvB`|erQ5dJuFyClUbazM(RjG1)S;^6EUQNn}%%3oPpI3aa z5z6&7j*KIr2f{(-1rZSieT@p=a$M}`FV2PKtd?_OIfCVEg-rkx`UJf5A37Z9ep(-( z*bZICKc*+;KX!G#b7tg#WFC&C(HEZhE9$%zPwb*;Y0+`eJE<-gGF~S%vgz_4V8{@o zJ6|`;_ZpBZs_HnEm^*`v$jId)`klsUfz}l2CEKLoUZ&IeCq5+ literal 0 HcmV?d00001 diff --git a/contract-tests/get-metadata.sh b/contract-tests/get-metadata.sh index 64d76bff29..f074c434ac 100755 --- a/contract-tests/get-metadata.sh +++ b/contract-tests/get-metadata.sh @@ -1,3 +1,3 @@ rm -rf .papi npx papi add devnet -w ws://localhost:9944 -npx papi ink add ./bittensor/target/ink/bittensor.json \ No newline at end of file +npx papi ink add ./bittensor.json \ No newline at end of file diff --git a/contract-tests/package.json b/contract-tests/package.json index 6b5eda8146..3acf069c1d 100644 --- a/contract-tests/package.json +++ b/contract-tests/package.json @@ -1,6 +1,6 @@ { "scripts": { - "test": "TS_NODE_PREFER_TS_EXTS=1 TS_NODE_TRANSPILE_ONLY=1 mocha --timeout 999999 --retries 3 --file src/setup.ts --require ts-node/register --extension ts \"test/wasm.contract.test.ts\"" + "test": "TS_NODE_PREFER_TS_EXTS=1 TS_NODE_TRANSPILE_ONLY=1 mocha --timeout 999999 --retries 3 --file src/setup.ts --require ts-node/register --extension ts \"test/**/*.ts\"" }, "keywords": [], "author": "", diff --git a/contract-tests/run-ci.sh b/contract-tests/run-ci.sh index 042320445f..5258af8fec 100755 --- a/contract-tests/run-ci.sh +++ b/contract-tests/run-ci.sh @@ -2,18 +2,6 @@ echo "start run-ci.sh" -cd contract-tests - -cd bittensor - -rustup component add rust-src -cargo install cargo-contract --force --locked --version 5.0.3 -cargo contract build --release - -cargo contract --version - -cd ../.. - scripts/localnet.sh &>/dev/null & i=1 diff --git a/contract-tests/test/wasm.contract.test.ts b/contract-tests/test/wasm.contract.test.ts index 26d5c87924..fab51f2f9c 100644 --- a/contract-tests/test/wasm.contract.test.ts +++ b/contract-tests/test/wasm.contract.test.ts @@ -10,7 +10,7 @@ import { convertPublicKeyToSs58 } from "../src/address-utils"; import { addNewSubnetwork, sendWasmContractExtrinsic } from "../src/subtensor"; import { tao } from "../src/balance-math"; -const bittensorWasmPath = "./bittensor/target/ink/bittensor.wasm" +const bittensorWasmPath = "./bittensor.wasm" const bittensorBytecode = fs.readFileSync(bittensorWasmPath) describe("Test wasm contract", () => {