Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
GetContractRequestinOutboundDelegateMsg- allows delegates to request contract stateGetContractResponseinInboundDelegateMsg- delivers contract state back to delegatesThese follow the same pattern as
GetSecretRequest/GetSecretResponsefor consistency.Changes
GetContractRequestandGetContractResponsestructsOutboundDelegateMsgandInboundDelegateMsgenumsinto_owned,get_context,get_mut_context,processed)Testing
Fixes
Provides types needed for freenet/freenet-core#2828
[AI-assisted - Claude]