1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-10 15:30:55 +00:00

workflow: allow more arguments to the import workflow

Allows to use stateful message handlers

```python
wire.add(MessageType.MoneroTransactionSign, __name__, "get_address", STATE)
```
This commit is contained in:
Dusan Klinec 2018-08-29 16:47:54 +02:00 committed by Jan Pochyla
parent b23077b707
commit 5b5b593eb3

View File

@ -165,11 +165,11 @@ async def protobuf_workflow(ctx, reader, handler, *args):
await ctx.write(res)
def import_workflow(ctx, req, pkgname, modname):
def import_workflow(ctx, req, pkgname, modname, *args):
modpath = "%s.%s" % (pkgname, modname)
module = __import__(modpath, None, None, (modname,), 0)
handler = getattr(module, modname)
return handler(ctx, req)
return handler(ctx, req, *args)
async def unexpected_msg(ctx, reader):