trac-msb 0.2.9 → 0.2.11
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/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 +4 -21
- package/package.json +16 -12
- package/proto/network/v1/enums/message_type.proto +16 -0
- package/proto/network/v1/enums/result_code.proto +84 -0
- package/proto/network/v1/messages/broadcast_transaction_request.proto +9 -0
- package/proto/network/v1/messages/broadcast_transaction_response.proto +13 -0
- package/proto/network/v1/messages/liveness_request.proto +8 -0
- package/proto/network/v1/messages/liveness_response.proto +11 -0
- package/proto/network/v1/network_message.proto +22 -0
- package/rpc/handlers.js +163 -90
- package/rpc/routes/v1.js +3 -1
- package/rpc/rpc_server.js +3 -3
- package/rpc/rpc_services.js +45 -31
- package/rpc/utils/helpers.js +82 -51
- package/scripts/generate-protobufs.js +37 -12
- package/src/config/args.js +46 -0
- package/src/config/config.js +99 -5
- package/src/config/env.js +86 -7
- package/src/core/network/Network.js +79 -46
- package/src/core/network/protocols/LegacyProtocol.js +21 -11
- package/src/core/network/protocols/NetworkMessages.js +38 -17
- package/src/core/network/protocols/ProtocolInterface.js +14 -2
- package/src/core/network/protocols/ProtocolSession.js +144 -17
- package/src/core/network/protocols/V1Protocol.js +37 -18
- package/src/core/network/protocols/connectionPolicies.js +88 -0
- package/src/core/network/protocols/legacy/NetworkMessageRouter.js +26 -20
- package/src/core/network/protocols/{shared/handlers/base/BaseOperationHandler.js → legacy/handlers/BaseStateOperationHandler.js} +25 -15
- package/src/core/network/protocols/legacy/handlers/{GetRequestHandler.js → LegacyGetRequestHandler.js} +6 -6
- package/src/core/network/protocols/legacy/handlers/LegacyResponseHandler.js +23 -0
- package/src/core/network/protocols/{shared/handlers/RoleOperationHandler.js → legacy/handlers/LegacyRoleOperationHandler.js} +20 -13
- package/src/core/network/protocols/{shared/handlers/SubnetworkOperationHandler.js → legacy/handlers/LegacySubnetworkOperationHandler.js} +29 -18
- package/src/core/network/protocols/{shared/handlers/TransferOperationHandler.js → legacy/handlers/LegacyTransferOperationHandler.js} +18 -12
- package/src/core/network/protocols/legacy/validators/base/BaseResponse.js +1 -1
- package/src/core/network/protocols/shared/errors/SharedValidatorRejectionError.js +27 -0
- package/src/core/network/protocols/shared/validators/{PartialBootstrapDeployment.js → PartialBootstrapDeploymentValidator.js} +9 -4
- package/src/core/network/protocols/shared/validators/{base/PartialOperation.js → PartialOperationValidator.js} +47 -25
- package/src/core/network/protocols/shared/validators/{PartialRoleAccess.js → PartialRoleAccessValidator.js} +51 -17
- package/src/core/network/protocols/shared/validators/{PartialTransaction.js → PartialTransactionValidator.js} +21 -7
- package/src/core/network/protocols/shared/validators/{PartialTransfer.js → PartialTransferValidator.js} +26 -9
- package/src/core/network/protocols/v1/NetworkMessageRouter.js +91 -7
- package/src/core/network/protocols/v1/V1ProtocolError.js +91 -0
- package/src/core/network/protocols/v1/handlers/V1BaseOperationHandler.js +65 -0
- package/src/core/network/protocols/v1/handlers/V1BroadcastTransactionOperationHandler.js +389 -0
- package/src/core/network/protocols/v1/handlers/V1LivenessOperationHandler.js +87 -0
- package/src/core/network/protocols/v1/validators/V1BaseOperation.js +211 -0
- package/src/core/network/protocols/v1/validators/V1BroadcastTransactionRequest.js +26 -0
- package/src/core/network/protocols/v1/validators/V1BroadcastTransactionResponse.js +276 -0
- package/src/core/network/protocols/v1/validators/V1LivenessRequest.js +15 -0
- package/src/core/network/protocols/v1/validators/V1LivenessResponse.js +17 -0
- package/src/core/network/protocols/v1/validators/V1ValidationSchema.js +210 -0
- package/src/core/network/services/ConnectionManager.js +147 -95
- package/src/core/network/services/MessageOrchestrator.js +152 -28
- package/src/core/network/services/PendingRequestService.js +172 -0
- package/src/core/network/services/TransactionCommitService.js +149 -0
- package/src/core/network/services/TransactionPoolService.js +133 -22
- package/src/core/network/services/TransactionRateLimiterService.js +57 -42
- package/src/core/network/services/ValidatorHealthCheckService.js +127 -0
- package/src/core/network/services/ValidatorObserverService.js +23 -32
- package/src/core/state/State.js +72 -22
- package/src/index.js +8 -5
- package/src/messages/network/v1/NetworkMessageBuilder.js +61 -81
- package/src/messages/network/v1/NetworkMessageDirector.js +16 -50
- package/src/messages/state/ApplyStateMessageBuilder.js +1 -1
- package/src/utils/Scheduler.js +0 -8
- package/src/utils/check.js +1 -1
- package/src/utils/constants.js +68 -19
- package/src/utils/deepEqualApplyPayload.js +40 -0
- package/src/utils/fileUtils.js +13 -0
- package/src/utils/helpers.js +10 -1
- package/src/utils/logger.js +25 -0
- package/src/utils/normalizers.js +38 -0
- package/src/utils/protobuf/networkV1.generated.cjs +2460 -0
- package/src/utils/protobuf/operationHelpers.js +24 -3
- package/src/utils/type.js +26 -0
- package/tests/acceptance/v1/account/account.test.mjs +8 -2
- 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 +3 -2
- package/tests/acceptance/v1/tx/tx.test.mjs +50 -17
- package/tests/acceptance/v1/tx-details/tx-details.test.mjs +60 -18
- package/tests/fixtures/check.fixtures.js +33 -32
- package/tests/fixtures/networkV1.fixtures.js +2 -27
- package/tests/fixtures/protobuf.fixtures.js +33 -32
- 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 +6 -10
- package/tests/helpers/transactionPayloads.mjs +2 -2
- package/tests/unit/messages/network/NetworkMessageBuilder.test.js +241 -81
- package/tests/unit/messages/network/NetworkMessageDirector.test.js +225 -81
- package/tests/unit/network/LegacyNetworkMessageRouter.test.js +54 -0
- package/tests/unit/network/ProtocolSession.test.js +127 -0
- package/tests/unit/network/networkModule.test.js +4 -1
- package/tests/unit/network/services/ConnectionManager.test.js +450 -0
- package/tests/unit/network/services/MessageOrchestrator.test.js +445 -0
- package/tests/unit/network/services/PendingRequestService.test.js +431 -0
- package/tests/unit/network/services/TransactionCommitService.test.js +246 -0
- package/tests/unit/network/services/TransactionPoolService.test.js +489 -0
- package/tests/unit/network/services/TransactionRateLimiterService.test.js +139 -0
- package/tests/unit/network/services/ValidatorHealthCheckService.test.js +115 -0
- package/tests/unit/network/services/services.test.js +17 -0
- package/tests/unit/network/utils/v1TestUtils.js +153 -0
- package/tests/unit/network/v1/NetworkMessageRouterV1.test.js +151 -0
- package/tests/unit/network/v1/V1BaseOperation.test.js +356 -0
- package/tests/unit/network/v1/V1BroadcastTransactionOperationHandler.test.js +129 -0
- package/tests/unit/network/v1/V1BroadcastTransactionRequest.test.js +53 -0
- package/tests/unit/network/v1/V1BroadcastTransactionResponse.test.js +512 -0
- package/tests/unit/network/v1/V1LivenessRequest.test.js +32 -0
- package/tests/unit/network/v1/V1LivenessResponse.test.js +45 -0
- package/tests/unit/network/v1/V1ResultCode.test.js +84 -0
- package/tests/unit/network/v1/V1ValidationSchema.test.js +13 -0
- package/tests/unit/network/v1/connectionPolicies.test.js +49 -0
- package/tests/unit/network/v1/handlers/V1BaseOperationHandler.test.js +284 -0
- package/tests/unit/network/v1/handlers/V1BroadcastTransactionOperationHandler.test.js +794 -0
- package/tests/unit/network/v1/handlers/V1LivenessOperationHandler.test.js +193 -0
- package/tests/unit/network/v1/v1.handlers.test.js +15 -0
- package/tests/unit/network/v1/v1.test.js +19 -0
- package/tests/unit/network/v1/v1ValidationSchema/broadcastTransactionRequest.test.js +119 -0
- package/tests/unit/network/v1/v1ValidationSchema/broadcastTransactionResponse.test.js +136 -0
- package/tests/unit/network/v1/v1ValidationSchema/common.test.js +308 -0
- package/tests/unit/network/v1/v1ValidationSchema/livenessRequest.test.js +90 -0
- package/tests/unit/network/v1/v1ValidationSchema/livenessResponse.test.js +133 -0
- package/tests/unit/unit.test.js +2 -2
- package/tests/unit/utils/deepEqualApplyPayload/deepEqualApplyPayload.test.js +102 -0
- 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/protobuf/operationHelpers.test.js +2 -4
- package/tests/unit/utils/type/type.test.js +25 -0
- package/tests/unit/utils/utils.test.js +2 -0
- package/.github/workflows/acceptance-tests.yml +0 -42
- package/.github/workflows/publish.yml +0 -33
- package/.github/workflows/unit-tests.yml +0 -40
- package/proto/network.proto +0 -74
- package/src/core/network/protocols/legacy/handlers/ResponseHandler.js +0 -37
- package/src/utils/protobuf/network.cjs +0 -840
- package/tests/unit/network/ConnectionManager.test.js +0 -191
|
@@ -10,33 +10,34 @@ import {
|
|
|
10
10
|
OperationType, AMOUNT_BYTE_LENGTH
|
|
11
11
|
} from '../../src/utils/constants.js';
|
|
12
12
|
import { config } from '../helpers/config.js'
|
|
13
|
+
import { asAddress } from '../helpers/address.js';
|
|
13
14
|
|
|
14
15
|
export const TRO = {
|
|
15
16
|
valid_partial_transfer: {
|
|
16
17
|
type: OperationType.TRANSFER,
|
|
17
|
-
address: addressToBuffer('
|
|
18
|
+
address: addressToBuffer(asAddress('544514242356432739de9af71deb8d526fb03d6c5c15e0a934d9a20b6710e2fe'), config.addressPrefix),
|
|
18
19
|
tro: {
|
|
19
20
|
tx: b4a.from('c59f70942febb1de32fcb59febe84560416265d39f39b48fae676592910a98f4', 'hex'),
|
|
20
21
|
txv: b4a.from('eb59a3e756d1c9597e46b33bcea91e262f8f73e94c238bdf70854aa2e8c42608', 'hex'),
|
|
21
22
|
in: b4a.from('863fef21f5146553b0396b2ee1a93a8dbfce240411b71ccdcfc504504a6b9b50', 'hex'),
|
|
22
|
-
to: addressToBuffer('
|
|
23
|
+
to: addressToBuffer(asAddress('d82cb76f274b2df1b615bfee926bf7dc385021338e236e5c5ec504e92ce3c45a'), config.addressPrefix),
|
|
23
24
|
am: b4a.from('00000000000000015af1d78b58c40001', 'hex'),
|
|
24
25
|
is: b4a.from('06acd7faecd5159221259ebb1d7e98eccd7c6e2884de9de45097e6d9d8c37192602901c74dde6bb2f48f6f665edc84140627f6e9c42f774a0e9f55ef3b348e06', 'hex')
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
28
|
valid_complete_transfer: {
|
|
28
29
|
type: OperationType.TRANSFER,
|
|
29
|
-
address: addressToBuffer('
|
|
30
|
+
address: addressToBuffer(asAddress('544514242356432739de9af71deb8d526fb03d6c5c15e0a934d9a20b6710e2fe'), config.addressPrefix),
|
|
30
31
|
tro: {
|
|
31
32
|
tx: b4a.from('c59f70942febb1de32fcb59febe84560416265d39f39b48fae676592910a98f4', 'hex'),
|
|
32
33
|
txv: b4a.from('eb59a3e756d1c9597e46b33bcea91e262f8f73e94c238bdf70854aa2e8c42608', 'hex'),
|
|
33
34
|
in: b4a.from('863fef21f5146553b0396b2ee1a93a8dbfce240411b71ccdcfc504504a6b9b50', 'hex'),
|
|
34
|
-
to: addressToBuffer('
|
|
35
|
+
to: addressToBuffer(asAddress('d82cb76f274b2df1b615bfee926bf7dc385021338e236e5c5ec504e92ce3c45a'), config.addressPrefix),
|
|
35
36
|
am: b4a.from('00000000000000015af1d78b58c40001', 'hex'),
|
|
36
37
|
is: b4a.from('06acd7faecd5159221259ebb1d7e98eccd7c6e2884de9de45097e6d9d8c37192602901c74dde6bb2f48f6f665edc84140627f6e9c42f774a0e9f55ef3b348e06', 'hex'),
|
|
37
38
|
vn: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
38
39
|
vs: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
39
|
-
va: addressToBuffer('
|
|
40
|
+
va: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
40
41
|
}
|
|
41
42
|
},
|
|
42
43
|
top_fields_transfer: ['type', 'address', 'tro'],
|
|
@@ -66,7 +67,7 @@ export const TRO = {
|
|
|
66
67
|
export const BDO = {
|
|
67
68
|
valid_partial_bootstrap_deployment: {
|
|
68
69
|
type: OperationType.BOOTSTRAP_DEPLOYMENT,
|
|
69
|
-
address: addressToBuffer(
|
|
70
|
+
address: addressToBuffer(asAddress('c643a93b097a99b766c3ac1f05ac7d033d1d30f34a916ee642529f115d3e97b1'), config.addressPrefix),
|
|
70
71
|
bdo: {
|
|
71
72
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
72
73
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -79,7 +80,7 @@ export const BDO = {
|
|
|
79
80
|
|
|
80
81
|
valid_complete_bootstrap_deployment: {
|
|
81
82
|
type: OperationType.BOOTSTRAP_DEPLOYMENT,
|
|
82
|
-
address: addressToBuffer(
|
|
83
|
+
address: addressToBuffer(asAddress('c643a93b097a99b766c3ac1f05ac7d033d1d30f34a916ee642529f115d3e97b1'), config.addressPrefix),
|
|
83
84
|
bdo: {
|
|
84
85
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
85
86
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -87,7 +88,7 @@ export const BDO = {
|
|
|
87
88
|
ic: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
88
89
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
89
90
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
90
|
-
va: addressToBuffer('
|
|
91
|
+
va: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
91
92
|
vn: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
92
93
|
vs: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
93
94
|
}
|
|
@@ -118,7 +119,7 @@ export const BDO = {
|
|
|
118
119
|
export const TXO = {
|
|
119
120
|
valid_complete_transaction_operation: {
|
|
120
121
|
type: OperationType.TX,
|
|
121
|
-
address: addressToBuffer('
|
|
122
|
+
address: addressToBuffer(asAddress('c2a2a32ecc221e71133c1cfdf7b87d1e2a48e92205197c3608b1b3abb422e43f'), config.addressPrefix),
|
|
122
123
|
txo: {
|
|
123
124
|
tx: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
124
125
|
txv: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
@@ -130,12 +131,12 @@ export const TXO = {
|
|
|
130
131
|
mbs: b4a.from('5f3b9a6a516066de365e5e75a7ac0feb55ab7cd4a29facbb028a047fc3f3956e', 'hex'),
|
|
131
132
|
vn: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
132
133
|
vs: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
133
|
-
va: addressToBuffer('
|
|
134
|
+
va: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
134
135
|
}
|
|
135
136
|
},
|
|
136
137
|
valid_partial_transaction_operation: {
|
|
137
138
|
type: OperationType.TX,
|
|
138
|
-
address: addressToBuffer('
|
|
139
|
+
address: addressToBuffer(asAddress('c2a2a32ecc221e71133c1cfdf7b87d1e2a48e92205197c3608b1b3abb422e43f'), config.addressPrefix),
|
|
139
140
|
txo: {
|
|
140
141
|
tx: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
141
142
|
txv: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
@@ -181,7 +182,7 @@ export const TXO = {
|
|
|
181
182
|
export const CAO = {
|
|
182
183
|
validAddAdminOperation: {
|
|
183
184
|
type: OperationType.ADD_ADMIN,
|
|
184
|
-
address: addressToBuffer('
|
|
185
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
185
186
|
cao: {
|
|
186
187
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
187
188
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -192,7 +193,7 @@ export const CAO = {
|
|
|
192
193
|
},
|
|
193
194
|
validDisableInitializationOperation: {
|
|
194
195
|
type: OperationType.DISABLE_INITIALIZATION,
|
|
195
|
-
address: addressToBuffer('
|
|
196
|
+
address: addressToBuffer(asAddress('80233910c26abc3810e2c5a0862a5bc43e56fe1bb7dce00f973154de2611c676'), config.addressPrefix),
|
|
196
197
|
cao: {
|
|
197
198
|
tx: b4a.from('0fc518b31505d163a696555df8dceae415032773f85e578a9a1810ad5c99cf0c', 'hex'),
|
|
198
199
|
txv: b4a.from('dd6b3809673cbca08ee60c32971e9ed9d39fb962c53ab8ef49cd6b467d6977f3', 'hex'),
|
|
@@ -215,48 +216,48 @@ export const CAO = {
|
|
|
215
216
|
export const ACO = {
|
|
216
217
|
validAppendWhitelistOperation: {
|
|
217
218
|
type: OperationType.APPEND_WHITELIST,
|
|
218
|
-
address: addressToBuffer('
|
|
219
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
219
220
|
aco: {
|
|
220
221
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
221
222
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
222
223
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
223
|
-
ia: addressToBuffer('
|
|
224
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
224
225
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
225
226
|
}
|
|
226
227
|
},
|
|
227
228
|
|
|
228
229
|
validAddIndexerOperation: {
|
|
229
230
|
type: OperationType.ADD_INDEXER,
|
|
230
|
-
address: addressToBuffer('
|
|
231
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
231
232
|
aco: {
|
|
232
233
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
233
234
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
234
235
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
235
|
-
ia: addressToBuffer('
|
|
236
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
236
237
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
237
238
|
}
|
|
238
239
|
},
|
|
239
240
|
|
|
240
241
|
validRemoveIndexerOperation: {
|
|
241
242
|
type: OperationType.REMOVE_INDEXER,
|
|
242
|
-
address: addressToBuffer('
|
|
243
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
243
244
|
aco: {
|
|
244
245
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
245
246
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
246
247
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
247
|
-
ia: addressToBuffer('
|
|
248
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
248
249
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
249
250
|
}
|
|
250
251
|
},
|
|
251
252
|
|
|
252
253
|
validBanValidatorOperation: {
|
|
253
254
|
type: OperationType.BAN_VALIDATOR,
|
|
254
|
-
address: addressToBuffer('
|
|
255
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
255
256
|
aco: {
|
|
256
257
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
257
258
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
258
259
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
259
|
-
ia: addressToBuffer('
|
|
260
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
260
261
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
261
262
|
}
|
|
262
263
|
},
|
|
@@ -275,21 +276,21 @@ export const ACO = {
|
|
|
275
276
|
export const RAO = {
|
|
276
277
|
valid_complete_add_writer: {
|
|
277
278
|
type: OperationType.ADD_WRITER,
|
|
278
|
-
address: addressToBuffer('
|
|
279
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
279
280
|
rao: {
|
|
280
281
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
281
282
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
282
283
|
iw: b4a.from('71c53657a8738b48772f0940398d4f4b01dc56cb32cd2fd84c30359f0cbb08f1', 'hex'),
|
|
283
284
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
284
285
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
285
|
-
va: addressToBuffer('
|
|
286
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
286
287
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
287
288
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
288
289
|
}
|
|
289
290
|
},
|
|
290
291
|
valid_partial_add_writer: {
|
|
291
292
|
type: OperationType.ADD_WRITER,
|
|
292
|
-
address: addressToBuffer('
|
|
293
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
293
294
|
rao: {
|
|
294
295
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
295
296
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -302,21 +303,21 @@ export const RAO = {
|
|
|
302
303
|
|
|
303
304
|
valid_complete_remove_writer: {
|
|
304
305
|
type: OperationType.REMOVE_WRITER,
|
|
305
|
-
address: addressToBuffer('
|
|
306
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
306
307
|
rao: {
|
|
307
308
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
308
309
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
309
310
|
iw: b4a.from('71c53657a8738b48772f0940398d4f4b01dc56cb32cd2fd84c30359f0cbb08f1', 'hex'),
|
|
310
311
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
311
312
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
312
|
-
va: addressToBuffer('
|
|
313
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
313
314
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
314
315
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
315
316
|
}
|
|
316
317
|
},
|
|
317
318
|
valid_partial_remove_writer: {
|
|
318
319
|
type: OperationType.REMOVE_WRITER,
|
|
319
|
-
address: addressToBuffer('
|
|
320
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
320
321
|
rao: {
|
|
321
322
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
322
323
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -327,21 +328,21 @@ export const RAO = {
|
|
|
327
328
|
},
|
|
328
329
|
valid_complete_admin_recovery: {
|
|
329
330
|
type: OperationType.ADMIN_RECOVERY,
|
|
330
|
-
address: addressToBuffer('
|
|
331
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
331
332
|
rao: {
|
|
332
333
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
333
334
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
334
335
|
iw: b4a.from('71c53657a8738b48772f0940398d4f4b01dc56cb32cd2fd84c30359f0cbb08f1', 'hex'),
|
|
335
336
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
336
337
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
337
|
-
va: addressToBuffer('
|
|
338
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
338
339
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
339
340
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
340
341
|
}
|
|
341
342
|
},
|
|
342
343
|
valid_partial_admin_recovery: {
|
|
343
344
|
type: OperationType.ADMIN_RECOVERY,
|
|
344
|
-
address: addressToBuffer('
|
|
345
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
345
346
|
rao: {
|
|
346
347
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
347
348
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -378,12 +379,12 @@ export const RAO = {
|
|
|
378
379
|
export const BIO = {
|
|
379
380
|
valid_balance_initialization_operation: {
|
|
380
381
|
type: OperationType.BALANCE_INITIALIZATION,
|
|
381
|
-
address: addressToBuffer('
|
|
382
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
382
383
|
bio: {
|
|
383
384
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
384
385
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
385
386
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
386
|
-
ia: addressToBuffer('
|
|
387
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
387
388
|
am: b4a.from('00000000000000015af1d78b58c40001', 'hex'),
|
|
388
389
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
389
390
|
}
|
|
@@ -2,31 +2,6 @@ import b4a from 'b4a';
|
|
|
2
2
|
import { v7 as uuidv7 } from 'uuid';
|
|
3
3
|
import { NetworkOperationType, ResultCode as NetworkResultCode } from '../../src/utils/constants.js';
|
|
4
4
|
|
|
5
|
-
const payloadValidatorConnectionRequest = {
|
|
6
|
-
type: NetworkOperationType.VALIDATOR_CONNECTION_REQUEST,
|
|
7
|
-
id: uuidv7(),
|
|
8
|
-
timestamp: 123,
|
|
9
|
-
validator_connection_request: {
|
|
10
|
-
issuer_address: 'trac1xm76l9qaujh7vqktk8302mw9sfrxau3l45w62hqfl4kasswt6yts0autkh',
|
|
11
|
-
nonce: b4a.from('00', 'hex'),
|
|
12
|
-
signature: b4a.from('01', 'hex')
|
|
13
|
-
},
|
|
14
|
-
capabilities: ['cap:a', 'cap:b']
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const payloadValidatorConnectionResponse = {
|
|
18
|
-
type: NetworkOperationType.VALIDATOR_CONNECTION_RESPONSE,
|
|
19
|
-
id: uuidv7(),
|
|
20
|
-
timestamp: 456,
|
|
21
|
-
validator_connection_response: {
|
|
22
|
-
issuer_address: 'trac1xm76l9qaujh7vqktk8302mw9sfrxau3l45w62hqfl4kasswt6yts0autkh',
|
|
23
|
-
nonce: b4a.from('02', 'hex'),
|
|
24
|
-
signature: b4a.from('03', 'hex'),
|
|
25
|
-
result: NetworkResultCode.OK
|
|
26
|
-
},
|
|
27
|
-
capabilities: ['cap:a']
|
|
28
|
-
};
|
|
29
|
-
|
|
30
5
|
const payloadLivenessRequest = {
|
|
31
6
|
type: NetworkOperationType.LIVENESS_REQUEST,
|
|
32
7
|
id: uuidv7(),
|
|
@@ -69,14 +44,14 @@ const payloadBroadcastTransactionResponse = {
|
|
|
69
44
|
broadcast_transaction_response: {
|
|
70
45
|
nonce: b4a.from('0a', 'hex'),
|
|
71
46
|
signature: b4a.from('0b', 'hex'),
|
|
47
|
+
proof: b4a.from('0c', 'hex'),
|
|
48
|
+
timestamp: 161719,
|
|
72
49
|
result: NetworkResultCode.OK
|
|
73
50
|
},
|
|
74
51
|
capabilities: ['cap:b']
|
|
75
52
|
};
|
|
76
53
|
|
|
77
54
|
export default {
|
|
78
|
-
payloadValidatorConnectionRequest,
|
|
79
|
-
payloadValidatorConnectionResponse,
|
|
80
55
|
payloadLivenessRequest,
|
|
81
56
|
payloadLivenessResponse,
|
|
82
57
|
payloadBroadcastTransactionRequest,
|
|
@@ -2,18 +2,19 @@ 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
|
}
|
|
@@ -21,11 +22,11 @@ const validTransferOperation = {
|
|
|
21
22
|
|
|
22
23
|
const validPartialTransferOperation = {
|
|
23
24
|
type: OperationType.TRANSFER,
|
|
24
|
-
address: addressToBuffer('
|
|
25
|
+
address: addressToBuffer(asAddress('544514242356432739de9af71deb8d526fb03d6c5c15e0a934d9a20b6710e2fe')),
|
|
25
26
|
tro: {
|
|
26
27
|
tx: b4a.from('c59f70942febb1de32fcb59febe84560416265d39f39b48fae676592910a98f4', 'hex'),
|
|
27
28
|
txv: b4a.from('eb59a3e756d1c9597e46b33bcea91e262f8f73e94c238bdf70854aa2e8c42608', 'hex'),
|
|
28
|
-
to: addressToBuffer('
|
|
29
|
+
to: addressToBuffer(asAddress('d82cb76f274b2df1b615bfee926bf7dc385021338e236e5c5ec504e92ce3c45a')),
|
|
29
30
|
am: b4a.from('00000000000000015af1d78b58c40001', 'hex'),
|
|
30
31
|
in: b4a.from('863fef21f5146553b0396b2ee1a93a8dbfce240411b71ccdcfc504504a6b9b50', 'hex'),
|
|
31
32
|
is: b4a.from('06acd7faecd5159221259ebb1d7e98eccd7c6e2884de9de45097e6d9d8c37192602901c74dde6bb2f48f6f665edc84140627f6e9c42f774a0e9f55ef3b348e06', 'hex'),
|
|
@@ -37,7 +38,7 @@ const validPartialTransferOperation = {
|
|
|
37
38
|
|
|
38
39
|
const validTransactionOperation = {
|
|
39
40
|
type: OperationType.TX,
|
|
40
|
-
address: addressToBuffer('
|
|
41
|
+
address: addressToBuffer(asAddress('c2a2a32ecc221e71133c1cfdf7b87d1e2a48e92205197c3608b1b3abb422e43f'), config.addressPrefix),
|
|
41
42
|
txo: {
|
|
42
43
|
tx: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
43
44
|
txv: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
@@ -47,7 +48,7 @@ const validTransactionOperation = {
|
|
|
47
48
|
mbs: b4a.from('5f3b9a6a516066de365e5e75a7ac0feb55ab7cd4a29facbb028a047fc3f3956e', 'hex'),
|
|
48
49
|
in: b4a.from('8bcef53a043f42ac7c17344f0c0d56af5b335e412d4042124f27733911169e4f', 'hex'),
|
|
49
50
|
is: b4a.from('d8626ea0552bf302921de3536e877796ef131368c9854119660c9c77a4196d4735d60bb87c6a89bbff7d5f8d72a70610d6ee73d62bc5144874cdf23f88e28a05', 'hex'),
|
|
50
|
-
va: addressToBuffer('
|
|
51
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
51
52
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
52
53
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
53
54
|
}
|
|
@@ -55,7 +56,7 @@ const validTransactionOperation = {
|
|
|
55
56
|
|
|
56
57
|
const validPartialTransactionOperation = {
|
|
57
58
|
type: OperationType.TX,
|
|
58
|
-
address: addressToBuffer('
|
|
59
|
+
address: addressToBuffer(asAddress('c2a2a32ecc221e71133c1cfdf7b87d1e2a48e92205197c3608b1b3abb422e43f')),
|
|
59
60
|
txo: {
|
|
60
61
|
tx: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
61
62
|
txv: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
@@ -73,11 +74,11 @@ const validPartialTransactionOperation = {
|
|
|
73
74
|
|
|
74
75
|
const validAddIndexer = {
|
|
75
76
|
type: OperationType.ADD_INDEXER,
|
|
76
|
-
address: addressToBuffer('
|
|
77
|
+
address: addressToBuffer(asAddress('94fa91cce6fc7142c2bbfea5c871215305bd651626663c018d2bfd23e0aca494'), config.addressPrefix),
|
|
77
78
|
aco: {
|
|
78
79
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
79
80
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
80
|
-
ia: addressToBuffer('
|
|
81
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
81
82
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
82
83
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
83
84
|
}
|
|
@@ -85,11 +86,11 @@ const validAddIndexer = {
|
|
|
85
86
|
|
|
86
87
|
const validRemoveIndexer = {
|
|
87
88
|
type: OperationType.REMOVE_INDEXER,
|
|
88
|
-
address: addressToBuffer('
|
|
89
|
+
address: addressToBuffer(asAddress('94fa91cce6fc7142c2bbfea5c871215305bd651626663c018d2bfd23e0aca494'), config.addressPrefix),
|
|
89
90
|
aco: {
|
|
90
91
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
91
92
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
92
|
-
ia: addressToBuffer('
|
|
93
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
93
94
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
94
95
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
95
96
|
}
|
|
@@ -97,11 +98,11 @@ const validRemoveIndexer = {
|
|
|
97
98
|
|
|
98
99
|
const validAppendWhitelist = {
|
|
99
100
|
type: OperationType.APPEND_WHITELIST,
|
|
100
|
-
address: addressToBuffer('
|
|
101
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
101
102
|
aco: {
|
|
102
103
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
103
104
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
104
|
-
ia: addressToBuffer('
|
|
105
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
105
106
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
106
107
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
107
108
|
}
|
|
@@ -109,11 +110,11 @@ const validAppendWhitelist = {
|
|
|
109
110
|
|
|
110
111
|
const validBanValidator = {
|
|
111
112
|
type: OperationType.BAN_VALIDATOR,
|
|
112
|
-
address: addressToBuffer('
|
|
113
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
113
114
|
aco: {
|
|
114
115
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
115
116
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
116
|
-
ia: addressToBuffer('
|
|
117
|
+
ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
117
118
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
118
119
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
|
|
119
120
|
}
|
|
@@ -121,7 +122,7 @@ const validBanValidator = {
|
|
|
121
122
|
|
|
122
123
|
const validAddAdmin = {
|
|
123
124
|
type: OperationType.ADD_ADMIN,
|
|
124
|
-
address: addressToBuffer('
|
|
125
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
125
126
|
cao: {
|
|
126
127
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
127
128
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -133,7 +134,7 @@ const validAddAdmin = {
|
|
|
133
134
|
|
|
134
135
|
const validPartialAddWriter = {
|
|
135
136
|
type: OperationType.ADD_WRITER,
|
|
136
|
-
address: addressToBuffer('
|
|
137
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
137
138
|
rao: {
|
|
138
139
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
139
140
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -148,14 +149,14 @@ const validPartialAddWriter = {
|
|
|
148
149
|
|
|
149
150
|
const validCompleteAddWriter = {
|
|
150
151
|
type: OperationType.ADD_WRITER,
|
|
151
|
-
address: addressToBuffer('
|
|
152
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
152
153
|
rao: {
|
|
153
154
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
154
155
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
155
156
|
iw: b4a.from('71c53657a8738b48772f0940398d4f4b01dc56cb32cd2fd84c30359f0cbb08f1', 'hex'),
|
|
156
157
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
157
158
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
158
|
-
va: addressToBuffer('
|
|
159
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
159
160
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
160
161
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
161
162
|
}
|
|
@@ -163,7 +164,7 @@ const validCompleteAddWriter = {
|
|
|
163
164
|
|
|
164
165
|
const validPartialRemoveWriter = {
|
|
165
166
|
type: OperationType.REMOVE_WRITER,
|
|
166
|
-
address: addressToBuffer('
|
|
167
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
167
168
|
rao: {
|
|
168
169
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
169
170
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -178,14 +179,14 @@ const validPartialRemoveWriter = {
|
|
|
178
179
|
|
|
179
180
|
const validCompleteRemoveWriter = {
|
|
180
181
|
type: OperationType.REMOVE_WRITER,
|
|
181
|
-
address: addressToBuffer('
|
|
182
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
182
183
|
rao: {
|
|
183
184
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
184
185
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
185
186
|
iw: b4a.from('71c53657a8738b48772f0940398d4f4b01dc56cb32cd2fd84c30359f0cbb08f1', 'hex'),
|
|
186
187
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
187
188
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
188
|
-
va: addressToBuffer('
|
|
189
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
189
190
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
190
191
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
191
192
|
}
|
|
@@ -193,7 +194,7 @@ const validCompleteRemoveWriter = {
|
|
|
193
194
|
|
|
194
195
|
const validPartialAdminRecovery = {
|
|
195
196
|
type: OperationType.ADMIN_RECOVERY,
|
|
196
|
-
address: addressToBuffer('
|
|
197
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
197
198
|
rao: {
|
|
198
199
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
199
200
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -209,14 +210,14 @@ const validPartialAdminRecovery = {
|
|
|
209
210
|
|
|
210
211
|
const validCompleteAdminRecovery = {
|
|
211
212
|
type: OperationType.ADMIN_RECOVERY,
|
|
212
|
-
address: addressToBuffer('
|
|
213
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
213
214
|
rao: {
|
|
214
215
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
215
216
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
216
217
|
iw: b4a.from('71c53657a8738b48772f0940398d4f4b01dc56cb32cd2fd84c30359f0cbb08f1', 'hex'),
|
|
217
218
|
in: b4a.from('0ad7fe36a35a27ea4df932b800200823a97d4db31bca247f43ad7523b0493645', 'hex'),
|
|
218
219
|
is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex'),
|
|
219
|
-
va: addressToBuffer('
|
|
220
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
|
|
220
221
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
221
222
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
222
223
|
}
|
|
@@ -224,7 +225,7 @@ const validCompleteAdminRecovery = {
|
|
|
224
225
|
|
|
225
226
|
const validBalanceInitOperation = {
|
|
226
227
|
type: OperationType.BALANCE_INITIALIZATION,
|
|
227
|
-
address: addressToBuffer('
|
|
228
|
+
address: addressToBuffer(asAddress('544514242356432739de9af71deb8d526fb03d6c5c15e0a934d9a20b6710e2fe'), config.addressPrefix),
|
|
228
229
|
bio: {
|
|
229
230
|
tx: b4a.from('c59f70942febb1de32fcb59febe84560416265d39f39b48fae676592910a98f4', 'hex'),
|
|
230
231
|
txv: b4a.from('eb59a3e756d1c9597e46b33bcea91e262f8f73e94c238bdf70854aa2e8c42608', 'hex'),
|
|
@@ -237,7 +238,7 @@ const validBalanceInitOperation = {
|
|
|
237
238
|
|
|
238
239
|
const validDisableInitialization = {
|
|
239
240
|
type: OperationType.DISABLE_INITIALIZATION,
|
|
240
|
-
address: addressToBuffer('
|
|
241
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2')),
|
|
241
242
|
cao: {
|
|
242
243
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
243
244
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -249,7 +250,7 @@ const validDisableInitialization = {
|
|
|
249
250
|
|
|
250
251
|
const validPartialBootstrapDeployment = {
|
|
251
252
|
type: OperationType.BOOTSTRAP_DEPLOYMENT,
|
|
252
|
-
address: addressToBuffer('
|
|
253
|
+
address: addressToBuffer(asAddress('c2a2a32ecc221e71133c1cfdf7b87d1e2a48e92205197c3608b1b3abb422e43f')),
|
|
253
254
|
bdo: {
|
|
254
255
|
tx: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
255
256
|
txv: b4a.from('eb59a3e756d1c9597e46b33bcea91e262f8f73e94c238bdf70854aa2e8c42608', 'hex'),
|
|
@@ -265,7 +266,7 @@ const validPartialBootstrapDeployment = {
|
|
|
265
266
|
|
|
266
267
|
const validCompleteBootstrapDeployment = {
|
|
267
268
|
type: OperationType.BOOTSTRAP_DEPLOYMENT,
|
|
268
|
-
address: addressToBuffer('
|
|
269
|
+
address: addressToBuffer(asAddress('c2a2a32ecc221e71133c1cfdf7b87d1e2a48e92205197c3608b1b3abb422e43f')),
|
|
269
270
|
bdo: {
|
|
270
271
|
tx: b4a.from('6fb7f6e7f6970477977080f2b46cc837d48605e67691d30bf7511a1417d17ed7', 'hex'),
|
|
271
272
|
txv: b4a.from('eb59a3e756d1c9597e46b33bcea91e262f8f73e94c238bdf70854aa2e8c42608', 'hex'),
|
|
@@ -273,7 +274,7 @@ const validCompleteBootstrapDeployment = {
|
|
|
273
274
|
ic: b4a.from('79ef7be837aa9fd8a446a120e1bc1e6bdd99fb5393dc4fa8299d9d5043a7cd98', 'hex'),
|
|
274
275
|
in: b4a.from('8bcef53a043f42ac7c17344f0c0d56af5b335e412d4042124f27733911169e4f', 'hex'),
|
|
275
276
|
is: b4a.from('d8626ea0552bf302921de3536e877796ef131368c9854119660c9c77a4196d4735d60bb87c6a89bbff7d5f8d72a70610d6ee73d62bc5144874cdf23f88e28a05', 'hex'),
|
|
276
|
-
va: addressToBuffer('
|
|
277
|
+
va: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970')),
|
|
277
278
|
vn: b4a.from('9027192c6de13b683bc0c0fbcfe09c4e55d47c12c46b122d988f06c282a4be5e', 'hex'),
|
|
278
279
|
vs: b4a.from('8fb8a3ba30e00c347bca5a8554c47e167f63b248c87e1ea5532eebbad1bc036184fe8872ff65a9e63acfee68d2213a187466c13ff6687d3ab57e5209abd4fb01', 'hex')
|
|
279
280
|
}
|
|
@@ -345,7 +346,7 @@ const invalidPayloads = [
|
|
|
345
346
|
|
|
346
347
|
const invalidPayloadWithMultipleOneOfKeys = {
|
|
347
348
|
type: OperationType.ADD_WRITER,
|
|
348
|
-
address: addressToBuffer('
|
|
349
|
+
address: addressToBuffer(asAddress('3801ebd1f12462ad335b821807c9d87e4f20d57505222284b2634a7e8e5edac2'), config.addressPrefix),
|
|
349
350
|
cao: {
|
|
350
351
|
tx: b4a.from('1bd4f96adeffba9c04943a82993c5b19660c3a5f572620d82a67464f381640e2', 'hex'),
|
|
351
352
|
txv: b4a.from('f24e61cf7941256b080be2133bccb520414c78021215edfcb781622da526c414', 'hex'),
|
|
@@ -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