Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 29 additions & 28 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,53 @@
"typecheck:solochain-evm": "tsc -p tsconfig.solochain-evm.json --noEmit",
"typecheck:all": "pnpm typecheck:parachain && pnpm typecheck:solochain-evm",
"typecheck": "pnpm typecheck:all",
"crossbuild:mac": "DOCKER_DEFAULT_PLATFORM=linux/amd64 pnpm tsx scripts/crossBuildMac.ts",
"crossbuild:mac:backend": "DOCKER_DEFAULT_PLATFORM=linux/amd64 pnpm tsx scripts/crossBuildBackendMac.ts",
"docker:build": "DOCKER_DEFAULT_PLATFORM=linux/amd64 pnpm tsx scripts/buildLocalDocker.ts",
"docker:build:backend": "DOCKER_DEFAULT_PLATFORM=linux/amd64 pnpm tsx scripts/buildBackendDocker.ts",
"crossbuild:mac": "cross-env DOCKER_DEFAULT_PLATFORM=linux/amd64 pnpm tsx scripts/crossBuildMac.ts",
"crossbuild:mac:backend": "cross-env DOCKER_DEFAULT_PLATFORM=linux/amd64 pnpm tsx scripts/crossBuildBackendMac.ts",
"docker:build": "cross-env DOCKER_DEFAULT_PLATFORM=linux/amd64 pnpm tsx scripts/buildLocalDocker.ts",
"docker:build:backend": "cross-env DOCKER_DEFAULT_PLATFORM=linux/amd64 pnpm tsx scripts/buildBackendDocker.ts",
"sdk:build": "pnpm --filter @storagehub-sdk/core build && pnpm --filter @storagehub-sdk/msp-client build",
"docker:start": "docker compose -f ../docker/local-parachain-compose.yml -p sh_dev_node up -d",
"docker:start:latest": "docker compose -f ../docker/latest-node-compose.yml -p sh_dev_node up -d",
"docker:stop": "docker compose -f ../docker/local-parachain-compose.yml -p sh_dev_node down",
"docker:stop:all": "docker rm -vf $(docker ps -a --filter 'ancestor=storage-hub:local' -q) $(docker ps -a --filter 'name=sh-postgres' -q) $(docker ps -a --filter 'name=toxiproxy' -q) $(docker ps -a --filter 'name=sh-backend' -q)",
"docker:stop:latest": "docker compose -f ../docker/latest-node-compose.yml -p sh_dev_node down",
"docker:start:bspnet": "pnpm tsx scripts/bspNetBootstrap.ts",
"docker:start:fullnet": "INDEXER=1 pnpm tsx scripts/fullNetBootstrap.ts",
"docker:start:fullnet:initialised": "INDEXER=1 pnpm tsx scripts/fullNetBootstrapInitialised.ts",
"docker:start:solochain-evm:initialised": "INDEXER=1 BACKEND=1 pnpm tsx scripts/solochainEvmBootstrapInitialised.ts",
"docker:start:fullnet": "cross-env INDEXER=1 pnpm tsx scripts/fullNetBootstrap.ts",
"docker:start:fullnet:initialised": "cross-env INDEXER=1 pnpm tsx scripts/fullNetBootstrapInitialised.ts",
"docker:start:solochain-evm:initialised": "cross-env INDEXER=1 BACKEND=1 pnpm tsx scripts/solochainEvmBootstrapInitialised.ts",
"docker:start:generateProofsDealerBenchmarkProofs": "pnpm tsx scripts/generateProofsDealerBenchmarkProofs.ts",
"docker:start:generateFileSystemBenchmarkProofs": "pnpm tsx scripts/generateFileSystemBenchmarkProofs.ts",
"docker:stop:fullnet": "docker compose -f ../docker/fullnet-base-template.yml down --remove-orphans && docker volume prune -f",
"docker:stop:bspnet": "docker compose -f ../docker/bspnet-base-template.yml down --remove-orphans && docker volume prune -f",
"docker:stop:generateProofsDealerBenchmarkProofs": "docker compose -f ../docker/local-dev-bsp-compose.yml down --remove-orphans && docker volume prune -f",
"docker:stop:generateFileSystemBenchmarkProofs": "docker compose -f ../docker/local-dev-bsp-compose.yml down --remove-orphans && docker volume prune -f",
"zombie:run:latest": "SH_IMAGE=docker.io/moonsonglabs/storage-hub:latest pnpm zombienet spawn configs/simple.toml",
"zombie:run:local": "DOCKER_BUILDKIT=0 SH_IMAGE=storage-hub:local pnpm zombienet spawn configs/simple.toml",
"zombie:run:latest": "cross-env SH_IMAGE=docker.io/moonsonglabs/storage-hub:latest pnpm zombienet spawn configs/simple.toml",
"zombie:run:local": "cross-env DOCKER_BUILDKIT=0 SH_IMAGE=storage-hub:local pnpm zombienet spawn configs/simple.toml",
"zombie:run:native": "pnpm tsx scripts/downloadPolkadot.ts stable2412 && pnpm zombienet spawn configs/simpleNative.toml",
"zombie:run:full": "SH_IMAGE=docker.io/moonsonglabs/storage-hub:latest pnpm zombienet spawn configs/fullNetwork.toml",
"zombie:run:full": "cross-env SH_IMAGE=docker.io/moonsonglabs/storage-hub:latest pnpm zombienet spawn configs/fullNetwork.toml",
"zombie:run:full:native": "pnpm tsx scripts/downloadPolkadot.ts stable2412 && pnpm zombienet spawn configs/fullNetworkNative.toml",
"zombie:setup:native": "pnpm tsx scripts/fullNetworkSetup.ts",
"zombie:test:native": "pnpm tsx scripts/downloadPolkadot.ts stable2412 && pnpm zombienet test --provider native configs/simpleNative.zndsl",
"zombie:test:local": "SH_IMAGE=storage-hub:local pnpm zombienet test configs/simple.zndsl",
"zombie:test:latest": "SH_IMAGE=docker.io/moonsonglabs/storage-hub:latest pnpm zombienet test configs/simple.zndsl",
"zombie:test:local": "cross-env SH_IMAGE=storage-hub:local pnpm zombienet test configs/simple.zndsl",
"zombie:test:latest": "cross-env SH_IMAGE=docker.io/moonsonglabs/storage-hub:latest pnpm zombienet test configs/simple.zndsl",
"test:full": "node --no-deprecation --import tsx --test ./suites/zombie/**.spec.ts",
"test:fullnet": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/msp/**.test.ts",
"test:fullnet:only": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/msp/**.test.ts",
"test:bspnet": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/bsp/**.test.ts",
"test:bspnet:only": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --import tsx --test-concurrency 1 --test --test-only ./suites/integration/bsp/**.test.ts",
"test:user": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/user/**.test.ts",
"test:user:only": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/user/**.test.ts",
"test:solochain-evm": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/solochain-evm/**.test.ts",
"test:solochain-evm:only": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/solochain-evm/**.test.ts",
"test:fullnet": "cross-env NODE_OPTIONS=--no-deprecation pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/msp/**.test.ts",
"test:fullnet:only": "cross-env NODE_OPTIONS=--no-deprecation pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/msp/**.test.ts",
"test:bspnet": "cross-env NODE_OPTIONS=--no-deprecation pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/bsp/**.test.ts",
"test:bspnet:only": "cross-env NODE_OPTIONS=--no-deprecation pnpm tsx scripts/checkRunning.ts && node --no-deprecation --import tsx --test-concurrency 1 --test --test-only ./suites/integration/bsp/**.test.ts",
"test:user": "cross-env NODE_OPTIONS=--no-deprecation pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/user/**.test.ts",
"test:user:only": "cross-env NODE_OPTIONS=--no-deprecation pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/user/**.test.ts",
"test:solochain-evm": "cross-env NODE_OPTIONS=--no-deprecation pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/solochain-evm/**.test.ts",
"test:solochain-evm:only": "cross-env NODE_OPTIONS=--no-deprecation pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/solochain-evm/**.test.ts",
"test:node": "node --no-deprecation --import tsx --test ./suites/solo-node/**/**.test.ts",
"test:node:only": "node --no-deprecation --import tsx --test --test-only ./suites/solo-node/**/**.test.ts",
"test:node:single": "node --no-deprecation --import tsx --test --test-name-pattern=$FILTER ./suites/solo-node/**/**.test.ts",
"test:fisherman": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/fisherman/**.test.ts",
"test:fisherman:only": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/fisherman/**.test.ts",
"test:backend": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/backend/**.test.ts",
"test:backend:only": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/backend/**.test.ts",
"test:indexer": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/indexer/**.test.ts",
"test:indexer:only": "NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/indexer/**.test.ts"
"test:node:single": "cross-env-shell node --no-deprecation --import tsx --test --test-name-pattern=$FILTER ./suites/solo-node/**/**.test.ts",
"test:fisherman": "cross-env NODE_OPTIONS=--no-deprecation pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/fisherman/**.test.ts",
"test:fisherman:only": "cross-env NODE_OPTIONS=--no-deprecation pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/fisherman/**.test.ts",
"test:backend": "cross-env NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/backend/**.test.ts",
"test:backend:only": "cross-env NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/backend/**.test.ts",
"test:indexer": "cross-env NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test ./suites/integration/indexer/**.test.ts",
"test:indexer:only": "cross-env NODE_OPTIONS='--no-deprecation' pnpm tsx scripts/checkRunning.ts && node --no-deprecation --test-concurrency 1 --import tsx --test --test-only ./suites/integration/indexer/**.test.ts"
},
"keywords": [],
"author": "",
Expand Down Expand Up @@ -105,6 +105,7 @@
"@types/inquirer": "9.0.9",
"@types/json-bigint": "1.0.4",
"@types/node": "^24.3.0",
"typescript": "^5.9.2"
"typescript": "^5.9.2",
"cross-env": "7.0.3"
}
}
7 changes: 5 additions & 2 deletions test/suites/integration/solochain-evm/sdk-precompiles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { privateKeyToAccount } from "viem/accounts";
import { describeMspNet, type EnrichedBspApi, ShConsts } from "../../../util";
import { SH_EVM_SOLOCHAIN_CHAIN_ID } from "../../../util/evmNet/consts";
import { ALITH_PRIVATE_KEY } from "../../../util/evmNet/keyring";
import { fileURLToPath } from "node:url";


