Skip to content

Commit

Permalink
feat(transport): load protobuf definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonlesisz committed Dec 12, 2024
1 parent ea65a43 commit fa7ff3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/transport/src/transports/abstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -355,6 +355,10 @@ export abstract class AbstractTransport extends TransportEmitter {
this.messages = protobuf.Root.fromJSON(messages);
}

public loadMessages(packageName: string, packageLoader: Parameters<typeof loadDefinitions>[2]) {
return loadDefinitions(this.messages, packageName, packageLoader);
}

protected success<T>(payload: T): Success<T> {
return success(payload);
}
Expand Down

0 comments on commit fa7ff3b

Please sign in to comment.