Skip to content

feat: add GetContractRequest and GetContractResponse for delegate contract access#47

Merged
sanity merged 1 commit intomainfrom
feat-delegate-contract-get
Feb 1, 2026
Merged

feat: add GetContractRequest and GetContractResponse for delegate contract access#47
sanity merged 1 commit intomainfrom
feat-delegate-contract-get

Conversation

@sanity
Copy link
Contributor

@sanity sanity commented Feb 1, 2026

Problem

Delegates are documented as being able to read contract state (see issue freenet/freenet-core#2827), but the message types to support this capability were not implemented.

Approach

Add the necessary message types for delegates to request and receive contract state:

  • GetContractRequest in OutboundDelegateMsg - allows delegates to request contract state
  • GetContractResponse in InboundDelegateMsg - delivers contract state back to delegates

These follow the same pattern as GetSecretRequest/GetSecretResponse for consistency.

Changes

  • Add GetContractRequest and GetContractResponse structs
  • Add variants to OutboundDelegateMsg and InboundDelegateMsg enums
  • Update helper methods (into_owned, get_context, get_mut_context, processed)
  • Add stub for serialization (GetContractRequest should be handled by executor, not serialized)

Testing

  • Compiles successfully
  • All existing tests pass

Fixes

Provides types needed for freenet/freenet-core#2828

[AI-assisted - Claude]

…tract access

Add message types to enable delegates to request and receive contract state:

- GetContractRequest: outbound message for delegates to request contract state
- GetContractResponse: inbound message containing the contract state response

These types support the delegate capability of reading contract state, allowing
delegates to interact with contracts they're interested in.

Closes freenet/freenet-core#2828

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sanity sanity enabled auto-merge (squash) February 1, 2026 01:34
@sanity sanity merged commit 40710b0 into main Feb 1, 2026
8 of 9 checks passed
@sanity sanity deleted the feat-delegate-contract-get branch February 1, 2026 01:35
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.

1 participant