Skip to content

Commit 979258b

Browse files
authored
correct missing method (#22)
1 parent 3d3ebc7 commit 979258b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/app.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export default class BaseApp {
4646
this.REQUIRED_PATH_LENGTHS = params.acceptedPathLengths
4747
}
4848

49+
serializePath(path: string): Buffer {
50+
return serializePath(path, this.REQUIRED_PATH_LENGTHS)
51+
}
52+
4953
/**
5054
* Prepares chunks of data to be sent to the device.
5155
* @param path - The derivation path.
@@ -54,7 +58,7 @@ export default class BaseApp {
5458
*/
5559
prepareChunks(path: string, message: Buffer): Buffer[] {
5660
const chunks = []
57-
const serializedPathBuffer = serializePath(path, this.REQUIRED_PATH_LENGTHS)
61+
const serializedPathBuffer = this.serializePath(path)
5862

5963
// First chunk (only path)
6064
chunks.push(serializedPathBuffer)
@@ -150,10 +154,7 @@ export default class BaseApp {
150154
const formatId = response.readBytes(1).readUInt8()
151155

152156
if (formatId !== 1) {
153-
throw {
154-
returnCode: 0x9001,
155-
errorMessage: 'Format ID not recognized',
156-
} as ResponseError
157+
throw new ResponseError(LedgerError.TechnicalProblem, 'Format ID not recognized')
157158
}
158159

159160
const appNameLen = response.readBytes(1).readUInt8()

0 commit comments

Comments
 (0)