oasisprotocol / oasisprotocol/oasis-core

support zero-argument RPC methods

Open
#246 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

c:common p:2
Dominant language
Go
Stars
369
Forks
151
Avg merge
1d 3h
Merged PRs (30d)
6

Description

some contract methods do not require any parameters. We'd like the ability to define an api as follows:

contract_api! {
    pub fn do_something() -> bool;
}

Currently the contract api fails to compile if any method has zero arity. A temporary workaround is to specify the empty protobuf in the signature, but this is undesirable since it adds unnecessary code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the contract_api! entry point and inspect how method signatures with no parameters are handled. Confirm that a declaration such as do_something() -> bool compiles without an explicit empty protobuf, while preserving existing parameterized methods.

Written by the indexing model from the issue text.

Assessment

Domain
blockchain
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.