From fa7ff3b0025cc3cbeaf61c0f0c8834bb09ab79f9 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Thu, 24 Oct 2024 12:38:42 +0200 Subject: [PATCH] feat(transport): load protobuf definitions --- packages/transport/src/transports/abstract.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/transport/src/transports/abstract.ts b/packages/transport/src/transports/abstract.ts index 6b869e28c69..0f652576f01 100644 --- a/packages/transport/src/transports/abstract.ts +++ b/packages/transport/src/transports/abstract.ts @@ -7,7 +7,7 @@ import { TransportProtocolState, thp as protocolThp, } from '@trezor/protocol'; -import { MessageFromTrezor as ProtobufMessageType } from '@trezor/protobuf'; +import { MessageFromTrezor as ProtobufMessageType, loadDefinitions } from '@trezor/protobuf'; import { Session, @@ -355,6 +355,10 @@ export abstract class AbstractTransport extends TransportEmitter { this.messages = protobuf.Root.fromJSON(messages); } + public loadMessages(packageName: string, packageLoader: Parameters[2]) { + return loadDefinitions(this.messages, packageName, packageLoader); + } + protected success(payload: T): Success { return success(payload); }