trac-msb 0.1.21 → 0.1.22
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/Whitelist/pubkeys.csv +1 -1
- package/package.json +1 -1
- package/src/index.js +8 -1
- package/src/utils/constants.js +1 -1
- package/src/utils/msgUtils.js +1 -6
package/Whitelist/pubkeys.csv
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
bcda78165dd38ca98045a6f4b0d19f2e1a465d83c7fc6ac052a64802ca163986
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -900,7 +900,14 @@ export class MainSettlementBus extends ReadyResource {
|
|
|
900
900
|
console.log('Existing Stream established', pubKey);
|
|
901
901
|
} else {
|
|
902
902
|
_this.#validator_stream = _this.#dht_node.connect(b4a.from(pubKey, 'hex'));
|
|
903
|
-
|
|
903
|
+
|
|
904
|
+
_this.#validator_stream.on('open', () => {
|
|
905
|
+
if(_this.#validator_stream !== null && b4a.toString(_this.#validator_stream.publicKey, 'hex') === pubKey){
|
|
906
|
+
_this.#validator = pubKey;
|
|
907
|
+
console.log('Stream established', pubKey);
|
|
908
|
+
}
|
|
909
|
+
});
|
|
910
|
+
|
|
904
911
|
_this.#validator_stream.on('close', () => {
|
|
905
912
|
if(_this.#validator_stream !== null && b4a.toString(_this.#validator_stream.publicKey, 'hex') === pubKey){
|
|
906
913
|
_this.#validator_stream = null;
|
package/src/utils/constants.js
CHANGED
|
@@ -6,7 +6,7 @@ export const EntryType = Object.freeze({
|
|
|
6
6
|
|
|
7
7
|
export const OperationType = Object.freeze({
|
|
8
8
|
ADD_ADMIN: 'addAdmin',
|
|
9
|
-
APPEND_WHITELIST: '
|
|
9
|
+
APPEND_WHITELIST: 'appendWhitelist',
|
|
10
10
|
ADD_WRITER: 'addWriter',
|
|
11
11
|
REMOVE_WRITER: 'removeWriter',
|
|
12
12
|
ADD_INDEXER: 'addIndexer',
|
package/src/utils/msgUtils.js
CHANGED
|
@@ -3,12 +3,7 @@ import { OperationType } from './constants.js';
|
|
|
3
3
|
import fileUtils from './fileUtils.js';
|
|
4
4
|
import b4a from 'b4a';
|
|
5
5
|
import Wallet from 'trac-wallet';
|
|
6
|
-
|
|
7
|
-
// It is responsible for creating messages, verifying them, reading public keys from a file, etc.
|
|
8
|
-
// It would be better to separate these concerns into different classes or modules.
|
|
9
|
-
// For example, we could have a separate class for file operations, another for message creation, etc.
|
|
10
|
-
// This would make the code more modular and easier to maintain.
|
|
11
|
-
// It would also make it easier to create tests and mocks in the future.
|
|
6
|
+
|
|
12
7
|
class MsgUtils {
|
|
13
8
|
|
|
14
9
|
static createMessage(...args) {
|