Repository navigation
api: ContractAllMethodsGet reports the annotations of methods and arguments - #164
Merged
Merged
Conversation
…uments The executor returns every method with its annotations (@Getter, @UsingContract, @contractaddress, @ContractMethod and the others), but ContractAllMethodsGet copied only the name, return type and argument names and types, so a client could not tell a getter from a method that changes the state. The annotations of the methods and of their arguments now reach the client, in the fields the IDL already has (general.MethodDescription.annotations, MethodArgument.annotations). ci: contracts.py compiles samples/contracts/Counter.java and checks that ContractAllMethodsGet marks its three getters, and only them, with @Getter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With executor_ref (mixed executors), contracts.py compiles a source with two errors on the even nodes and prints what SmartContractCompile returns: the compiler's errors with their line numbers once the executor has CreditsCommunity/contract-executor#13. Reported only; nodes running the release executor are left out, as its failure makes the node reopen its executor connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tations # Conflicts: # ci/testnet/contracts.py # docs/CHANGES.md
EnzinoBB
added a commit
that referenced
this pull request
Nov 4, 2026
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
ContractAllMethodsGetasks the executor for a contract's methods and copies only the name, the return type and each argument's type and name. The executor also returns the annotations of every method and argument (@Getter,@UsingContract,@ContractAddress,@ContractMethod, ...), but the node drops them, so a client such as the community wallet cannot tell a getter it may run for free from a method that changes the state.Change
api/src/apihandler.cpp,ContractAllMethodsGet: copyMethodDescription.annotationsandMethodArgument.annotationsfrom the executor's answer.general.thriftalready hasannotationson bothMethodDescription(field 4) andMethodArgument(field 3), the same struct the executor returns. Clients built from the current IDL simply see the lists filled instead of empty.ContractMethodsGet(address)is declared in the IDL but not implemented by the node (it falls back toAPINulland returns an empty result), so it has nothing to pass on; it is left as is.Test
ci/testnet/contracts.pycompilessamples/contracts/Counter.javathrough node 1 and checks thatContractAllMethodsGetmarksgetValue,getNoteandgetOwnerwithcom.credits.scapi.annotations.Getter, and notincrement,addorsetNote. Node 1 always runs the node under test, so the check holds withnode_alt_ref=officialon the even nodes too.API only: no consensus, validation or stored data is touched.
🤖 Generated with Claude Code