File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ export default class BaseApp {
46
46
this . REQUIRED_PATH_LENGTHS = params . acceptedPathLengths
47
47
}
48
48
49
+ serializePath ( path : string ) : Buffer {
50
+ return serializePath ( path , this . REQUIRED_PATH_LENGTHS )
51
+ }
52
+
49
53
/**
50
54
* Prepares chunks of data to be sent to the device.
51
55
* @param path - The derivation path.
@@ -54,7 +58,7 @@ export default class BaseApp {
54
58
*/
55
59
prepareChunks ( path : string , message : Buffer ) : Buffer [ ] {
56
60
const chunks = [ ]
57
- const serializedPathBuffer = serializePath ( path , this . REQUIRED_PATH_LENGTHS )
61
+ const serializedPathBuffer = this . serializePath ( path )
58
62
59
63
// First chunk (only path)
60
64
chunks . push ( serializedPathBuffer )
@@ -150,10 +154,7 @@ export default class BaseApp {
150
154
const formatId = response . readBytes ( 1 ) . readUInt8 ( )
151
155
152
156
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' )
157
158
}
158
159
159
160
const appNameLen = response . readBytes ( 1 ) . readUInt8 ( )
You can’t perform that action at this time.
0 commit comments