Skip to content

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

@popzxc

Description

@popzxc

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions