@leofcoin/messages 1.4.0 → 1.4.2

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.
package/exports/block.js CHANGED
@@ -12,7 +12,8 @@ var proto = {
12
12
  reward: BigNumber.from(0),
13
13
  fees: BigNumber.from(0),
14
14
  transactions: new Uint8Array(),
15
- validators: new Uint8Array()
15
+ validators: new Uint8Array(),
16
+ 'hash?': String()
16
17
  };
17
18
 
18
19
  class BlockMessage extends FormatInterface {
package/exports/index.js CHANGED
@@ -15,12 +15,9 @@ var proto = {
15
15
  timestamp: Number(),
16
16
  from: String(),
17
17
  to: String(),
18
- nonce: Number(),
19
18
  method: String(),
20
19
  params: Array(),
21
- 'nonce?': Number(),
22
- 'dependsOn?': Array(),
23
- 'priority?': Boolean()
20
+ 'nonce?': Number()
24
21
  };
25
22
 
26
23
  class RawTransactionMessage extends FormatInterface {
@@ -12,6 +12,7 @@ export default class BlockMessage extends FormatInterface {
12
12
  fees: BigNumber;
13
13
  transactions: TransactionMessage['decoded'][];
14
14
  validators: ValidatorMessage['decoded'][];
15
+ hash?: string;
15
16
  };
16
17
  get messageName(): string;
17
18
  constructor(buffer: messageInput);
@@ -27,5 +28,6 @@ export default class BlockMessage extends FormatInterface {
27
28
  address: string;
28
29
  reward: BigNumber;
29
30
  }[];
31
+ hash?: string;
30
32
  };
31
33
  }
@@ -5,4 +5,9 @@ export default class TransactionMessage extends FormatInterface {
5
5
  decoded: typeof proto;
6
6
  get messageName(): string;
7
7
  constructor(buffer: messageInput);
8
+ beforeHashing(decoded: {
9
+ [index: string]: any;
10
+ }): {
11
+ [index: string]: any;
12
+ };
8
13
  }
@@ -7,5 +7,6 @@ declare const _default: {
7
7
  fees: BigNumber;
8
8
  transactions: Uint8Array;
9
9
  validators: Uint8Array;
10
+ 'hash?': string;
10
11
  };
11
12
  export default _default;
@@ -9,7 +9,8 @@ var proto = {
9
9
  signature: String(),
10
10
  'nonce?': Number(),
11
11
  'dependsOn?': Array(),
12
- 'priority?': Boolean()
12
+ 'priority?': Boolean(),
13
+ 'hash?': String()
13
14
  };
14
15
 
15
16
  class TransactionMessage extends FormatInterface {
@@ -22,6 +23,13 @@ class TransactionMessage extends FormatInterface {
22
23
  const name = 'transaction-message';
23
24
  super(buffer, proto, { name });
24
25
  }
26
+ beforeHashing(decoded) {
27
+ decoded = super.beforeHashing(decoded);
28
+ delete decoded.signature;
29
+ delete decoded.priority;
30
+ delete decoded.dependsOn;
31
+ return decoded;
32
+ }
25
33
  }
26
34
 
27
35
  export { TransactionMessage as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/messages",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {