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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import applyOperations from './applyOperations.cjs';
|
|
2
|
+
import networkV1Operations from './network.cjs';
|
|
2
3
|
import b4a from 'b4a';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -48,3 +49,12 @@ export const normalizeIncomingMessage = (message) => {
|
|
|
48
49
|
|
|
49
50
|
return null;
|
|
50
51
|
};
|
|
52
|
+
|
|
53
|
+
export const encodeV1networkOperation = (payload) => {
|
|
54
|
+
return networkV1Operations.MessageHeader.encode(payload);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
export const decodeV1networkOperation = (payload) => {
|
|
59
|
+
return networkV1Operations.MessageHeader.decode(payload);
|
|
60
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _ from "lodash"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checks if `value` is considered defined akin to RoR `#defined?`.
|
|
5
|
+
*
|
|
6
|
+
* @static
|
|
7
|
+
* @param {*} value The value to check.
|
|
8
|
+
* @returns {boolean} Returns `false` if `value` is nullish, else `true`.
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* isDefined(undefined);
|
|
12
|
+
* // => false
|
|
13
|
+
*
|
|
14
|
+
* isDefined(null);
|
|
15
|
+
* // => false
|
|
16
|
+
*
|
|
17
|
+
* isDefined(void 0);
|
|
18
|
+
* // => false
|
|
19
|
+
*
|
|
20
|
+
* isDefined(NaN);
|
|
21
|
+
* // => false
|
|
22
|
+
*/
|
|
23
|
+
export function isDefined(value) {
|
|
24
|
+
return !_.isNil(value) && !_.isNaN(value)
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -44,8 +44,7 @@ export const registerBalanceTests = (context) => {
|
|
|
44
44
|
expect(BigInt(res.body.balance)).toBe(0n)
|
|
45
45
|
})
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
it.skip("returns zero balance for an invalid address format", async () => {
|
|
47
|
+
it("returns 400 for an invalid address format", async () => {
|
|
49
48
|
const invalidAddress = "not-a-valid-address"
|
|
50
49
|
const res = await request(context.server).get(`/v1/balance/${invalidAddress}`)
|
|
51
50
|
expect(res.statusCode).toBe(400)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import request from "supertest"
|
|
2
2
|
import b4a from "b4a"
|
|
3
|
-
import { $TNK } from "../../../../src/core/state/utils/balance.js"
|
|
4
3
|
import { buildRpcSelfTransferPayload, waitForConnection } from "../../../helpers/transactionPayloads.mjs"
|
|
5
4
|
|
|
6
5
|
const toBase64 = (value) => b4a.toString(b4a.from(JSON.stringify(value)), "base64")
|
|
@@ -52,8 +51,7 @@ export const registerBroadcastTransactionTests = (context) => {
|
|
|
52
51
|
expect(res.body).toEqual({ error: "Payload must be a valid base64 string." })
|
|
53
52
|
})
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
it.skip("returns 400 when decoded payload is not valid JSON", async () => {
|
|
54
|
+
it("returns 400 when decoded payload is not valid JSON", async () => {
|
|
57
55
|
const invalidJsonBase64 = b4a.toString(b4a.from("{{invalid"), "base64")
|
|
58
56
|
|
|
59
57
|
await waitForConnection(context.rpcMsb)
|
|
@@ -66,8 +64,7 @@ export const registerBroadcastTransactionTests = (context) => {
|
|
|
66
64
|
expect(res.body).toEqual({ error: "Decoded payload is not valid JSON." })
|
|
67
65
|
})
|
|
68
66
|
|
|
69
|
-
|
|
70
|
-
it.skip("returns 400 for invalid transaction structure", async () => {
|
|
67
|
+
it("returns 400 for invalid transaction structure", async () => {
|
|
71
68
|
const invalidStructure = {
|
|
72
69
|
type: 1,
|
|
73
70
|
address: context.wallet.address,
|
|
@@ -83,38 +80,37 @@ export const registerBroadcastTransactionTests = (context) => {
|
|
|
83
80
|
expect(res.body).toEqual({ error: "Invalid payload structure." })
|
|
84
81
|
})
|
|
85
82
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
const payload = toBase64({ type: 1, address: context.wallet.address, txo: { large: largeString } })
|
|
83
|
+
it("returns 413 when payload exceeds size limit", async () => {
|
|
84
|
+
const largeString = "a".repeat(2_100_000);
|
|
85
|
+
const payload = toBase64({ type: 1, address: context.wallet.address, txo: { large: largeString } });
|
|
90
86
|
|
|
91
|
-
await waitForConnection(context.rpcMsb)
|
|
87
|
+
await waitForConnection(context.rpcMsb);
|
|
92
88
|
const res = await request(context.server)
|
|
93
89
|
.post("/v1/broadcast-transaction")
|
|
94
90
|
.set("Accept", "application/json")
|
|
95
|
-
.send(JSON.stringify({ payload }))
|
|
91
|
+
.send(JSON.stringify({ payload }));
|
|
96
92
|
|
|
97
|
-
expect(res.statusCode).toBe(413)
|
|
98
|
-
})
|
|
93
|
+
expect(res.statusCode).toBe(413);
|
|
94
|
+
});
|
|
99
95
|
|
|
100
|
-
it.skip("returns 429 on repeated broadcast failures", async () => {
|
|
101
|
-
// TODO: Would require forcing msb to throw 'Failed to broadcast transaction after multiple attempts.'
|
|
102
|
-
const txData = await tracCrypto.transaction.preBuild(
|
|
103
|
-
context.wallet.address,
|
|
104
|
-
context.wallet.address,
|
|
105
|
-
b4a.toString($TNK(1n), 'hex'),
|
|
106
|
-
b4a.toString(await context.rpcMsb.state.getIndexerSequenceState(), 'hex')
|
|
107
|
-
)
|
|
108
96
|
|
|
109
|
-
|
|
110
|
-
await
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
.set("Accept", "application/json")
|
|
114
|
-
.send(JSON.stringify({ payload }))
|
|
97
|
+
it("returns 429 on repeated broadcast failures", async () => {
|
|
98
|
+
const { payload } = await buildRpcSelfTransferPayload(context, context.rpcMsb.state, 1n);
|
|
99
|
+
const originalMethod = context.rpcMsb.broadcastPartialTransaction;
|
|
100
|
+
context.rpcMsb.broadcastPartialTransaction = async () => false;
|
|
115
101
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
102
|
+
try {
|
|
103
|
+
await waitForConnection(context.rpcMsb);
|
|
104
|
+
const res = await request(context.server)
|
|
105
|
+
.post("/v1/broadcast-transaction")
|
|
106
|
+
.set("Accept", "application/json")
|
|
107
|
+
.send(JSON.stringify({ payload }));
|
|
108
|
+
|
|
109
|
+
expect(res.statusCode).toBe(429);
|
|
110
|
+
expect(res.body).toEqual({ error: "Failed to broadcast transaction after multiple attempts." });
|
|
111
|
+
} finally {
|
|
112
|
+
context.rpcMsb.broadcastPartialTransaction = originalMethod;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
119
115
|
})
|
|
120
116
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import request from "supertest"
|
|
2
|
+
|
|
3
|
+
export const registerHealthTests = (context) => {
|
|
4
|
+
describe("GET /v1/health", () => {
|
|
5
|
+
it("should return 200 and ok:true when healthy", async () => {
|
|
6
|
+
const res = await request(context.server).get("/v1/health")
|
|
7
|
+
expect(res.statusCode).toBe(200)
|
|
8
|
+
expect(res.body).toEqual({ ok: true })
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
it("should return 503 when the state is unavailable", async () => {
|
|
12
|
+
const originalState = context.rpcMsb.state;
|
|
13
|
+
Object.defineProperty(context.rpcMsb, 'state', {
|
|
14
|
+
get: () => null,
|
|
15
|
+
configurable: true
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const res = await request(context.server).get("/v1/health")
|
|
20
|
+
|
|
21
|
+
expect(res.statusCode).toBe(503)
|
|
22
|
+
expect(res.body).toEqual({
|
|
23
|
+
error: "Could not connect to RPC server"
|
|
24
|
+
})
|
|
25
|
+
} finally {
|
|
26
|
+
Object.defineProperty(context.rpcMsb, 'state', {
|
|
27
|
+
get: () => originalState,
|
|
28
|
+
configurable: true
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
}
|
|
@@ -13,6 +13,7 @@ import { registerTxDetailsTests } from "./tx-details/tx-details.test.mjs"
|
|
|
13
13
|
import { registerTxTests } from "./tx/tx.test.mjs"
|
|
14
14
|
import { registerTxvTests } from "./txv/txv.test.mjs"
|
|
15
15
|
import { registerUnconfirmedLengthTests } from "./unconfirmed-length/unconfirmed-length.test.mjs"
|
|
16
|
+
import { registerHealthTests } from "./health/health.test.mjs"
|
|
16
17
|
|
|
17
18
|
let toClose
|
|
18
19
|
let tmpDirectory
|
|
@@ -37,8 +38,7 @@ const setupNetwork = async () => {
|
|
|
37
38
|
enableInteractiveMode: false,
|
|
38
39
|
disableRateLimit: true,
|
|
39
40
|
enableTxApplyLogs: false,
|
|
40
|
-
storesDirectory: `${tmpDirectory}/
|
|
41
|
-
storeName: '/admin'
|
|
41
|
+
storesDirectory: `${tmpDirectory}/admin/`,
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
const admin = await setupMsbAdmin(testKeyPair1, tmpDirectory, rpcOpts)
|
|
@@ -58,7 +58,7 @@ const setupNetwork = async () => {
|
|
|
58
58
|
|
|
59
59
|
beforeAll(async () => {
|
|
60
60
|
const { admin, writer, reader } = await setupNetwork()
|
|
61
|
-
const server = createServer(reader.msb)
|
|
61
|
+
const server = createServer(reader.msb, reader.config)
|
|
62
62
|
toClose = admin.msb
|
|
63
63
|
Object.assign(testContext, {
|
|
64
64
|
writerMsb: writer.msb,
|
|
@@ -91,4 +91,5 @@ describe("API acceptance tests", () => {
|
|
|
91
91
|
registerTxPayloadsBulkTests(testContext)
|
|
92
92
|
registerTxDetailsTests(testContext)
|
|
93
93
|
registerAccountTests(testContext)
|
|
94
|
+
registerHealthTests(testContext)
|
|
94
95
|
})
|
|
@@ -29,70 +29,81 @@ export const registerTxTests = (context) => {
|
|
|
29
29
|
expect(res.body).toEqual({ txDetails: null })
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
it.skip("returns 400 for invalid hash format (too short)", async () => {
|
|
32
|
+
it("returns 400 for invalid hash format (too short)", async () => {
|
|
34
33
|
const invalidHash = '0'.repeat(63)
|
|
35
34
|
const res = await request(context.server).get(`/v1/tx/${invalidHash}`)
|
|
36
35
|
expect(res.statusCode).toBe(400)
|
|
37
36
|
expect(res.body).toEqual({ error: "Invalid transaction hash format" })
|
|
38
37
|
})
|
|
39
38
|
|
|
40
|
-
it
|
|
39
|
+
it("returns 400 for invalid hash format (non-hex)", async () => {
|
|
41
40
|
const invalidHash = 'Z'.repeat(64)
|
|
42
41
|
const res = await request(context.server).get(`/v1/tx/${invalidHash}`)
|
|
43
42
|
expect(res.statusCode).toBe(400)
|
|
44
43
|
expect(res.body).toEqual({ error: "Invalid transaction hash format" })
|
|
45
44
|
})
|
|
46
45
|
|
|
47
|
-
it
|
|
46
|
+
it("returns 400 when no hash provided", async () => {
|
|
48
47
|
const res = await request(context.server).get('/v1/tx')
|
|
49
48
|
expect(res.statusCode).toBe(400)
|
|
50
49
|
expect(res.body).toEqual({ error: "Transaction hash is required" })
|
|
51
50
|
})
|
|
52
51
|
|
|
53
|
-
it
|
|
52
|
+
it("returns 400 for hash with invalid characters", async () => {
|
|
54
53
|
const invalidHash = '0b4d1c1dac48$af13212f6166017399457476a0b644850875b7f4b79df6ff89c'
|
|
55
54
|
const res = await request(context.server).get(`/v1/tx/${invalidHash}`)
|
|
56
55
|
expect(res.statusCode).toBe(400)
|
|
57
56
|
expect(res.body).toEqual({ error: "Invalid transaction hash format" })
|
|
58
57
|
})
|
|
59
58
|
|
|
60
|
-
it
|
|
59
|
+
it("returns 400 for hash with special characters", async () => {
|
|
61
60
|
const invalidHash = '!@#$%^&*'.repeat(8)
|
|
62
61
|
const res = await request(context.server).get(`/v1/tx/${invalidHash}`)
|
|
63
62
|
expect(res.statusCode).toBe(400)
|
|
64
63
|
expect(res.body).toEqual({ error: "Invalid transaction hash format" })
|
|
65
64
|
})
|
|
66
65
|
|
|
67
|
-
it
|
|
66
|
+
it("returns 400 for hash with spaces", async () => {
|
|
68
67
|
const invalidHash = '0b4d1c1dac48af13212f616601d7399457476a0b644850875b7 4b79df6ff89c'
|
|
69
68
|
const res = await request(context.server).get(`/v1/tx/${invalidHash}`)
|
|
70
69
|
expect(res.statusCode).toBe(400)
|
|
71
70
|
expect(res.body).toEqual({ error: "Invalid transaction hash format" })
|
|
72
71
|
})
|
|
73
72
|
|
|
74
|
-
it
|
|
73
|
+
it("returns 400 for hash with 0x prefix", async () => {
|
|
75
74
|
const hash = "0x" + "0".repeat(62)
|
|
76
75
|
const res = await request(context.server).get(`/v1/tx/${hash}`)
|
|
77
76
|
expect(res.statusCode).toBe(400)
|
|
78
77
|
expect(res.body).toEqual({ error: "Invalid transaction hash format" })
|
|
79
78
|
})
|
|
80
79
|
|
|
81
|
-
it
|
|
80
|
+
it("returns 400 for odd-length hex", async () => {
|
|
82
81
|
const hash = "a".repeat(63)
|
|
83
82
|
const res = await request(context.server).get(`/v1/tx/${hash}`)
|
|
84
83
|
expect(res.statusCode).toBe(400)
|
|
85
84
|
expect(res.body).toEqual({ error: "Invalid transaction hash format" })
|
|
86
85
|
})
|
|
87
86
|
|
|
88
|
-
it.skip("accepts uppercase hex", async () => {
|
|
89
|
-
const hash = "A".repeat(64)
|
|
90
|
-
const res = await request(context.server).get(`/v1/tx/${hash}`)
|
|
91
|
-
expect(res.statusCode).toBe(200)
|
|
92
|
-
})
|
|
93
87
|
|
|
94
|
-
it
|
|
95
|
-
const
|
|
88
|
+
it("accepts uppercase hex", async () => {
|
|
89
|
+
const { payload, txHashHex } = await buildRpcSelfTransferPayload(context, context.rpcMsb.state, 1n);
|
|
90
|
+
|
|
91
|
+
// Send the transaction
|
|
92
|
+
await request(context.server)
|
|
93
|
+
.post("/v1/broadcast-transaction")
|
|
94
|
+
.send(JSON.stringify({ payload }));
|
|
95
|
+
|
|
96
|
+
// Waits for the node indexer to process
|
|
97
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
98
|
+
|
|
99
|
+
const uppercaseHash = txHashHex.toUpperCase();
|
|
100
|
+
const res = await request(context.server).get(`/v1/tx/${uppercaseHash}`);
|
|
101
|
+
|
|
102
|
+
expect(res.statusCode).toBe(200);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("returns 400 for trailing space hash", async () => {
|
|
106
|
+
const hash = "a".repeat(64) + "%20" // Forcing space
|
|
96
107
|
const res = await request(context.server).get(`/v1/tx/${hash}`)
|
|
97
108
|
expect(res.statusCode).toBe(400)
|
|
98
109
|
})
|
|
@@ -182,18 +182,32 @@ export const registerTxDetailsTests = (context) => {
|
|
|
182
182
|
expect(res.body).toEqual({ error: "Invalid transaction hash format" })
|
|
183
183
|
})
|
|
184
184
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
})
|
|
185
|
+
it("accepts uppercase hex", async () => {
|
|
186
|
+
const { payload, txHashHex } = await buildRpcSelfTransferPayload(
|
|
187
|
+
context,
|
|
188
|
+
context.rpcMsb.state,
|
|
189
|
+
1n
|
|
190
|
+
);
|
|
192
191
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
192
|
+
await waitForConnection(context.rpcMsb);
|
|
193
|
+
await request(context.server)
|
|
194
|
+
.post("/v1/broadcast-transaction")
|
|
195
|
+
.send(JSON.stringify({ payload }));
|
|
196
|
+
|
|
197
|
+
const upperHash = txHashHex.toUpperCase();
|
|
198
|
+
const res = await request(context.server)
|
|
199
|
+
.get(`/v1/tx/details/${upperHash}?confirmed=false`);
|
|
200
|
+
|
|
201
|
+
expect(res.statusCode).toBe(200);
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it("returns 400 for trailing space hash", async () => {
|
|
205
|
+
const hash = "a".repeat(64) + " ";
|
|
206
|
+
const res = await request(context.server)
|
|
207
|
+
.get(`/v1/tx/details/${encodeURIComponent(hash)}`);
|
|
208
|
+
|
|
209
|
+
expect(res.statusCode).toBe(400);
|
|
210
|
+
expect(res.body).toEqual({ error: "Invalid transaction hash format" });
|
|
211
|
+
});
|
|
198
212
|
})
|
|
199
213
|
}
|
|
@@ -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
|
}
|