trac-msb 0.0.45 → 0.0.47
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/msb.mjs +1 -1
- package/package.json +3 -3
- package/src/index.js +3 -4
package/msb.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import MainSettlementBus from './src/index.js';
|
|
|
3
3
|
const opts = {
|
|
4
4
|
stores_directory : 'stores/',
|
|
5
5
|
store_name : typeof process !== "undefined" ? process.argv[2] : Pear.config.args[0],
|
|
6
|
-
bootstrap: '
|
|
6
|
+
bootstrap: '28e0189443903bd066fbddb1276aafd57177340696349534de2b5448eb8b871f',
|
|
7
7
|
channel: '00bptracnetworkmainsettlementbus',
|
|
8
8
|
tx : 'bptracnetworkmainsettlementbustx'
|
|
9
9
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trac-msb",
|
|
3
3
|
"main": "msb.mjs",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.47",
|
|
5
5
|
"pear": {
|
|
6
6
|
"name": "trac-msb",
|
|
7
7
|
"type": "terminal"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "brittle test/*.test.js"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"trac-wallet": "^0.0.
|
|
15
|
+
"trac-wallet": "^0.0.34",
|
|
16
16
|
"autobase": "7.0.45",
|
|
17
17
|
"b4a": "1.6.7",
|
|
18
18
|
"bare": "^1.17.1",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"bare-assert": "^1.0.2",
|
|
34
34
|
"bare-buffer": "^3.1.2",
|
|
35
35
|
"bare-console": "^6.0.1",
|
|
36
|
-
"bare-crypto": "^1.4.
|
|
36
|
+
"bare-crypto": "^1.4.3",
|
|
37
37
|
"bare-events": "^2.5.4",
|
|
38
38
|
"bare-fs": "^4.0.2",
|
|
39
39
|
"bare-http1": "^4.0.2",
|
package/src/index.js
CHANGED
|
@@ -11,8 +11,6 @@ import w from 'protomux-wakeup';
|
|
|
11
11
|
import PeerWallet from "trac-wallet"
|
|
12
12
|
import Corestore from 'corestore';
|
|
13
13
|
import tty from 'tty'
|
|
14
|
-
// removed until PEAR desktop bare-crypto package is fixed
|
|
15
|
-
//import crypto from 'crypto'
|
|
16
14
|
|
|
17
15
|
const wakeup = new w();
|
|
18
16
|
|
|
@@ -69,8 +67,8 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
69
67
|
if (null === await view.get(op.key) &&
|
|
70
68
|
sanitizeTransaction(postTx) &&
|
|
71
69
|
postTx.op === 'post-tx' &&
|
|
72
|
-
hccrypto.verify(b4a.from(postTx.tx + postTx.in, 'utf-8'), b4a.from(postTx.is, 'hex'), b4a.from(postTx.ipk, 'hex'))
|
|
73
|
-
hccrypto.verify(b4a.from(postTx.tx + postTx.wn, 'utf-8'), b4a.from(postTx.ws, 'hex'), b4a.from(postTx.wp, 'hex'))
|
|
70
|
+
hccrypto.verify(b4a.from(postTx.tx + postTx.in, 'utf-8'), b4a.from(postTx.is, 'hex'), b4a.from(postTx.ipk, 'hex')) &&
|
|
71
|
+
hccrypto.verify(b4a.from(postTx.tx + postTx.wn, 'utf-8'), b4a.from(postTx.ws, 'hex'), b4a.from(postTx.wp, 'hex')) &&
|
|
74
72
|
b4a.byteLength(JSON.stringify(postTx)) <= 4096
|
|
75
73
|
) {
|
|
76
74
|
await view.put(op.key, op.value);
|
|
@@ -173,6 +171,7 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
173
171
|
ipk: parsedPreTx.ipk,
|
|
174
172
|
ch: parsedPreTx.ch,
|
|
175
173
|
in: parsedPreTx.in,
|
|
174
|
+
bs: parsedPreTx.bs,
|
|
176
175
|
ws: signature.toString('hex'),
|
|
177
176
|
wp: this.wallet.publicKey,
|
|
178
177
|
wn : nonce
|