Skip to content

Comments

add slashing adversarial scenarios and fix hardhat setup#38

Open
Cedarich wants to merge 1 commit intoDigiNodes:mainfrom
Cedarich:feat/slashing-adversarial-tests
Open

add slashing adversarial scenarios and fix hardhat setup#38
Cedarich wants to merge 1 commit intoDigiNodes:mainfrom
Cedarich:feat/slashing-adversarial-tests

Conversation

@Cedarich
Copy link

  • Summary

  • Add adversarial and edge‑case tests for TruthBountyWeighted and VerifierSlashing.

  • Fix TypeScript diagnostics in test files by loosening contract typings and using proper Hardhat chai helpers.

  • Align Hardhat/toolbox configuration so the test suite runs cleanly.

  • Changes

  • test/TruthBountyWeighted.test.ts

    • Add tests for loser slashing on withdrawal, double‑withdraw prevention, locked‑stake withdrawal, and non‑voter withdrawal.
    • Fix event assertions to use anyValue from @nomicfoundation/hardhat-chai-matchers/withArgs .
    • Relax contract types to avoid BaseContract method errors and fix bigint arithmetic typings.
  • test/VerifierSlashing.test.ts

    • Add adversarial scenarios: multiple partial slashes over time, cooldown enforced across multiple settlement addresses, slashing + withdraw interaction, and batch slashing with a zero‑stake verifier.
    • Relax contract instance typings to avoid BaseContract method errors and remove unused variables.
  • package.json

    • Set devDependencies to hardhat@^2.28.0 and @nomicfoundation/hardhat-toolbox@^6.1.0 .
    • Set "type": "commonjs" to resolve Hardhat HH19 ESM config issues.
  • Testing

  • npm.cmd run test

    • All Hardhat tests pas

close issue #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants