trac-msb 0.2.8 → 0.2.10
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/.github/workflows/acceptance-tests.yml +7 -11
- package/.github/workflows/lint-pr-title.yml +26 -0
- package/.github/workflows/unit-tests.yml +2 -8
- package/CODE_OF_CONDUCT.md +128 -0
- package/README.md +33 -18
- package/docker-compose.yml +1 -0
- package/docs/trac_network_http_api.openapi.yaml +889 -0
- package/msb.mjs +5 -22
- package/package.json +14 -10
- package/proto/network.proto +74 -0
- package/rpc/create_server.js +2 -2
- package/rpc/handlers.js +165 -92
- package/rpc/routes/v1.js +3 -1
- package/rpc/rpc_server.js +4 -4
- package/rpc/rpc_services.js +62 -25
- package/rpc/utils/helpers.js +83 -52
- package/src/config/args.js +46 -0
- package/src/config/config.js +78 -5
- package/src/config/env.js +70 -3
- package/src/core/network/Network.js +34 -70
- package/src/core/network/identity/NetworkWalletFactory.js +2 -2
- package/src/core/network/protocols/LegacyProtocol.js +67 -0
- package/src/core/network/protocols/NetworkMessages.js +48 -0
- package/src/core/network/protocols/ProtocolInterface.js +31 -0
- package/src/core/network/protocols/ProtocolSession.js +59 -0
- package/src/core/network/protocols/V1Protocol.js +64 -0
- package/src/core/network/protocols/legacy/NetworkMessageRouter.js +84 -0
- package/src/core/network/protocols/legacy/handlers/GetRequestHandler.js +53 -0
- package/src/core/network/protocols/legacy/handlers/ResponseHandler.js +37 -0
- package/src/core/network/{messaging → protocols/legacy}/validators/base/BaseResponse.js +2 -3
- package/src/core/network/protocols/shared/handlers/RoleOperationHandler.js +88 -0
- package/src/core/network/protocols/shared/handlers/SubnetworkOperationHandler.js +93 -0
- package/src/core/network/{messaging → protocols/shared}/handlers/TransferOperationHandler.js +17 -16
- package/src/core/network/{messaging → protocols/shared}/handlers/base/BaseOperationHandler.js +10 -15
- package/src/core/network/{messaging → protocols/shared}/validators/PartialBootstrapDeployment.js +2 -2
- package/src/core/network/{messaging → protocols/shared}/validators/PartialRoleAccess.js +5 -5
- package/src/core/network/{messaging → protocols/shared}/validators/PartialTransaction.js +4 -4
- package/src/core/network/{messaging → protocols/shared}/validators/PartialTransfer.js +4 -4
- package/src/core/network/{messaging → protocols/shared}/validators/base/PartialOperation.js +14 -12
- package/src/core/network/protocols/v1/NetworkMessageRouter.js +15 -0
- package/src/core/network/services/ConnectionManager.js +5 -5
- package/src/core/network/services/MessageOrchestrator.js +2 -2
- package/src/core/network/services/TransactionPoolService.js +5 -6
- package/src/core/network/services/TransactionRateLimiterService.js +12 -13
- package/src/core/network/services/ValidatorObserverService.js +5 -6
- package/src/core/state/State.js +3 -5
- package/src/index.js +156 -181
- package/src/messages/network/v1/NetworkMessageBuilder.js +325 -0
- package/src/messages/network/v1/NetworkMessageDirector.js +137 -0
- package/src/messages/network/v1/networkMessageFactory.js +12 -0
- package/src/messages/state/ApplyStateMessageBuilder.js +661 -0
- package/src/messages/state/ApplyStateMessageDirector.js +516 -0
- package/src/messages/state/applyStateMessageFactory.js +12 -0
- package/src/utils/buffer.js +53 -1
- package/src/utils/check.js +1 -1
- package/src/utils/cli.js +0 -8
- package/src/utils/constants.js +33 -30
- package/src/utils/fileUtils.js +13 -0
- package/src/utils/normalizers.js +84 -2
- package/src/utils/protobuf/network.cjs +840 -0
- package/src/utils/protobuf/operationHelpers.js +10 -0
- package/src/utils/type.js +26 -0
- package/tests/acceptance/v1/balance/balance.test.mjs +1 -2
- package/tests/acceptance/v1/broadcast-transaction/broadcast-transaction.test.mjs +26 -30
- package/tests/acceptance/v1/health/health.test.mjs +33 -0
- package/tests/acceptance/v1/rpc.test.mjs +4 -3
- package/tests/acceptance/v1/tx/tx.test.mjs +27 -16
- package/tests/acceptance/v1/tx-details/tx-details.test.mjs +26 -12
- package/tests/fixtures/check.fixtures.js +33 -32
- package/tests/fixtures/networkV1.fixtures.js +85 -0
- package/tests/fixtures/protobuf.fixtures.js +109 -25
- package/tests/helpers/StateNetworkFactory.js +2 -2
- package/tests/helpers/address.js +6 -0
- package/tests/helpers/autobaseTestHelpers.js +2 -1
- package/tests/helpers/config.js +2 -1
- package/tests/helpers/setupApplyTests.js +59 -56
- package/tests/unit/messages/messages.test.js +12 -0
- package/tests/unit/messages/network/NetworkMessageBuilder.test.js +276 -0
- package/tests/unit/messages/network/NetworkMessageDirector.test.js +201 -0
- package/tests/unit/messages/state/applyStateMessageBuilder.complete.test.js +521 -0
- package/tests/unit/messages/state/applyStateMessageBuilder.partial.test.js +233 -0
- package/tests/unit/network/ConnectionManager.test.js +6 -5
- package/tests/unit/network/networkModule.test.js +3 -2
- package/tests/unit/state/apply/addAdmin/addAdminHappyPathScenario.js +10 -6
- package/tests/unit/state/apply/addAdmin/addAdminScenarioHelpers.js +9 -6
- package/tests/unit/state/apply/addAdmin/state.apply.addAdmin.test.js +10 -7
- package/tests/unit/state/apply/addIndexer/addIndexerScenarioHelpers.js +18 -21
- package/tests/unit/state/apply/addWriter/addWriterScenarioHelpers.js +53 -38
- package/tests/unit/state/apply/adminRecovery/adminRecoveryScenarioHelpers.js +46 -35
- package/tests/unit/state/apply/appendWhitelist/appendWhitelistScenarioHelpers.js +13 -16
- package/tests/unit/state/apply/balanceInitialization/balanceInitializationScenarioHelpers.js +17 -11
- package/tests/unit/state/apply/banValidator/banValidatorScenarioHelpers.js +11 -12
- package/tests/unit/state/apply/bootstrapDeployment/bootstrapDeploymentScenarioHelpers.js +9 -7
- package/tests/unit/state/apply/common/commonScenarioHelper.js +15 -14
- package/tests/unit/state/apply/common/payload-structure/initializationDisabledScenario.js +9 -4
- package/tests/unit/state/apply/disableInitialization/disableInitializationScenarioHelpers.js +17 -11
- package/tests/unit/state/apply/removeWriter/removeWriterScenarioHelpers.js +19 -14
- package/tests/unit/state/apply/transfer/transferDoubleSpendAcrossValidatorsScenario.js +37 -29
- package/tests/unit/state/apply/transfer/transferScenarioHelpers.js +9 -7
- package/tests/unit/state/apply/txOperation/txOperationScenarioHelpers.js +11 -9
- package/tests/unit/unit.test.js +1 -1
- package/tests/unit/utils/buffer/buffer.test.js +62 -1
- package/tests/unit/utils/fileUtils/readAddressesFromWhitelistFile.test.js +4 -3
- package/tests/unit/utils/fileUtils/readBalanceMigrationFile.test.js +3 -2
- package/tests/unit/utils/migrationUtils/validateAddressFromIncomingFile.test.js +3 -2
- package/tests/unit/utils/normalizers/normalizers.test.js +469 -0
- package/tests/unit/utils/protobuf/operationHelpers.test.js +120 -2
- package/tests/unit/utils/type/type.test.js +25 -0
- package/tests/unit/utils/utils.test.js +1 -0
- package/docs/networking-dualstack-plan.md +0 -75
- package/docs/networking-layer-redesign.md +0 -155
- package/src/core/network/messaging/NetworkMessages.js +0 -64
- package/src/core/network/messaging/handlers/GetRequestHandler.js +0 -113
- package/src/core/network/messaging/handlers/ResponseHandler.js +0 -107
- package/src/core/network/messaging/handlers/RoleOperationHandler.js +0 -114
- package/src/core/network/messaging/handlers/SubnetworkOperationHandler.js +0 -149
- package/src/core/network/messaging/routes/NetworkMessageRouter.js +0 -98
- package/src/core/network/messaging/validators/AdminResponse.js +0 -58
- package/src/core/network/messaging/validators/CustomNodeResponse.js +0 -46
- package/src/messages/base/StateBuilder.js +0 -25
- package/src/messages/completeStateMessages/CompleteStateMessageBuilder.js +0 -425
- package/src/messages/completeStateMessages/CompleteStateMessageDirector.js +0 -252
- package/src/messages/completeStateMessages/CompleteStateMessageOperations.js +0 -296
- package/src/messages/partialStateMessages/PartialStateMessageBuilder.js +0 -272
- package/src/messages/partialStateMessages/PartialStateMessageDirector.js +0 -137
- package/src/messages/partialStateMessages/PartialStateMessageOperations.js +0 -138
- package/tests/integration/apply/addAdmin/addAdminBasic.test.js +0 -69
- package/tests/integration/apply/addAdmin/addAdminRecovery.test.js +0 -126
- package/tests/integration/apply/addIndexer.test.js +0 -239
- package/tests/integration/apply/addWhitelist.test.js +0 -53
- package/tests/integration/apply/addWriter.test.js +0 -245
- package/tests/integration/apply/apply.test.js +0 -19
- package/tests/integration/apply/banValidator.test.js +0 -116
- package/tests/integration/apply/postTx/invalidSubValues.test.js +0 -103
- package/tests/integration/apply/postTx/postTx.test.js +0 -196
- package/tests/integration/apply/removeIndexer.test.js +0 -132
- package/tests/integration/apply/removeWriter.test.js +0 -168
- package/tests/integration/apply/transfer.test.js +0 -83
- package/tests/integration/integration.test.js +0 -9
- package/tests/unit/messageOperations/assembleAddIndexerMessage.test.js +0 -21
- package/tests/unit/messageOperations/assembleAddWriterMessage.test.js +0 -17
- package/tests/unit/messageOperations/assembleAdminMessage.test.js +0 -68
- package/tests/unit/messageOperations/assembleBanWriterMessage.test.js +0 -17
- package/tests/unit/messageOperations/assemblePostTransaction.test.js +0 -424
- package/tests/unit/messageOperations/assembleRemoveIndexerMessage.test.js +0 -19
- package/tests/unit/messageOperations/assembleRemoveWriterMessage.test.js +0 -17
- package/tests/unit/messageOperations/assembleWhitelistMessages.test.js +0 -59
- package/tests/unit/messageOperations/commonsStateMessageOperationsTest.js +0 -278
- package/tests/unit/messageOperations/stateMessageOperations.test.js +0 -19
- /package/src/core/network/{messaging → protocols/legacy}/validators/ValidatorResponse.js +0 -0
- /package/src/utils/{operations.js → applyOperations.js} +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import b4a from 'b4a';
|
|
2
|
+
import { v7 as uuidv7 } from 'uuid';
|
|
3
|
+
import { NetworkOperationType, ResultCode as NetworkResultCode } from '../../src/utils/constants.js';
|
|
4
|
+
import { asAddress } from '../helpers/address.js';
|
|
5
|
+
|
|
6
|
+
const payloadValidatorConnectionRequest = {
|
|
7
|
+
type: NetworkOperationType.VALIDATOR_CONNECTION_REQUEST,
|
|
8
|
+
id: uuidv7(),
|
|
9
|
+
timestamp: 123,
|
|
10
|
+
validator_connection_request: {
|
|
11
|
+
issuer_address: asAddress('36fdaf941de4afe602cbb1e2f56dc582466ef23fad1da55c09fd6dd841cbd117'),
|
|
12
|
+
nonce: b4a.from('00', 'hex'),
|
|
13
|
+
signature: b4a.from('01', 'hex')
|
|
14
|
+
},
|
|
15
|
+
capabilities: ['cap:a', 'cap:b']
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const payloadValidatorConnectionResponse = {
|
|
19
|
+
type: NetworkOperationType.VALIDATOR_CONNECTION_RESPONSE,
|
|
20
|
+
id: uuidv7(),
|
|
21
|
+
timestamp: 456,
|
|
22
|
+
validator_connection_response: {
|
|
23
|
+
issuer_address: asAddress('36fdaf941de4afe602cbb1e2f56dc582466ef23fad1da55c09fd6dd841cbd117'),
|
|
24
|
+
nonce: b4a.from('02', 'hex'),
|
|
25
|
+
signature: b4a.from('03', 'hex'),
|
|
26
|
+
result: NetworkResultCode.OK
|
|
27
|
+
},
|
|
28
|
+
capabilities: ['cap:a']
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const payloadLivenessRequest = {
|
|
32
|
+
type: NetworkOperationType.LIVENESS_REQUEST,
|
|
33
|
+
id: uuidv7(),
|
|
34
|
+
timestamp: 789,
|
|
35
|
+
liveness_request: {
|
|
36
|
+
nonce: b4a.from('04', 'hex'),
|
|
37
|
+
signature: b4a.from('05', 'hex')
|
|
38
|
+
},
|
|
39
|
+
capabilities: []
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const payloadLivenessResponse = {
|
|
43
|
+
type: NetworkOperationType.LIVENESS_RESPONSE,
|
|
44
|
+
id: uuidv7(),
|
|
45
|
+
timestamp: 101112,
|
|
46
|
+
liveness_response: {
|
|
47
|
+
nonce: b4a.from('06', 'hex'),
|
|
48
|
+
signature: b4a.from('07', 'hex'),
|
|
49
|
+
result: NetworkResultCode.OK
|
|
50
|
+
},
|
|
51
|
+
capabilities: []
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const payloadBroadcastTransactionRequest = {
|
|
55
|
+
type: NetworkOperationType.BROADCAST_TRANSACTION_REQUEST,
|
|
56
|
+
id: uuidv7(),
|
|
57
|
+
timestamp: 131415,
|
|
58
|
+
broadcast_transaction_request: {
|
|
59
|
+
data: b4a.from('deadbeef', 'hex'),
|
|
60
|
+
nonce: b4a.from('08', 'hex'),
|
|
61
|
+
signature: b4a.from('09', 'hex')
|
|
62
|
+
},
|
|
63
|
+
capabilities: ['cap:a']
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const payloadBroadcastTransactionResponse = {
|
|
67
|
+
type: NetworkOperationType.BROADCAST_TRANSACTION_RESPONSE,
|
|
68
|
+
id: uuidv7(),
|
|
69
|
+
timestamp: 161718,
|
|
70
|
+
broadcast_transaction_response: {
|
|
71
|
+
nonce: b4a.from('0a', 'hex'),
|
|
72
|
+
signature: b4a.from('0b', 'hex'),
|
|
73
|
+
result: NetworkResultCode.OK
|
|
74
|
+
},
|
|
75
|
+
capabilities: ['cap:b']
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
payloadValidatorConnectionRequest,
|
|
80
|
+
payloadValidatorConnectionResponse,
|
|
81
|
+
payloadLivenessRequest,
|
|
82
|
+
payloadLivenessResponse,
|
|
83
|
+
payloadBroadcastTransactionRequest,
|
|
84
|
+
payloadBroadcastTransactionResponse,
|
|
85
|
+
};
|
|
@@ -2,26 +2,43 @@ import b4a from 'b4a';
|
|
|
2
2
|
import { OperationType } from '../../src/utils/constants.js';
|
|
3
3
|
import { addressToBuffer } from '../../src/core/state/utils/address.js';
|
|
4
4
|
import { config } from '../helpers/config.js';
|
|
5
|
+
import { asAddress } from '../helpers/address.js';
|
|
5
6
|
|
|
6
7
|
const validTransferOperation = {
|
|
7
8
|
type: OperationType.TRANSFER,
|
|
8
|
-
address: addressToBuffer('
|
|
9
|
+
address: addressToBuffer(asAddress('544514242356432739de9af71deb8d526fb03d6c5c15e0a934d9a20b6710e2fe'), config.addressPrefix),
|
|
9
10
|
tro: {
|
|
10
11
|
tx: b4a.from('c59f70942febb1de32fcb59febe84560416265d39f39b48fae676592910a98f4', 'hex'),
|
|
11
12
|
txv: b4a.from('eb59a3e756d1c9597e46b33bcea91e262f8f73e94c238bdf70854aa2e8c42608', 'hex'),
|
|
12
|
-
to: addressToBuffer('
|
|
13
|
+
to: addressToBuffer(asAddress('d82cb76f274b2df1b615bfee926bf7dc385021338e236e5c5ec504e92ce3c45a'), config.addressPrefix),
|
|
13
14
|
am: b4a.from('00000000000000015af1d78b58c40001', 'hex'),
|
|
14
15
|
in: b4a.from('863fef21f5146553b0396b2ee1a93a8dbfce240411b71ccdcfc504504a6b9b50', 'hex'),
|
|
15
16
|
is: b4a.from('06acd7faecd5159221259ebb1d7e98eccd7c6e2884de9de45097e6d9d8c37192602901c74dde6bb2f48f6f665edc84140627f6e9c42f774a0e9f55ef3b348e06', 'hex'),
|
|
16
|
-
va: addressToBuffer('
|
|
17
|
+
va: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
17
18
|
vn: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
18
19
|
vs: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
const validPartialTransferOperation = {
|
|
24
|
+
type: OperationType.TRANSFER,
|
|
25
|
+
address: addressToBuffer(asAddress('544514242356432739de9af71deb8d526fb03d6c5c15e0a934d9a20b6710e2fe')),
|
|
26
|
+
tro: {
|
|
27
|
+
tx: b4a.from('c59f70942febb1de32fcb59febe84560416265d39f39b48fae676592910a98f4', 'hex'),
|
|
28
|
+
txv: b4a.from('eb59a3e756d1c9597e46b33bcea91e262f8f73e94c238bdf70854aa2e8c42608', 'hex'),
|
|
29
|
+
to: addressToBuffer(asAddress('d82cb76f274b2df1b615bfee926bf7dc385021338e236e5c5ec504e92ce3c45a')),
|
|
30
|
+
am: b4a.from('00000000000000015af1d78b58c40001', 'hex'),
|
|
31
|
+
in: b4a.from('863fef21f5146553b0396b2ee1a93a8dbfce240411b71ccdcfc504504a6b9b50', 'hex'),
|
|
32
|
+
is: b4a.from('06acd7faecd5159221259ebb1d7e98eccd7c6e2884de9de45097e6d9d8c37192602901c74dde6bb2f48f6f665edc84140627f6e9c42f774a0e9f55ef3b348e06', 'hex'),
|
|
33
|
+
va: null,
|
|
34
|
+
vn: null,
|
|
35
|
+
vs: null
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
22
39
|
const validTransactionOperation = {
|
|
23
40
|
type: OperationType.TX,
|
|
24
|
-
address: addressToBuffer('
|
|
41
|
+
address: addressToBuffer(asAddress('c2a2a32ecc221e71133c1cfdf7b87d1e2a48e92205197c3608b1b3abb422e43f'), config.addressPrefix),
|
|
25
42
|
txo: {
|
|
26
43
|
tx: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
27
44
|
txv: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
@@ -31,19 +48,37 @@ const validTransactionOperation = {
|
|
|
31
48
|
mbs: b4a.from('5f3b9a6a516066de365e5e75a7ac0feb55ab7cd4a29facbb028a047fc3f3956e', 'hex'),
|
|
32
49
|
in: b4a.from('8bcef53a043f42ac7c17344f0c0d56af5b335e412d4042124f27733911169e4f', 'hex'),
|
|
33
50
|
is: b4a.from('d8626ea0552bf302921de3536e877796ef131368c9854119660c9c77a4196d4735d60bb87c6a89bbff7d5f8d72a70610d6ee73d62bc5144874cdf23f88e28a05', 'hex'),
|
|
34
|
-
va: addressToBuffer('
|
|
51
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
35
52
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
36
53
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
37
54
|
}
|
|
38
55
|
};
|
|
39
56
|
|
|
57
|
+
const validPartialTransactionOperation = {
|
|
58
|
+
type: OperationType.TX,
|
|
59
|
+
address: addressToBuffer(asAddress('c2a2a32ecc221e71133c1cfdf7b87d1e2a48e92205197c3608b1b3abb422e43f')),
|
|
60
|
+
txo: {
|
|
61
|
+
tx: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
62
|
+
txv: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
63
|
+
iw: b4a.from('79ef7be837aa9fd8a446a120e1bc1e6bdd99fb5393dc4fa8299d9d5043a7cd98', 'hex'),
|
|
64
|
+
ch: b4a.from('6ee7b29ce494875c1ea0dc0f9c2997d1aeeb8d21c67809950e145822989c8b2e', 'hex'),
|
|
65
|
+
bs: b4a.from('f68bac445eee3d9276be46aef58328a543e4b7ecc2b5c98c387c1b3ca1a7e85d', 'hex'),
|
|
66
|
+
mbs: b4a.from('5f3b9a6a516066de365e5e75a7ac0feb55ab7cd4a29facbb028a047fc3f3956e', 'hex'),
|
|
67
|
+
in: b4a.from('8bcef53a043f42ac7c17344f0c0d56af5b335e412d4042124f27733911169e4f', 'hex'),
|
|
68
|
+
is: b4a.from('d8626ea0552bf302921de3536e877796ef131368c9854119660c9c77a4196d4735d60bb87c6a89bbff7d5f8d72a70610d6ee73d62bc5144874cdf23f88e28a05', 'hex'),
|
|
69
|
+
va: null,
|
|
70
|
+
vn: null,
|
|
71
|
+
vs: null
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
40
75
|
const validAddIndexer = {
|
|
41
76
|
type: OperationType.ADD_INDEXER,
|
|
42
|
-
address: addressToBuffer('
|
|
77
|
+
address: addressToBuffer(asAddress('94fa91cce6fc7142c2bbfea5c871215305bd651626663c018d2bfd23e0aca494'), config.addressPrefix),
|
|
43
78
|
aco: {
|
|
44
79
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
45
80
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
46
|
-
ia: addressToBuffer('
|
|
81
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
47
82
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
48
83
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
49
84
|
}
|
|
@@ -51,11 +86,11 @@ const validAddIndexer = {
|
|
|
51
86
|
|
|
52
87
|
const validRemoveIndexer = {
|
|
53
88
|
type: OperationType.REMOVE_INDEXER,
|
|
54
|
-
address: addressToBuffer('
|
|
89
|
+
address: addressToBuffer(asAddress('94fa91cce6fc7142c2bbfea5c871215305bd651626663c018d2bfd23e0aca494'), config.addressPrefix),
|
|
55
90
|
aco: {
|
|
56
91
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
57
92
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
58
|
-
ia: addressToBuffer('
|
|
93
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
59
94
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
60
95
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
61
96
|
}
|
|
@@ -63,11 +98,11 @@ const validRemoveIndexer = {
|
|
|
63
98
|
|
|
64
99
|
const validAppendWhitelist = {
|
|
65
100
|
type: OperationType.APPEND_WHITELIST,
|
|
66
|
-
address: addressToBuffer('
|
|
101
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
67
102
|
aco: {
|
|
68
103
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
69
104
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
70
|
-
ia: addressToBuffer('
|
|
105
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
71
106
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
72
107
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
73
108
|
}
|
|
@@ -75,11 +110,11 @@ const validAppendWhitelist = {
|
|
|
75
110
|
|
|
76
111
|
const validBanValidator = {
|
|
77
112
|
type: OperationType.BAN_VALIDATOR,
|
|
78
|
-
address: addressToBuffer('
|
|
113
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
79
114
|
aco: {
|
|
80
115
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
81
116
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
82
|
-
ia: addressToBuffer('
|
|
117
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
83
118
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
84
119
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
85
120
|
}
|
|
@@ -87,7 +122,7 @@ const validBanValidator = {
|
|
|
87
122
|
|
|
88
123
|
const validAddAdmin = {
|
|
89
124
|
type: OperationType.ADD_ADMIN,
|
|
90
|
-
address: addressToBuffer('
|
|
125
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
91
126
|
cao: {
|
|
92
127
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
93
128
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -99,7 +134,7 @@ const validAddAdmin = {
|
|
|
99
134
|
|
|
100
135
|
const validPartialAddWriter = {
|
|
101
136
|
type: OperationType.ADD_WRITER,
|
|
102
|
-
address: addressToBuffer('
|
|
137
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
103
138
|
rao: {
|
|
104
139
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
105
140
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -114,14 +149,14 @@ const validPartialAddWriter = {
|
|
|
114
149
|
|
|
115
150
|
const validCompleteAddWriter = {
|
|
116
151
|
type: OperationType.ADD_WRITER,
|
|
117
|
-
address: addressToBuffer('
|
|
152
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
118
153
|
rao: {
|
|
119
154
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
120
155
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
121
156
|
iw: b4a.from('71c53657a8738b48772f0940398d4f4b01dc56cb32cd2fd84c30359f0cbb08f1', 'hex'),
|
|
122
157
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
123
158
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
124
|
-
va: addressToBuffer('
|
|
159
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
125
160
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
126
161
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
127
162
|
}
|
|
@@ -129,7 +164,7 @@ const validCompleteAddWriter = {
|
|
|
129
164
|
|
|
130
165
|
const validPartialRemoveWriter = {
|
|
131
166
|
type: OperationType.REMOVE_WRITER,
|
|
132
|
-
address: addressToBuffer('
|
|
167
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
133
168
|
rao: {
|
|
134
169
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
135
170
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -144,14 +179,14 @@ const validPartialRemoveWriter = {
|
|
|
144
179
|
|
|
145
180
|
const validCompleteRemoveWriter = {
|
|
146
181
|
type: OperationType.REMOVE_WRITER,
|
|
147
|
-
address: addressToBuffer('
|
|
182
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
148
183
|
rao: {
|
|
149
184
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
150
185
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
151
186
|
iw: b4a.from('71c53657a8738b48772f0940398d4f4b01dc56cb32cd2fd84c30359f0cbb08f1', 'hex'),
|
|
152
187
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
153
188
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
154
|
-
va: addressToBuffer('
|
|
189
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
155
190
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
156
191
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
157
192
|
}
|
|
@@ -159,7 +194,7 @@ const validCompleteRemoveWriter = {
|
|
|
159
194
|
|
|
160
195
|
const validPartialAdminRecovery = {
|
|
161
196
|
type: OperationType.ADMIN_RECOVERY,
|
|
162
|
-
address: addressToBuffer('
|
|
197
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
163
198
|
rao: {
|
|
164
199
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
165
200
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -175,14 +210,14 @@ const validPartialAdminRecovery = {
|
|
|
175
210
|
|
|
176
211
|
const validCompleteAdminRecovery = {
|
|
177
212
|
type: OperationType.ADMIN_RECOVERY,
|
|
178
|
-
address: addressToBuffer('
|
|
213
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
179
214
|
rao: {
|
|
180
215
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
181
216
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
182
217
|
iw: b4a.from('71c53657a8738b48772f0940398d4f4b01dc56cb32cd2fd84c30359f0cbb08f1', 'hex'),
|
|
183
218
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
184
219
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
185
|
-
va: addressToBuffer('
|
|
220
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
186
221
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
187
222
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
188
223
|
}
|
|
@@ -190,7 +225,7 @@ const validCompleteAdminRecovery = {
|
|
|
190
225
|
|
|
191
226
|
const validBalanceInitOperation = {
|
|
192
227
|
type: OperationType.BALANCE_INITIALIZATION,
|
|
193
|
-
address: addressToBuffer('
|
|
228
|
+
address: addressToBuffer(asAddress('544514242356432739de9af71deb8d526fb03d6c5c15e0a934d9a20b6710e2fe'), config.addressPrefix),
|
|
194
229
|
bio: {
|
|
195
230
|
tx: b4a.from('c59f70942febb1de32fcb59febe84560416265d39f39b48fae676592910a98f4', 'hex'),
|
|
196
231
|
txv: b4a.from('eb59a3e756d1c9597e46b33bcea91e262f8f73e94c238bdf70854aa2e8c42608', 'hex'),
|
|
@@ -201,6 +236,50 @@ const validBalanceInitOperation = {
|
|
|
201
236
|
}
|
|
202
237
|
};
|
|
203
238
|
|
|
239
|
+
const validDisableInitialization = {
|
|
240
|
+
type: OperationType.DISABLE_INITIALIZATION,
|
|
241
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2')),
|
|
242
|
+
cao: {
|
|
243
|
+
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
244
|
+
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
245
|
+
iw: b4a.from('71c53657a8738b48772f0940398d4f4b01dc56cb32cd2fd84c30359f0cbb08f1', 'hex'),
|
|
246
|
+
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
247
|
+
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const validPartialBootstrapDeployment = {
|
|
252
|
+
type: OperationType.BOOTSTRAP_DEPLOYMENT,
|
|
253
|
+
address: addressToBuffer(asAddress('c2a2a32ecc221e71133c1cfdf7b87d1e2a48e92205197c3608b1b3abb422e43f')),
|
|
254
|
+
bdo: {
|
|
255
|
+
tx: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
256
|
+
txv: b4a.from('eb59a3e756d1c9597e46b33bcea91e262f8f73e94c238bdf70854aa2e8c42608', 'hex'),
|
|
257
|
+
bs: b4a.from('f68bac445eee3d9276be46aef58328a543e4b7ecc2b5c98c387c1b3ca1a7e85d', 'hex'),
|
|
258
|
+
ic: b4a.from('79ef7be837aa9fd8a446a120e1bc1e6bdd99fb5393dc4fa8299d9d5043a7cd98', 'hex'),
|
|
259
|
+
in: b4a.from('8bcef53a043f42ac7c17344f0c0d56af5b335e412d4042124f27733911169e4f', 'hex'),
|
|
260
|
+
is: b4a.from('d8626ea0552bf302921de3536e877796ef131368c9854119660c9c77a4196d4735d60bb87c6a89bbff7d5f8d72a70610d6ee73d62bc5144874cdf23f88e28a05', 'hex'),
|
|
261
|
+
va: null,
|
|
262
|
+
vn: null,
|
|
263
|
+
vs: null
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
const validCompleteBootstrapDeployment = {
|
|
268
|
+
type: OperationType.BOOTSTRAP_DEPLOYMENT,
|
|
269
|
+
address: addressToBuffer(asAddress('c2a2a32ecc221e71133c1cfdf7b87d1e2a48e92205197c3608b1b3abb422e43f')),
|
|
270
|
+
bdo: {
|
|
271
|
+
tx: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
272
|
+
txv: b4a.from('eb59a3e756d1c9597e46b33bcea91e262f8f73e94c238bdf70854aa2e8c42608', 'hex'),
|
|
273
|
+
bs: b4a.from('f68bac445eee3d9276be46aef58328a543e4b7ecc2b5c98c387c1b3ca1a7e85d', 'hex'),
|
|
274
|
+
ic: b4a.from('79ef7be837aa9fd8a446a120e1bc1e6bdd99fb5393dc4fa8299d9d5043a7cd98', 'hex'),
|
|
275
|
+
in: b4a.from('8bcef53a043f42ac7c17344f0c0d56af5b335e412d4042124f27733911169e4f', 'hex'),
|
|
276
|
+
is: b4a.from('d8626ea0552bf302921de3536e877796ef131368c9854119660c9c77a4196d4735d60bb87c6a89bbff7d5f8d72a70610d6ee73d62bc5144874cdf23f88e28a05', 'hex'),
|
|
277
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970')),
|
|
278
|
+
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
279
|
+
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
|
|
204
283
|
|
|
205
284
|
const invalidPayloads = [
|
|
206
285
|
null,
|
|
@@ -267,7 +346,7 @@ const invalidPayloads = [
|
|
|
267
346
|
|
|
268
347
|
const invalidPayloadWithMultipleOneOfKeys = {
|
|
269
348
|
type: OperationType.ADD_WRITER,
|
|
270
|
-
address: addressToBuffer('
|
|
349
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
271
350
|
cao: {
|
|
272
351
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
273
352
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -286,12 +365,15 @@ const invalidPayloadWithMultipleOneOfKeys = {
|
|
|
286
365
|
|
|
287
366
|
export default {
|
|
288
367
|
validTransactionOperation,
|
|
368
|
+
validPartialTransactionOperation,
|
|
289
369
|
validAddIndexer,
|
|
290
370
|
validRemoveIndexer,
|
|
291
371
|
validAppendWhitelist,
|
|
292
372
|
validBanValidator,
|
|
293
373
|
validAddAdmin,
|
|
374
|
+
validDisableInitialization,
|
|
294
375
|
validTransferOperation,
|
|
376
|
+
validPartialTransferOperation,
|
|
295
377
|
validBalanceInitOperation,
|
|
296
378
|
validPartialAddWriter,
|
|
297
379
|
validCompleteAddWriter,
|
|
@@ -299,6 +381,8 @@ export default {
|
|
|
299
381
|
validPartialAdminRecovery,
|
|
300
382
|
validCompleteRemoveWriter,
|
|
301
383
|
validPartialRemoveWriter,
|
|
384
|
+
validPartialBootstrapDeployment,
|
|
385
|
+
validCompleteBootstrapDeployment,
|
|
302
386
|
invalidPayloads,
|
|
303
387
|
invalidPayloadWithMultipleOneOfKeys
|
|
304
388
|
};
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
ACK_INTERVAL
|
|
25
25
|
} from '../../src/utils/constants.js';
|
|
26
26
|
import { testKeyPair1 } from '../fixtures/apply.fixtures.js';
|
|
27
|
-
import {
|
|
27
|
+
import { overrideConfig } from './config.js';
|
|
28
28
|
|
|
29
29
|
export class StateNetworkFactory {
|
|
30
30
|
|
|
@@ -107,7 +107,7 @@ export class StateNetworkFactory {
|
|
|
107
107
|
for (let i = 0; i < nodes; i++) {
|
|
108
108
|
const mnemonic = i === 0 ? testKeyPair1.mnemonic : null;
|
|
109
109
|
const wallet = await createWallet(mnemonic);
|
|
110
|
-
const stateConfig =
|
|
110
|
+
const stateConfig = overrideConfig({ ...stateOptions, bootstrap: bootstrapKey })
|
|
111
111
|
const state = new State(stateStores[i].session(), wallet, stateConfig);
|
|
112
112
|
|
|
113
113
|
bases[i]._handlers.apply = state.applyHandler;
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
TRAC_NAMESPACE
|
|
18
18
|
} from '../../src/utils/constants.js';
|
|
19
19
|
import Writer from 'autobase/lib/writer.js';
|
|
20
|
+
import { config } from './config.js';
|
|
20
21
|
|
|
21
22
|
const argv = typeof globalThis.Bare !== 'undefined' ? globalThis.Bare.argv : process.argv;
|
|
22
23
|
|
|
@@ -169,7 +170,7 @@ export function defaultOpenHyperbeeView(store) {
|
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
export async function createWallet(mnemonic = null) {
|
|
172
|
-
const wallet = new PeerWallet();
|
|
173
|
+
const wallet = new PeerWallet({ networkPrefix: config.addressPrefix });
|
|
173
174
|
await wallet.generateKeyPair(mnemonic ?? undefined);
|
|
174
175
|
return wallet;
|
|
175
176
|
}
|
package/tests/helpers/config.js
CHANGED