Skip to content

Commit e411bb8

Browse files
Fix build breaks in Node implementation (#215)
Signed-off-by: Mark S. Lewis <[email protected]>
1 parent f0fa97f commit e411bb8

File tree

5 files changed

+4028
-13
lines changed

5 files changed

+4028
-13
lines changed

ts/formatter/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
lib/*.js
1+
lib/*.js
2+
dist/
3+
node_modules/

ts/formatter/lib/pretty-parser.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ export class BlockDecoder {
1717
}
1818

1919
header() {
20-
const {header} = this.block.toObject();
21-
const {number, previousHash, dataHash} = header;
20+
const header = this.block.getHeader();
21+
const previousHash = header.getPreviousHash_asU8();
22+
const dataHash = header.getDataHash_asU8();
2223

2324
return {
24-
number,
25+
number: header.getNumber(),
2526
previousHash: Buffer.from(previousHash).toString('hex'),
2627
dataHash: Buffer.from(dataHash).toString('hex')
2728
};

ts/formatter/lib/proto/common-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ export function identity(bytes: Uint8Array) {
1616
const _ = SerializedIdentity.deserializeBinary(bytes)
1717
return {
1818
mspid: _.getMspid(),
19-
idBytes: Buffer.from(_.getIdBytes()).toString()
19+
idBytes: Buffer.from(_.getIdBytes_asU8()).toString()
2020
}
21-
}
21+
}

0 commit comments

Comments
 (0)