Skip to content

contracts: test CapacityBond.reclaimNodeId #2940

Closed as not planned
Closed as not planned

Description

@thiras

Summary

CapacityBond.reclaimNodeId has no test in contracts/test or in crates/. The exit path relies on it: the declareMbps NatSpec names "displaced by reclaimNodeId" as a state that declareMbps(0) + unbond must release (#2938).

Tests to add (contracts/test/CapacityBond.t.sol)

  • Happy path.
    • Onboard an operator at tier 1000.
    • A second caller that holds the node's Ed25519 key calls reclaimNodeId.
    • Assert that NodeDeregistered and NodeIdReclaimed are emitted.
    • Assert that the operator leaves the registered set.
    • Assert that nodeIdToAddress and addressToNodeId are cleared and registrationNonce is bumped.
  • Displaced exit. The displaced operator runs declareMbps(0), then unbond(activeBond), and activeBond reaches 0.
  • Negatives. NodeIdNotBound and InvalidEd25519Signature.

Found by the test-coverage review of #2938. The gap predates that PR.

🤖 Generated with Claude Code

Activity

  1. added
    kind:test
    area:contracts
    on Nov 22, 2026
  2. alpergundogdu commented on Nov 23, 2026

    @alpergundogdu
    Contributor

    Closing as not planned: CapacityBond is being replaced by a registry without a bond. The reclaimNodeId cases listed here (happy path, NodeIdNotBound, InvalidEd25519Signature) move into the new registry issue's tests; the bond-exit case no longer applies.


    Generated by Claude Code

  3. moved this from Backlog to Done in deCDNon Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:contractskind:test

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions