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 +1 -1
- package/src/index.js +1 -1
- package/src/network.js +1 -10
- package/src/utils/check.js +0 -1
package/package.json
CHANGED
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.
|
|
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:
|
|
88
|
+
w: writingKey,
|
|
98
89
|
i: parsedPreTx.i,
|
|
99
90
|
ipk: parsedPreTx.ipk,
|
|
100
91
|
ch: parsedPreTx.ch,
|
package/src/utils/check.js
CHANGED
|
@@ -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
|