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

Service protobuf modules aren't able to use main protobuf modules. #19

Open
popzxc opened this issue Aug 28, 2019 · 0 comments
Open

Service protobuf modules aren't able to use main protobuf modules. #19

popzxc opened this issue Aug 28, 2019 · 0 comments
Assignees

Comments

@popzxc
Copy link
Contributor

popzxc commented Aug 28, 2019

If you'll try to do the following:

cryptocurrency_module = ModuleManager.import_service_module(cryptocurrency_service_name, 'service')
helpers_module = ModuleManager.import_main_module('helpers')

transfer_1 = cryptocurrency_module.Transfer()
transfer_1.to.CopyFrom(helpers_module.PublicKey(data=some_public_key))

You'll get an exception, because cryptocurrency_module won't recognize helpers from main.

Instead you should do the following:

cryptocurrency_module = ModuleManager.import_service_module(cryptocurrency_service_name, 'service')
helpers_module = ModuleManager.import_service_module(cryptocurrency_service_name, 'helpers')

transfer_1 = cryptocurrency_module.Transfer()
transfer_1.to.CopyFrom(helpers_module.PublicKey(data=some_public_key))

Then everything works like a charm.

However, reasons for such a behavior should be investigated and, if possible, fixed.

@popzxc popzxc self-assigned this Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant