File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414 getIsKrsRecovery ,
1515 getIsUnsignedSweep ,
1616 KeyPair ,
17+ KeyIndices ,
1718 MethodNotImplementedError ,
1819 ParsedTransaction ,
1920 ParseTransactionOptions ,
@@ -284,11 +285,9 @@ export class Trx extends BaseCoin {
284285 throw new Error ( `Invalid address: ${ address } ` ) ;
285286 }
286287
287- const userPub = keychains && keychains . length > 0 ? keychains [ 0 ] . pub : undefined ;
288- const bitgoPub = keychains && keychains . length > 2 ? keychains [ 2 ] . pub : undefined ;
289-
290288 // Root address verification (Index 0)
291289 if ( index === 0 ) {
290+ const bitgoPub = keychains && keychains . length > KeyIndices . BITGO ? keychains [ KeyIndices . BITGO ] . pub : undefined ;
292291 if ( ! bitgoPub ) {
293292 throw new Error ( 'BitGo public key required for root address verification' ) ;
294293 }
@@ -297,6 +296,7 @@ export class Trx extends BaseCoin {
297296
298297 // Receive address verification (Index > 0)
299298 if ( index > 0 ) {
299+ const userPub = keychains && keychains . length > KeyIndices . USER ? keychains [ KeyIndices . USER ] . pub : undefined ;
300300 if ( ! userPub ) {
301301 throw new Error ( 'User public key required for receive address verification' ) ;
302302 }
You can’t perform that action at this time.
0 commit comments