@@ -27,14 +27,7 @@ import GenericApp, {
27
27
import { P2_VALUES , REDJUBJUB_SIGNATURE_LEN } from './consts'
28
28
import { deserializeDkgRound1 , deserializeDkgRound2 } from './deserialize'
29
29
import { processGetIdentityResponse , processGetKeysResponse } from './helper'
30
- import {
31
- serializeDkgGetCommitments ,
32
- serializeDkgGetNonces ,
33
- serializeDkgRound1 ,
34
- serializeDkgRound2 ,
35
- serializeDkgRound3 ,
36
- serializeDkgSign ,
37
- } from './serialize'
30
+ import { serializeDkgGetCommitments , serializeDkgRound1 , serializeDkgRound2 , serializeDkgRound3 , serializeDkgSign } from './serialize'
38
31
import {
39
32
IronfishIns ,
40
33
IronfishKeys ,
@@ -406,61 +399,8 @@ export default class IronfishApp extends GenericApp {
406
399
}
407
400
}
408
401
409
- async dkgGetNonces ( identities : string [ ] , tx_hash : string ) : Promise < ResponseDkgGetNonces > {
410
- const blob = serializeDkgGetNonces ( identities , tx_hash )
411
- const chunks = this . prepareChunks ( DUMMY_PATH , blob )
412
-
413
- try {
414
- let response = Buffer . alloc ( 0 )
415
- let returnCode = 0
416
- let errorCodeData = Buffer . alloc ( 0 )
417
- let errorMessage = ''
418
- try {
419
- response = await this . sendDkgChunk ( this . INS . DKG_GET_NONCES , 1 , chunks . length , chunks [ 0 ] )
420
- // console.log("resp 0 " + response.toString("hex"))
421
-
422
- errorCodeData = response . subarray ( - 2 )
423
- returnCode = errorCodeData [ 0 ] * 256 + errorCodeData [ 1 ]
424
- errorMessage = errorCodeToString ( returnCode )
425
- } catch ( e ) {
426
- // console.log(e)
427
- }
428
-
429
- for ( let i = 1 ; i < chunks . length ; i += 1 ) {
430
- // eslint-disable-next-line no-await-in-loop
431
- response = await this . sendDkgChunk ( this . INS . DKG_GET_NONCES , 1 + i , chunks . length , chunks [ i ] )
432
- // console.log("resp " + i + " " + response.toString("hex"))
433
-
434
- errorCodeData = response . subarray ( - 2 )
435
- returnCode = errorCodeData [ 0 ] * 256 + errorCodeData [ 1 ]
436
- errorMessage = errorCodeToString ( returnCode )
437
-
438
- // console.log("returnCode " + returnCode)
439
- if ( returnCode !== LedgerError . NoErrors ) {
440
- return {
441
- returnCode,
442
- errorMessage,
443
- }
444
- }
445
- }
446
-
447
- let { isError, responseResult, rawResponse } = this . checkResponseCode ( response )
448
- if ( isError ) return responseResult
449
-
450
- let result = await this . getResult ( rawResponse )
451
-
452
- return {
453
- returnCode : result . returnCode ,
454
- errorMessage : result . errorMessage ,
455
- nonces : result . data ,
456
- }
457
- } catch ( e ) {
458
- return processErrorResponse ( e )
459
- }
460
- }
461
-
462
- async dkgSign ( pkRandomness : string , frostSigningPackage : string , nonces : string ) : Promise < ResponseDkgSign > {
463
- const blob = serializeDkgSign ( pkRandomness , frostSigningPackage , nonces )
402
+ async dkgSign ( pkRandomness : string , frostSigningPackage : string , txHash : string ) : Promise < ResponseDkgSign > {
403
+ const blob = serializeDkgSign ( pkRandomness , frostSigningPackage , txHash )
464
404
const chunks = this . prepareChunks ( DUMMY_PATH , blob )
465
405
466
406
try {
0 commit comments