Skip to content

Multisig delegation Doer-level, Python integration tests#1334

Open
kentbull wants to merge 4 commits intoWebOfTrust:v1.2.12from
kentbull:multisig-delegation-integration-tests-v1.2.12
Open

Multisig delegation Doer-level, Python integration tests#1334
kentbull wants to merge 4 commits intoWebOfTrust:v1.2.12from
kentbull:multisig-delegation-integration-tests-v1.2.12

Conversation

@kentbull
Copy link
Copy Markdown
Contributor

@kentbull kentbull commented Mar 16, 2026

Tests for multisig delegation that test the delegation fixes and new delegator AES seal saving logic.

Adds the following:

Tests

Tests:

  • test_multisig_delegate: tests from 2 delegators to 2 delegates. Asserts on both delegator and delegate key state following successful delegation.
    • Uses all the test doers, context classes, context managers, and helper functions below.

Test fixtures, Doers, and context managers

tests/app/integration/app_helpers.py:

Test-only Doers:

  • EscrowDoer: handles Kevery and Counselor escrows
  • MultisigInceptLeader: Used by the delegatee initiator of delegated multisig inception for group AIDs with 2+ members.
  • MultisigInceptFollower: Used by the delegatee non-initiator group members of delegated group AIDs with 2+ members.
  • MultisigDelegationApprover: Used by the delegator group members to approve delegation requests automatically as they arrive. This completes delegation from the delegator's side.
  • KeystateQueryDoer: Used by the delegatee group members to discover the AES seal approving delegation from the delegator's KEL. This completes delegation from the delegatee's side. May also be used by the delegator to discover delegatee key state following approval.

Context classes:

  • ControllerContext: basically what Doers the KLI spins up when you need to use a controller, like for kli incept or similar.
  • WitnessContext: Doers needed to run a witness, and the ability to configure ports per witness context.

Context Managers

  • openWit: context manager for a witness. Returns a WitnessContext.
  • openCtrlWited: context manager for a controller that uses a witness as its mailbox and its single backer.

Helper Functions:

  • HabHelpers
    • generateOobi: equivalent of kli oobi generate used to generate OOBIs for controllers and witnesses
    • resolveOobi: equivalent of kli oobi resolve used to resolve OOBIs between components
    • collectWitnessReceipts: used from the controller's perspective to wait for witness receipts to arrive for a given event
    • hasDelegables: used by the delegator to wait for delegation approval requests to arrive
    • delegationSeal: constructor function for a delegation seal
    • clearSentCue: used to clean up Postman cues to keep tests deterministic and isolated

@kentbull kentbull requested a review from m00sey March 16, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant