Some checks failed
contracts-ci / Install (lockfile) → compile → full test suite (push) Has been cancelled
contracts-ci / Ethereum interop (EIP-2537 BLS, prague hardfork) (push) Has been cancelled
contracts-ci / PQC known-answer tests (NIST vectors) (push) Has been cancelled
contracts-ci / Coverage (scoped, with artifacts) (push) Has been cancelled
The published line and the local line had no common ancestor: the public one carried the redaction pass, the local one carried three weeks of corrections that never shipped. This commit ports the local work onto the public line, keeps every public redaction, and extends the same discretion to seven client mentions that were still named in published comments. Carried: LICENSE year and LICENSING.md; the measured burn figures replacing the deflation claim (the vault holds ~0.137 AERE of 2.8 billion, and burn is a share of validator coinbase revenue, which is zero today); 'audited' removed from next to Bouncy Castle; citation paths rewritten to published form with CITATIONS-UNRESOLVED.md remeasured 2026-08-11; VERIFY-POLICY.md; slashing and ownership comments brought down to what the code does; the AerePyth repair; the shutter test helper the tests cite; runnable package.json entries; the CI file split into a GitHub/Gitea twin pair with a real measured test-run status; and the .gitignore hardening written after a compiled artifact leaked a local path in a sibling repository. A false '2-of-3 multisig' description of the owner account is corrected to what the chain measures: an externally owned account. The self-audit findings catalog stays unpublished pending an explicit decision.
59 lines
2.2 KiB
JavaScript
59 lines
2.2 KiB
JavaScript
const { expect } = require("chai");
|
|
const { ethers } = require("hardhat");
|
|
|
|
describe("AereValidatorManifest", () => {
|
|
let val1, val2, ds;
|
|
const DIGEST_A = ethers.keccak256(ethers.toUtf8Bytes("aere-besu-reproducible-A"));
|
|
const DIGEST_B = ethers.keccak256(ethers.toUtf8Bytes("aere-besu-reproducible-B"));
|
|
|
|
beforeEach(async () => {
|
|
[val1, val2] = await ethers.getSigners();
|
|
const F = await ethers.getContractFactory("AereValidatorManifest");
|
|
ds = await F.deploy();
|
|
await ds.waitForDeployment();
|
|
});
|
|
|
|
it("a validator declares + we read back", async () => {
|
|
await expect(
|
|
ds.connect(val1).declare(
|
|
DIGEST_A,
|
|
"https://aere.network/.well-known/besu-image-digest",
|
|
"AERE Foundation",
|
|
"EU-Central / DE"
|
|
)
|
|
).to.emit(ds, "CommitmentDeclared");
|
|
const c = await ds.commitmentOf(val1.address);
|
|
expect(c.binaryDigest).to.equal(DIGEST_A);
|
|
expect(c.operatorLabel).to.equal("AERE Foundation");
|
|
expect(c.serial).to.equal(1n);
|
|
expect(await ds.isDeclared(val1.address)).to.equal(true);
|
|
});
|
|
|
|
it("rejects malformed declarations", async () => {
|
|
await expect(
|
|
ds.connect(val1).declare(ethers.ZeroHash, "u", "l", "r")
|
|
).to.be.revertedWithCustomError(ds, "ZeroDigest");
|
|
await expect(
|
|
ds.connect(val1).declare(DIGEST_A, "", "l", "r")
|
|
).to.be.revertedWithCustomError(ds, "EmptyManifestUri");
|
|
await expect(
|
|
ds.connect(val1).declare(DIGEST_A, "u", "", "r")
|
|
).to.be.revertedWithCustomError(ds, "EmptyOperatorLabel");
|
|
});
|
|
|
|
it("overwriting bumps serial; serials are per-validator", async () => {
|
|
await ds.connect(val1).declare(DIGEST_A, "u", "l", "r");
|
|
await ds.connect(val1).declare(DIGEST_B, "u", "l", "r");
|
|
expect((await ds.commitmentOf(val1.address)).serial).to.equal(2n);
|
|
expect((await ds.commitmentOf(val1.address)).binaryDigest).to.equal(DIGEST_B);
|
|
|
|
await ds.connect(val2).declare(DIGEST_A, "u", "l", "r");
|
|
expect((await ds.commitmentOf(val2.address)).serial).to.equal(1n);
|
|
});
|
|
|
|
it("validators write only their own slot", async () => {
|
|
await ds.connect(val1).declare(DIGEST_A, "u", "l", "r");
|
|
expect(await ds.isDeclared(val2.address)).to.equal(false);
|
|
});
|
|
});
|