trac-msb 0.0.74 → 0.0.76

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trac-msb",
3
3
  "main": "msb.mjs",
4
- "version": "0.0.74",
4
+ "version": "0.0.76",
5
5
  "pear": {
6
6
  "name": "trac-msb",
7
7
  "type": "terminal"
package/src/index.js CHANGED
@@ -154,7 +154,7 @@ export class MainSettlementBus extends ReadyResource {
154
154
  op.key === postTx.tx &&
155
155
  this.#wallet.verify(b4a.from(postTx.is, 'hex'), b4a.from(postTx.tx + postTx.in), b4a.from(postTx.ipk, 'hex')) && // sender verification
156
156
  this.#wallet.verify(b4a.from(postTx.ws, 'hex'), b4a.from(postTx.tx + postTx.wn), b4a.from(postTx.wp, 'hex')) && // writer verification
157
- postTx.tx === await this.generateTx(postTx.bs, this.bootstrap, postTx.w, postTx.i, postTx.ipk, postTx.ch, postTx.in) &&
157
+ postTx.tx === await this.generateTx(postTx.bs, this.bootstrap, postTx.wp, postTx.i, postTx.ipk, postTx.ch, postTx.in) &&
158
158
  b4a.byteLength(JSON.stringify(postTx)) <= 4096
159
159
  ) {
160
160
  await batch.put(op.key, op.value);
package/src/network.js CHANGED
@@ -72,19 +72,10 @@ class Network {
72
72
  if (b4a.byteLength(msg) > 3072) return;
73
73
 
74
74
  try {
75
-
76
75
  const parsedPreTx = JSON.parse(msg);
77
76
 
78
- console.log(networkInstance.check.sanitizePreTx(parsedPreTx),
79
- wallet.verify(b4a.from(parsedPreTx.is, 'hex'), b4a.from(parsedPreTx.tx + parsedPreTx.in), b4a.from(parsedPreTx.ipk, 'hex')),
80
- parsedPreTx.w === writingKey,
81
- parsedPreTx.wp === wallet.publicKey,
82
- null === await base.view.get(parsedPreTx.tx)
83
- );
84
-
85
77
  if (networkInstance.check.sanitizePreTx(parsedPreTx) &&
86
78
  wallet.verify(b4a.from(parsedPreTx.is, 'hex'), b4a.from(parsedPreTx.tx + parsedPreTx.in), b4a.from(parsedPreTx.ipk, 'hex')) &&
87
- parsedPreTx.w === writingKey &&
88
79
  parsedPreTx.wp === wallet.publicKey &&
89
80
  null === await base.view.get(parsedPreTx.tx)
90
81
  ) {
@@ -94,7 +85,7 @@ class Network {
94
85
  op: OperationType.POST_TX,
95
86
  tx: parsedPreTx.tx,
96
87
  is: parsedPreTx.is,
97
- w: parsedPreTx.w,
88
+ w: writingKey,
98
89
  i: parsedPreTx.i,
99
90
  ipk: parsedPreTx.ipk,
100
91
  ch: parsedPreTx.ch,
@@ -109,7 +109,6 @@ class Check {
109
109
  tx: { type: 'is_hex_string', required: true }, // TODO: if we will use only 256 bit hash then change to length: 64
110
110
  is: { type: 'is_hex_string', length: 128, required: true },
111
111
  wp: { type: 'is_hex_string', length: 64, required: true },
112
- w: { type: 'is_hex_string', length: 64, required: true },
113
112
  i: { type: 'is_hex_string', length: 64, required: true },
114
113
  ipk: { type: 'is_hex_string', length: 64, required: true },
115
114
  ch: { type: 'is_hex_string', required: true }, // TODO: if we will use only 256 bit hash then change to length: 64