diff --git a/.changeset/khaki-humans-rush.md b/.changeset/khaki-humans-rush.md deleted file mode 100644 index 4b31c6be..00000000 --- a/.changeset/khaki-humans-rush.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nilfoundation/niljs": minor ---- - -fix number to hex in integration tests diff --git a/.changeset/loud-phones-happen.md b/.changeset/loud-phones-happen.md deleted file mode 100644 index 5e004c61..00000000 --- a/.changeset/loud-phones-happen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nilfoundation/niljs": minor ---- - -Breaking changes! Fee credit instead of gas diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index cbce2a8e..11cc2300 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -10,9 +10,9 @@ runs: - name: Npm audit shell: bash run: npm audit --audit-level=moderate - # - name: Test - # shell: bash - # run: npm run test:ci + - name: Test + shell: bash + run: npm run test:ci - name: Build shell: bash run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index a81744f6..1f547d4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # niljs +## 0.11.0 + +### Minor Changes + +- [#97](https://github.com/NilFoundation/nil.js/pull/97) [`7d2ac80`](https://github.com/NilFoundation/nil.js/commit/7d2ac80d5ed1822e1633d498b761f65694aa5f48) Thanks [@KlonD90](https://github.com/KlonD90)! - fix number to hex in integration tests + +- [#98](https://github.com/NilFoundation/nil.js/pull/98) [`6945f6c`](https://github.com/NilFoundation/nil.js/commit/6945f6c1dc3ffe8afd4fccfd273afa55706ec6f0) Thanks [@shermike](https://github.com/shermike)! - Breaking changes! Fee credit instead of gas + ## 0.10.1 ### Patch Changes diff --git a/package.json b/package.json index 15ac8c89..cc78ab0d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nilfoundation/niljs", "author": "=nil; Foundation", - "version": "0.10.1", + "version": "0.11.0", "repository": { "type": "git", "url": "git+https://github.com/NilFoundation/nil.js.git" @@ -28,9 +28,9 @@ "sideEffects": false, "description": "Typescript library to interact with the Nil blockchain. Can be used in the browser or in Node.js.", "scripts": { - "test": "vitest -c ./test/vitest.config.ts", + "test:unit": "vitest -c ./test/vitest.config.ts", "test:ci": "CI=true vitest -c ./test/vitest.config.ts", - "integration-test": "CI=true vitest -c ./test/vitest.integration.config.ts --isolate false", + "test:integration": "CI=true vitest -c ./test/vitest.integration.config.ts --isolate false", "test:coverage": "npm run test:ci -- --coverage", "build": "rimraf dist && rollup -c ./rollup/rollup.config.js --bundleConfigAsCjs", "prepare": "npx simple-git-hooks", diff --git a/src/encoding/fromBytes.ts b/src/encoding/fromBytes.ts index ac2e5be9..382ab68e 100644 --- a/src/encoding/fromBytes.ts +++ b/src/encoding/fromBytes.ts @@ -1,4 +1,5 @@ -import { type Hex, toHex } from "../index.js"; +import type { Hex } from "../index.js"; +import { toHex } from "./toHex.js"; const decoder = new TextDecoder("utf8"); diff --git a/src/integrations/bounce.test.ts b/test/integration/bounce.test.ts similarity index 96% rename from src/integrations/bounce.test.ts rename to test/integration/bounce.test.ts index 4094f700..c94e9732 100644 --- a/src/integrations/bounce.test.ts +++ b/test/integration/bounce.test.ts @@ -1,5 +1,4 @@ import { bytesToHex, encodeFunctionData } from "viem"; -import { testEnv } from "../../test/testEnv.js"; import { Faucet, HttpTransport, @@ -9,7 +8,8 @@ import { convertEthToWei, generateRandomPrivateKey, waitTillCompleted, -} from "../index.js"; +} from "../../src/index.js"; +import { testEnv } from "../testEnv.js"; const client = new PublicClient({ transport: new HttpTransport({ endpoint: testEnv.endpoint, diff --git a/src/integrations/calling.test.ts b/test/integration/calling.test.ts similarity index 97% rename from src/integrations/calling.test.ts rename to test/integration/calling.test.ts index 32afb807..0cc0238f 100644 --- a/src/integrations/calling.test.ts +++ b/test/integration/calling.test.ts @@ -1,4 +1,3 @@ -import { testEnv } from "../../test/testEnv.js"; import { Faucet, HttpTransport, @@ -9,7 +8,8 @@ import { convertEthToWei, generateRandomPrivateKey, waitTillCompleted, -} from "../index.js"; +} from "../../src/index.js"; +import { testEnv } from "../testEnv.js"; const client = new PublicClient({ transport: new HttpTransport({ endpoint: testEnv.endpoint, diff --git a/src/integrations/deploy.test.ts b/test/integration/deploy.test.ts similarity index 98% rename from src/integrations/deploy.test.ts rename to test/integration/deploy.test.ts index b78a64fd..2b357f5c 100644 --- a/src/integrations/deploy.test.ts +++ b/test/integration/deploy.test.ts @@ -1,5 +1,4 @@ import type { Abi } from "abitype"; -import { testEnv } from "../../test/testEnv.js"; import { Faucet, HttpTransport, @@ -11,7 +10,8 @@ import { externalDeploymentMessage, generateRandomPrivateKey, waitTillCompleted, -} from "../index.js"; +} from "../../src/index.js"; +import { testEnv } from "../testEnv.js"; const client = new PublicClient({ transport: new HttpTransport({ endpoint: testEnv.endpoint, diff --git a/src/integrations/receipt.test.ts b/test/integration/receipt.test.ts similarity index 83% rename from src/integrations/receipt.test.ts rename to test/integration/receipt.test.ts index 0c255993..f7487bfc 100644 --- a/src/integrations/receipt.test.ts +++ b/test/integration/receipt.test.ts @@ -1,13 +1,14 @@ -import { testEnv } from "../../test/testEnv.js"; -import { Faucet, WalletV1 } from "../contracts/index.js"; import { + Faucet, HttpTransport, + LocalECDSAKeySigner, PublicClient, + WalletV1, convertEthToWei, + generateRandomPrivateKey, waitTillCompleted, -} from "../index.js"; -import { LocalECDSAKeySigner } from "../signers/LocalECDSAKeySigner.js"; -import { generateRandomPrivateKey } from "../signers/privateKey.js"; +} from "../../src/index.js"; +import { testEnv } from "../../test/testEnv.js"; const client = new PublicClient({ transport: new HttpTransport({ diff --git a/src/integrations/tokens.test.ts b/test/integration/tokens.test.ts similarity index 97% rename from src/integrations/tokens.test.ts rename to test/integration/tokens.test.ts index 96a6473f..402b570a 100644 --- a/src/integrations/tokens.test.ts +++ b/test/integration/tokens.test.ts @@ -1,5 +1,4 @@ import { encodeFunctionData } from "viem"; -import { testEnv } from "../../test/testEnv.js"; import { Faucet, HttpTransport, @@ -14,7 +13,8 @@ import { hexToBigInt, toHex, waitTillCompleted, -} from "../index.js"; +} from "../../src/index.js"; +import { testEnv } from "../testEnv.js"; const client = new PublicClient({ transport: new HttpTransport({ endpoint: testEnv.endpoint, diff --git a/test/testEnv.ts b/test/testEnv.ts index 9ef7e355..653df964 100644 --- a/test/testEnv.ts +++ b/test/testEnv.ts @@ -1,9 +1,6 @@ const defaultRpcEndpoint = "http://127.0.0.1:8529"; -const defaultPrivateKey = - "41285f03e8692676bf80a98e4052a008026427a7302ca97cb06edcd60689850b"; const testEnv = { - localPrivKey: process.env.LOCAL_PRIV_KEY ?? defaultPrivateKey, endpoint: process.env.RPC_ENDPOINT ?? defaultRpcEndpoint, } as const; diff --git a/test/vitest.integration.config.ts b/test/vitest.integration.config.ts index 0a7578d6..79d0d74a 100644 --- a/test/vitest.integration.config.ts +++ b/test/vitest.integration.config.ts @@ -4,7 +4,7 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { environment: "node", - include: ["src/integrations/*.test.ts"], + include: ["test/integration/*.test.ts"], hookTimeout: 20_000, testTimeout: 40_000, globals: true,