@onekeyfe/hd-transport 1.2.8-alpha.132 → 1.2.8-alpha.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,6 +71,24 @@ describe('transport log sanitization', () => {
71
71
  ).toBe('[REDACTED]');
72
72
  });
73
73
 
74
+ test.each(['V1', 'V2'])('redacts BTC message signing protocol logs for %s', protocol => {
75
+ const request = { message: 'synthetic-message-marker', coin_name: 'Bitcoin' };
76
+ const response = {
77
+ signature: 'synthetic-signature-marker',
78
+ address: 'synthetic-address-marker',
79
+ };
80
+ const originals = JSON.stringify([request, response]);
81
+
82
+ expect(createTransportCallLog('SignMessage', protocol, request)).toEqual({
83
+ name: 'SignMessage',
84
+ protocol,
85
+ request: '[REDACTED]',
86
+ });
87
+ expect(getSafeTransportLogPayload(request, 'SignMessage')).toBe('[REDACTED]');
88
+ expect(getSafeTransportLogPayload(response, 'MessageSignature')).toBe('[REDACTED]');
89
+ expect(JSON.stringify([request, response])).toBe(originals);
90
+ });
91
+
74
92
  test('replaces binary content with its byte length', () => {
75
93
  expect(
76
94
  getSafeTransportLogPayload({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-transport",
3
- "version": "1.2.8-alpha.132",
3
+ "version": "1.2.8-alpha.133",
4
4
  "description": "Transport layer abstractions and utilities for OneKey hardware SDK.",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -28,5 +28,5 @@
28
28
  "long": "^4.0.0",
29
29
  "protobufjs": "^6.11.2"
30
30
  },
31
- "gitHead": "b8eef508535a14385e67317042fe187dc9b5f660"
31
+ "gitHead": "c859b88e03cf7a80e3168ab048fd1af6cb286af6"
32
32
  }