genlayer 0.38.12 → 0.38.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/tests/smoke.test.ts +12 -30
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -20078,7 +20078,7 @@ var require_cli_table3 = __commonJS({
|
|
|
20078
20078
|
import { program } from "commander";
|
|
20079
20079
|
|
|
20080
20080
|
// package.json
|
|
20081
|
-
var version = "0.38.
|
|
20081
|
+
var version = "0.38.14";
|
|
20082
20082
|
var package_default = {
|
|
20083
20083
|
name: "genlayer",
|
|
20084
20084
|
version,
|
package/package.json
CHANGED
package/tests/smoke.test.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {describe, it, expect, beforeAll} from "vitest";
|
|
2
|
-
import {
|
|
2
|
+
import {execSync} from "child_process";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import {createClient, parseStakingAmount, formatStakingAmount} from "genlayer-js";
|
|
3
5
|
import {testnetAsimov, testnetBradbury} from "genlayer-js/chains";
|
|
4
6
|
import type {Address, GenLayerChain} from "genlayer-js/types";
|
|
5
|
-
|
|
7
|
+
|
|
8
|
+
const CLI = path.resolve(__dirname, "../dist/index.js");
|
|
6
9
|
|
|
7
10
|
const TIMEOUT = 30_000;
|
|
8
11
|
|
|
@@ -121,34 +124,13 @@ describe(`Testnet ${name} - CLI Staking Smoke Tests`, () => {
|
|
|
121
124
|
}
|
|
122
125
|
}, TIMEOUT);
|
|
123
126
|
|
|
124
|
-
it("
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
chain,
|
|
132
|
-
transport: http(rpcUrl, {
|
|
133
|
-
async fetchFn(url, init) {
|
|
134
|
-
if (init?.body) {
|
|
135
|
-
const body = JSON.parse(init.body as string);
|
|
136
|
-
if (body.id === 0) body.id = 1;
|
|
137
|
-
init = {...init, body: JSON.stringify(body)};
|
|
138
|
-
}
|
|
139
|
-
return fetch(url, init);
|
|
140
|
-
},
|
|
141
|
-
}),
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
const count = await publicClient.readContract({
|
|
145
|
-
address: stakingAddress as `0x${string}`,
|
|
146
|
-
abi: abi.STAKING_ABI,
|
|
147
|
-
functionName: "activeValidatorsCount",
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
expect(typeof count).toBe("bigint");
|
|
151
|
-
expect(count as bigint >= 0n).toBe(true);
|
|
127
|
+
it("CLI: genlayer staking validators lists validators", () => {
|
|
128
|
+
const output = execSync(
|
|
129
|
+
`node ${CLI} staking validators --network ${name === "Asimov" ? "testnet-asimov" : "testnet-bradbury"}`,
|
|
130
|
+
{encoding: "utf-8", timeout: TIMEOUT},
|
|
131
|
+
);
|
|
132
|
+
expect(output).toContain("active");
|
|
133
|
+
expect(output).toMatch(/Total: \d+ validators/);
|
|
152
134
|
}, TIMEOUT);
|
|
153
135
|
|
|
154
136
|
it("parseStakingAmount and formatStakingAmount round-trip", () => {
|