trac-msb 0.0.4 → 0.0.5
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 +3 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -68,8 +68,8 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
68
68
|
if (null === await view.get(op.key) &&
|
|
69
69
|
sanitizeTransaction(postTx) &&
|
|
70
70
|
postTx.op === 'post-tx' &&
|
|
71
|
-
crypto.verify(Buffer.from(
|
|
72
|
-
crypto.verify(
|
|
71
|
+
crypto.verify(Buffer.from(postTx.tx, 'utf-8'), Buffer.from(postTx.is, 'hex'), Buffer.from(postTx.ipk, 'hex')) &&// sender verification
|
|
72
|
+
crypto.verify(Buffer.from(postTx.tx, 'utf-8'), Buffer.from(postTx.ws, 'hex'), Buffer.from(postTx.wp, 'hex')) &&// writer verification
|
|
73
73
|
Buffer.byteLength(JSON.stringify(postTx)) <= 4096
|
|
74
74
|
) {
|
|
75
75
|
await view.put(op.key, op.value);
|
|
@@ -145,7 +145,7 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
145
145
|
|
|
146
146
|
if (sanitizeTransaction(parsedPreTx) &&
|
|
147
147
|
parsedPreTx.op === 'pre-tx' &&
|
|
148
|
-
crypto.verify(Buffer.from(parsedPreTx.
|
|
148
|
+
crypto.verify(Buffer.from(parsedPreTx.tx, 'utf-8'), Buffer.from(parsedPreTx.is, 'hex'), Buffer.from(parsedPreTx.ipk, 'hex')) &&
|
|
149
149
|
parsedPreTx.w === _this.writerLocalKey &&
|
|
150
150
|
null === await _this.base.view.get(parsedPreTx.tx)
|
|
151
151
|
) {
|