Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code generator: return statement in void method #5

Closed
kabl opened this issue Oct 28, 2016 · 0 comments
Closed

Code generator: return statement in void method #5

kabl opened this issue Oct 28, 2016 · 0 comments

Comments

@kabl
Copy link

kabl commented Oct 28, 2016

The code generator generates following code:

  public void setGreeting(Utf8String s) throws InterruptedException, ExecutionException {
    Function function = new Function<>("setGreeting", Arrays.asList(s), Collections.emptyList());
    return executeSingleValueReturn(function);
  }

The return statement is not allowed.

Contract

contract hello {
    string greeting;

    function setGreeting(string s){
        greeting = s;
    }

    function getGreeting() constant returns (string s){
        s = greeting;
    }

    function killMe(){
        suicide(msg.sender);
    }
}

ABI

[{
        "constant": false,
        "inputs": [{
                "name": "s",
                "type": "string"
            }],
        "name": "setGreeting",
        "outputs": [],
        "payable": false,
        "type": "function"
    }, {
        "constant": false,
        "inputs": [],
        "name": "killMe",
        "outputs": [],
        "payable": false,
        "type": "function"
    }, {
        "constant": true,
        "inputs": [],
        "name": "getGreeting",
        "outputs": [{
                "name": "s",
                "type": "string"
            }],
        "payable": false,
        "type": "function"
    }]

Thanks for checking this.

@kabl kabl closed this as completed Oct 28, 2016
RobertoArtiles added a commit to RobertoArtiles/web3j that referenced this issue May 23, 2022
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

No branches or pull requests

1 participant