sol2proto icon indicating copy to clipboard operation
sol2proto copied to clipboard

Specify pkgnames for messages defined in pb/messages.proto

Open syucream opened this issue 7 years ago • 2 comments

When I tried examples in getamis/grpc-contract, I got below errors:

$ make run name=NameService
solc --bin --abi --optimize --overwrite -o . NameService.sol
mkdir -p contracts
sol2proto --pkg contracts --abi NameService.abi
mv *.proto contracts
protoc --go_out=plugins=grpc:./contracts -I contracts -I /Users/ryo/.go/src/ contracts/*.proto
messages.proto:18:5: "TransactOpts" is not defined.
make: *** [run] Error 1

It might be caused by missing specifying pk. package names so I want to add that.

syucream avatar May 13 '18 15:05 syucream

@markya0616 I've fixed conflict. Could you review this? 🙏

syucream avatar Jun 27 '18 15:06 syucream

Adding package name as prefix doesn't make sense. Consider a message defined in foo.proto, I think it will be

message FooReq {
    string arg1 = 1;
    pkg.TransactOpts opts = 2;
}

I want to avoid this case. I think the example in grpc-contract is broken. Have you tried the latest version of grpc-contract?

alanchchen avatar Jul 06 '18 03:07 alanchchen