trac-msb 0.1.2 → 0.1.3

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.
Files changed (3) hide show
  1. package/msb.mjs +1 -0
  2. package/package.json +1 -1
  3. package/src/index.js +3 -0
package/msb.mjs CHANGED
@@ -4,6 +4,7 @@ const opts = {
4
4
  stores_directory : 'stores/',
5
5
  store_name : typeof process !== "undefined" ? process.argv[2] : Pear.config.args[0],
6
6
  bootstrap: '4577ebf1e84c06d48b2caa33fe54ae58be3a79cb30810129d58b725fae412e37',
7
+ signature_whitelist : ['e504496caf3765f57ee4e2b2f04c9954d4bb6a0d95586c576df73076a9aa4f7f'],
7
8
  channel: '00axtracnetworkmainsettlementbus',
8
9
  enable_updater : true
9
10
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trac-msb",
3
3
  "main": "msb.mjs",
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "pear": {
6
6
  "name": "trac-msb",
7
7
  "type": "terminal"
package/src/index.js CHANGED
@@ -54,6 +54,7 @@ export class MainSettlementBus extends ReadyResource {
54
54
  #replicate;
55
55
  #network;
56
56
  #opts;
57
+ #signature_whitelist;
57
58
 
58
59
  constructor(options = {}) {
59
60
  super();
@@ -83,6 +84,7 @@ export class MainSettlementBus extends ReadyResource {
83
84
  this.#enable_wallet = options.enable_wallet !== false;
84
85
  this.#wallet = new PeerWallet(options);
85
86
  this.#replicate = options.replicate !== false;
87
+ this.#signature_whitelist = options.signature_whitelist !== undefined && Array.isArray(options.signature_whitelist) ? options.signature_whitelist : [];
86
88
  this.#opts = options;
87
89
  }
88
90
 
@@ -155,6 +157,7 @@ export class MainSettlementBus extends ReadyResource {
155
157
  async #handleApplyTxOperation(op, view, base, node, batch) {
156
158
  const postTx = op.value;
157
159
  if (postTx.op === OperationType.POST_TX &&
160
+ (this.#signature_whitelist.length === 0 || this.#signature_whitelist.includes(postTx.bs)) &&
158
161
  null === await batch.get(op.key) &&
159
162
  this.check.sanitizePostTx(op) &&
160
163
  op.key === postTx.tx &&