await describeMspNet(
"Solochain EVM SDK Precompiles Integration",
Expand Down Expand Up @@ -75,8 +77,9 @@ await describeMspNet(
});

// Set up the FileManager instance for the file to manipulate
const testFilePath = new URL("../../../../docker/resource/adolphus.jpg", import.meta.url)
.pathname;
const testFilePath = fileURLToPath(
new URL("../../../../docker/resource/adolphus.jpg", import.meta.url)
);
const testFileSize = statSync(testFilePath).size;
fileManager = new FileManager({
size: testFileSize,
Expand Down
5 changes: 2 additions & 3 deletions test/util/bspNet/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { addBspContainer, showContainers } from "./docker";
import type { EnrichedBspApi } from "./test-api.ts";

const exec = util.promisify(child_process.exec);
const execFileAsync = util.promisify(child_process.execFile);

export const getContainerIp = async (containerName: string, verbose = false): Promise<string> => {
const maxRetries = 60;
Expand All @@ -27,9 +28,7 @@ export const getContainerIp = async (containerName: string, verbose = false): Pr

// TODO: Replace with dockerode command
try {
const { stdout } = await exec(
`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${containerName}`
);
const { stdout } = await execFileAsync("docker", ["inspect", "-f", "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}", containerName]);
return stdout.trim();
} catch {
await sleep(sleepTime);
Expand Down