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

Incorrect message name found when generate the messages.proto #18

Closed
quesalltime opened this issue Jun 21, 2018 · 1 comment
Closed

Comments

@quesalltime
Copy link
Contributor

quesalltime commented Jun 21, 2018

While generate the messages.proto , the message name of the return value for smart contract's constant function is incorrect.

For example ,there is a smart contract contain a constant getName function which has no input parameter and return a string.
After convert the .sol file to the .proto files ,it will generate an unexpected GetNameReq message instead of generating GetNameResp message in the messages.proto.

# function in smart contract
function getName() public constant returns (string) {
      return name;
}
# After execute sol2proto , the expected message name in messages.proto
message GetNameResp { 
    string arg = 1;
}
# After execute sol2proto , the actual message name in messages.proto currently
message GetNameReq {
    string arg = 1;
}

After tracing the code , it seems to be a typo at line 59 in the grpc/method.go
I suppose the method.RequestName() should be replaced with method.ResponseName().

The corresponding PR is here #17

@alanchchen
Copy link
Contributor

Hi @quesalltime
It's a bug, thanks !
Merged.

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

2 participants