Skip to content

Commit 4b09307

Browse files
authored
Merge pull request #21 from Zondax/dev
New Release
2 parents 90e349a + 4c76b54 commit 4b09307

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,26 @@ import {
3838
} from './types'
3939

4040
export * from './types'
41+
export * from '@zondax/ledger-js/dist/responseError'
4142

4243
const DUMMY_PATH = "m/44'/1338'/0"
44+
const DKG_APP_CLA = 0x63
45+
const REGULAR_APP_CLA = 0x59
4346

4447
export default class IronfishApp extends GenericApp {
4548
readonly INS!: IronfishIns
4649
constructor(transport: Transport, dkgMode?: boolean) {
4750
if (transport == null) throw new Error('Transport has not been defined')
4851

4952
const params: ConstructorParams = {
50-
cla: dkgMode ? 0x63 : 0x59,
53+
cla: dkgMode ? DKG_APP_CLA : REGULAR_APP_CLA,
5154
ins: {
55+
// Common instructions
5256
GET_VERSION: 0x00,
57+
// Regulars app instructions
5358
GET_KEYS: 0x01,
5459
SIGN: 0x02,
55-
//DKG Instructions
60+
// DKG app instructions
5661
DKG_IDENTITY: 0x10,
5762
DKG_ROUND_1: 0x11,
5863
DKG_ROUND_2: 0x12,

src/serialize.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export const serializeDkgRound1 = (index: number, identities: string[], minSigners: number): Buffer => {
22
let blob = Buffer.alloc(1 + 1 + identities.length * 129 + 1)
3-
console.log(`dkgRound1 msg size: ${blob.byteLength}`)
43

54
blob.writeUint8(index)
65
blob.writeUint8(identities.length, 1)
@@ -17,7 +16,6 @@ export const serializeDkgRound2 = (index: number, round1PublicPackages: string[]
1716
let round1SecretPackageLen = round1SecretPackage.length / 2
1817

1918
let blob = Buffer.alloc(1 + 1 + 2 + round1PublicPackages.length * round1PublicPackagesLen + 2 + round1SecretPackageLen)
20-
console.log(`dkgRound2 msg size: ${blob.byteLength}`)
2119

2220
let pos = 0
2321

@@ -73,7 +71,6 @@ export const serializeDkgRound3Min = (
7371
2 +
7472
gskBytes.length * gskLen
7573
)
76-
console.log(`dkgRound3 msg size: ${blob.byteLength}`)
7774

7875
let pos = 0
7976

@@ -146,7 +143,6 @@ export const serializeDkgRound3Min = (
146143

147144
export const serializeDkgGetCommitments = (tx_hash: string): Buffer => {
148145
let blob = Buffer.alloc(32)
149-
console.log(`dkgGetCommitment msg size: ${blob.byteLength}`)
150146

151147
blob.fill(Buffer.from(tx_hash, 'hex'), 0)
152148

@@ -159,7 +155,6 @@ export const serializeDkgSign = (pkRandomness: string, frostSigningPackage: stri
159155
let txHashLen = 32
160156

161157
let blob = Buffer.alloc(2 + pkRandomnessLen + 2 + frostSigningPackageLen + txHashLen)
162-
console.log(`dkgSign msg size: ${blob.byteLength}`)
163158

164159
let pos = 0
165160

0 commit comments

Comments
 (0)