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.
Files changed (151) hide show
  1. package/.github/workflows/acceptance-tests.yml +7 -11
  2. package/.github/workflows/lint-pr-title.yml +26 -0
  3. package/.github/workflows/unit-tests.yml +2 -8
  4. package/CODE_OF_CONDUCT.md +128 -0
  5. package/README.md +33 -18
  6. package/docker-compose.yml +1 -0
  7. package/docs/trac_network_http_api.openapi.yaml +889 -0
  8. package/msb.mjs +5 -22
  9. package/package.json +14 -10
  10. package/proto/network.proto +74 -0
  11. package/rpc/create_server.js +2 -2
  12. package/rpc/handlers.js +165 -92
  13. package/rpc/routes/v1.js +3 -1
  14. package/rpc/rpc_server.js +4 -4
  15. package/rpc/rpc_services.js +62 -25
  16. package/rpc/utils/helpers.js +83 -52
  17. package/src/config/args.js +46 -0
  18. package/src/config/config.js +78 -5
  19. package/src/config/env.js +70 -3
  20. package/src/core/network/Network.js +34 -70
  21. package/src/core/network/identity/NetworkWalletFactory.js +2 -2
  22. package/src/core/network/protocols/LegacyProtocol.js +67 -0
  23. package/src/core/network/protocols/NetworkMessages.js +48 -0
  24. package/src/core/network/protocols/ProtocolInterface.js +31 -0
  25. package/src/core/network/protocols/ProtocolSession.js +59 -0
  26. package/src/core/network/protocols/V1Protocol.js +64 -0
  27. package/src/core/network/protocols/legacy/NetworkMessageRouter.js +84 -0
  28. package/src/core/network/protocols/legacy/handlers/GetRequestHandler.js +53 -0
  29. package/src/core/network/protocols/legacy/handlers/ResponseHandler.js +37 -0
  30. package/src/core/network/{messaging → protocols/legacy}/validators/base/BaseResponse.js +2 -3
  31. package/src/core/network/protocols/shared/handlers/RoleOperationHandler.js +88 -0
  32. package/src/core/network/protocols/shared/handlers/SubnetworkOperationHandler.js +93 -0
  33. package/src/core/network/{messaging → protocols/shared}/handlers/TransferOperationHandler.js +17 -16
  34. package/src/core/network/{messaging → protocols/shared}/handlers/base/BaseOperationHandler.js +10 -15
  35. package/src/core/network/{messaging → protocols/shared}/validators/PartialBootstrapDeployment.js +2 -2
  36. package/src/core/network/{messaging → protocols/shared}/validators/PartialRoleAccess.js +5 -5
  37. package/src/core/network/{messaging → protocols/shared}/validators/PartialTransaction.js +4 -4
  38. package/src/core/network/{messaging → protocols/shared}/validators/PartialTransfer.js +4 -4
  39. package/src/core/network/{messaging → protocols/shared}/validators/base/PartialOperation.js +14 -12
  40. package/src/core/network/protocols/v1/NetworkMessageRouter.js +15 -0
  41. package/src/core/network/services/ConnectionManager.js +5 -5
  42. package/src/core/network/services/MessageOrchestrator.js +2 -2
  43. package/src/core/network/services/TransactionPoolService.js +5 -6
  44. package/src/core/network/services/TransactionRateLimiterService.js +12 -13
  45. package/src/core/network/services/ValidatorObserverService.js +5 -6
  46. package/src/core/state/State.js +3 -5
  47. package/src/index.js +156 -181
  48. package/src/messages/network/v1/NetworkMessageBuilder.js +325 -0
  49. package/src/messages/network/v1/NetworkMessageDirector.js +137 -0
  50. package/src/messages/network/v1/networkMessageFactory.js +12 -0
  51. package/src/messages/state/ApplyStateMessageBuilder.js +661 -0
  52. package/src/messages/state/ApplyStateMessageDirector.js +516 -0
  53. package/src/messages/state/applyStateMessageFactory.js +12 -0
  54. package/src/utils/buffer.js +53 -1
  55. package/src/utils/check.js +1 -1
  56. package/src/utils/cli.js +0 -8
  57. package/src/utils/constants.js +33 -30
  58. package/src/utils/fileUtils.js +13 -0
  59. package/src/utils/normalizers.js +84 -2
  60. package/src/utils/protobuf/network.cjs +840 -0
  61. package/src/utils/protobuf/operationHelpers.js +10 -0
  62. package/src/utils/type.js +26 -0
  63. package/tests/acceptance/v1/balance/balance.test.mjs +1 -2
  64. package/tests/acceptance/v1/broadcast-transaction/broadcast-transaction.test.mjs +26 -30
  65. package/tests/acceptance/v1/health/health.test.mjs +33 -0
  66. package/tests/acceptance/v1/rpc.test.mjs +4 -3
  67. package/tests/acceptance/v1/tx/tx.test.mjs +27 -16
  68. package/tests/acceptance/v1/tx-details/tx-details.test.mjs +26 -12
  69. package/tests/fixtures/check.fixtures.js +33 -32
  70. package/tests/fixtures/networkV1.fixtures.js +85 -0
  71. package/tests/fixtures/protobuf.fixtures.js +109 -25
  72. package/tests/helpers/StateNetworkFactory.js +2 -2
  73. package/tests/helpers/address.js +6 -0
  74. package/tests/helpers/autobaseTestHelpers.js +2 -1
  75. package/tests/helpers/config.js +2 -1
  76. package/tests/helpers/setupApplyTests.js +59 -56
  77. package/tests/unit/messages/messages.test.js +12 -0
  78. package/tests/unit/messages/network/NetworkMessageBuilder.test.js +276 -0
  79. package/tests/unit/messages/network/NetworkMessageDirector.test.js +201 -0
  80. package/tests/unit/messages/state/applyStateMessageBuilder.complete.test.js +521 -0
  81. package/tests/unit/messages/state/applyStateMessageBuilder.partial.test.js +233 -0
  82. package/tests/unit/network/ConnectionManager.test.js +6 -5
  83. package/tests/unit/network/networkModule.test.js +3 -2
  84. package/tests/unit/state/apply/addAdmin/addAdminHappyPathScenario.js +10 -6
  85. package/tests/unit/state/apply/addAdmin/addAdminScenarioHelpers.js +9 -6
  86. package/tests/unit/state/apply/addAdmin/state.apply.addAdmin.test.js +10 -7
  87. package/tests/unit/state/apply/addIndexer/addIndexerScenarioHelpers.js +18 -21
  88. package/tests/unit/state/apply/addWriter/addWriterScenarioHelpers.js +53 -38
  89. package/tests/unit/state/apply/adminRecovery/adminRecoveryScenarioHelpers.js +46 -35
  90. package/tests/unit/state/apply/appendWhitelist/appendWhitelistScenarioHelpers.js +13 -16
  91. package/tests/unit/state/apply/balanceInitialization/balanceInitializationScenarioHelpers.js +17 -11
  92. package/tests/unit/state/apply/banValidator/banValidatorScenarioHelpers.js +11 -12
  93. package/tests/unit/state/apply/bootstrapDeployment/bootstrapDeploymentScenarioHelpers.js +9 -7
  94. package/tests/unit/state/apply/common/commonScenarioHelper.js +15 -14
  95. package/tests/unit/state/apply/common/payload-structure/initializationDisabledScenario.js +9 -4
  96. package/tests/unit/state/apply/disableInitialization/disableInitializationScenarioHelpers.js +17 -11
  97. package/tests/unit/state/apply/removeWriter/removeWriterScenarioHelpers.js +19 -14
  98. package/tests/unit/state/apply/transfer/transferDoubleSpendAcrossValidatorsScenario.js +37 -29
  99. package/tests/unit/state/apply/transfer/transferScenarioHelpers.js +9 -7
  100. package/tests/unit/state/apply/txOperation/txOperationScenarioHelpers.js +11 -9
  101. package/tests/unit/unit.test.js +1 -1
  102. package/tests/unit/utils/buffer/buffer.test.js +62 -1
  103. package/tests/unit/utils/fileUtils/readAddressesFromWhitelistFile.test.js +4 -3
  104. package/tests/unit/utils/fileUtils/readBalanceMigrationFile.test.js +3 -2
  105. package/tests/unit/utils/migrationUtils/validateAddressFromIncomingFile.test.js +3 -2
  106. package/tests/unit/utils/normalizers/normalizers.test.js +469 -0
  107. package/tests/unit/utils/protobuf/operationHelpers.test.js +120 -2
  108. package/tests/unit/utils/type/type.test.js +25 -0
  109. package/tests/unit/utils/utils.test.js +1 -0
  110. package/docs/networking-dualstack-plan.md +0 -75
  111. package/docs/networking-layer-redesign.md +0 -155
  112. package/src/core/network/messaging/NetworkMessages.js +0 -64
  113. package/src/core/network/messaging/handlers/GetRequestHandler.js +0 -113
  114. package/src/core/network/messaging/handlers/ResponseHandler.js +0 -107
  115. package/src/core/network/messaging/handlers/RoleOperationHandler.js +0 -114
  116. package/src/core/network/messaging/handlers/SubnetworkOperationHandler.js +0 -149
  117. package/src/core/network/messaging/routes/NetworkMessageRouter.js +0 -98
  118. package/src/core/network/messaging/validators/AdminResponse.js +0 -58
  119. package/src/core/network/messaging/validators/CustomNodeResponse.js +0 -46
  120. package/src/messages/base/StateBuilder.js +0 -25
  121. package/src/messages/completeStateMessages/CompleteStateMessageBuilder.js +0 -425
  122. package/src/messages/completeStateMessages/CompleteStateMessageDirector.js +0 -252
  123. package/src/messages/completeStateMessages/CompleteStateMessageOperations.js +0 -296
  124. package/src/messages/partialStateMessages/PartialStateMessageBuilder.js +0 -272
  125. package/src/messages/partialStateMessages/PartialStateMessageDirector.js +0 -137
  126. package/src/messages/partialStateMessages/PartialStateMessageOperations.js +0 -138
  127. package/tests/integration/apply/addAdmin/addAdminBasic.test.js +0 -69
  128. package/tests/integration/apply/addAdmin/addAdminRecovery.test.js +0 -126
  129. package/tests/integration/apply/addIndexer.test.js +0 -239
  130. package/tests/integration/apply/addWhitelist.test.js +0 -53
  131. package/tests/integration/apply/addWriter.test.js +0 -245
  132. package/tests/integration/apply/apply.test.js +0 -19
  133. package/tests/integration/apply/banValidator.test.js +0 -116
  134. package/tests/integration/apply/postTx/invalidSubValues.test.js +0 -103
  135. package/tests/integration/apply/postTx/postTx.test.js +0 -196
  136. package/tests/integration/apply/removeIndexer.test.js +0 -132
  137. package/tests/integration/apply/removeWriter.test.js +0 -168
  138. package/tests/integration/apply/transfer.test.js +0 -83
  139. package/tests/integration/integration.test.js +0 -9
  140. package/tests/unit/messageOperations/assembleAddIndexerMessage.test.js +0 -21
  141. package/tests/unit/messageOperations/assembleAddWriterMessage.test.js +0 -17
  142. package/tests/unit/messageOperations/assembleAdminMessage.test.js +0 -68
  143. package/tests/unit/messageOperations/assembleBanWriterMessage.test.js +0 -17
  144. package/tests/unit/messageOperations/assemblePostTransaction.test.js +0 -424
  145. package/tests/unit/messageOperations/assembleRemoveIndexerMessage.test.js +0 -19
  146. package/tests/unit/messageOperations/assembleRemoveWriterMessage.test.js +0 -17
  147. package/tests/unit/messageOperations/assembleWhitelistMessages.test.js +0 -59
  148. package/tests/unit/messageOperations/commonsStateMessageOperationsTest.js +0 -278
  149. package/tests/unit/messageOperations/stateMessageOperations.test.js +0 -19
  150. /package/src/core/network/{messaging → protocols/legacy}/validators/ValidatorResponse.js +0 -0
  151. /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
- //TODO: This test should return 400, but for backward compatibility reasons it currently returns 200 with zero balance. Please fix this.
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
- // TODO: enable once handler returns 400 for client-side decode errors
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
- // TODO: enable once handler returns 400 for client-side validation errors
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
- // TODO: AFTER REFACTORIZATION IMPROVE THESE IMPLEMENTATIONS ENDPOINT TO COVER THESE TESTS.
87
- it.skip("returns 413 when payload exceeds size limit", async () => {
88
- const largeString = "a".repeat(3_000_000)
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
- const payload = tracCrypto.transaction.build(txData, b4a.from(context.wallet.secretKey, 'hex'))
110
- await waitForConnection(context.rpcMsb)
111
- const res = await request(context.server)
112
- .post("/v1/broadcast-transaction")
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
- expect(res.statusCode).toBe(429)
117
- expect(res.body).toEqual({ error: "Failed to broadcast transaction after multiple attempts." })
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}/stores/`,
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
- // TODO: adjust implementation to cover tests below
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.skip("returns 400 for invalid hash format (non-hex)", async () => {
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.skip("returns 400 when no hash provided", async () => {
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.skip("returns 400 for hash with invalid characters", async () => {
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.skip("returns 400 for hash with special characters", async () => {
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.skip("returns 400 for hash with spaces", async () => {
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.skip("returns 400 for hash with 0x prefix", async () => {
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.skip("returns 400 for odd-length hex", async () => {
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.skip("returns 400 for trailing space hash", async () => {
95
- const hash = `${"a".repeat(64)} `
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
- // TODOadjust implementation to cover tests below
186
- it.skip("accepts uppercase hex", async () => {
187
- const hash = "A".repeat(64)
188
- const res = await request(context.server).get(`/v1/tx/details/${hash}?confirmed=false`)
189
- expect([200]).toContain(res.statusCode)
190
- expect(res.statusCode).toBe(200)
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
- it.skip("returns 400 for trailing space hash", async () => {
194
- const hash = `${"a".repeat(64)} `
195
- const res = await request(context.server).get(`/v1/tx/details/${hash}`)
196
- expect(res.statusCode).toBe(400)
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('trac123z3gfpr2epjwww7ntm3m6ud2fhmq0tvts27p2f5mx3qkecsutlqfys769', config.addressPrefix),
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('trac1mqktwme8fvklrds4hlhfy6lhmsu9qgfn3c3kuhz7c5zwjt8rc3dqj9tx7h', config.addressPrefix),
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('trac123z3gfpr2epjwww7ntm3m6ud2fhmq0tvts27p2f5mx3qkecsutlqfys769', config.addressPrefix),
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('trac1mqktwme8fvklrds4hlhfy6lhmsu9qgfn3c3kuhz7c5zwjt8rc3dqj9tx7h', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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("trac1cep6jwcf02vmwekr4s0sttraqv736v8nf2gkaejz2203zhf7j7csnf44nm", config.addressPrefix),
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("trac1cep6jwcf02vmwekr4s0sttraqv736v8nf2gkaejz2203zhf7j7csnf44nm", config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac1c232xtkvyg08zyeurn7l0wrarc4y36fzq5vhcdsgkxe6hdpzuslsm63dw8', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac1c232xtkvyg08zyeurn7l0wrarc4y36fzq5vhcdsgkxe6hdpzuslsm63dw8', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac1sq3njyxzd27rsy8zcksgv2jmcsl9dlsmklwwqruhx92dufs3cemqgyrpf7', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac1xvqvlzx4w2q2pfqrmycew87kq4rv0q0cewxk68ddvddgk2xm09cqvpc4jc', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac1xvqvlzx4w2q2pfqrmycew87kq4rv0q0cewxk68ddvddgk2xm09cqvpc4jc', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac1xvqvlzx4w2q2pfqrmycew87kq4rv0q0cewxk68ddvddgk2xm09cqvpc4jc', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac1xvqvlzx4w2q2pfqrmycew87kq4rv0q0cewxk68ddvddgk2xm09cqvpc4jc', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac1xvqvlzx4w2q2pfqrmycew87kq4rv0q0cewxk68ddvddgk2xm09cqvpc4jc', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac1xvqvlzx4w2q2pfqrmycew87kq4rv0q0cewxk68ddvddgk2xm09cqvpc4jc', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac1xvqvlzx4w2q2pfqrmycew87kq4rv0q0cewxk68ddvddgk2xm09cqvpc4jc', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac18qq7h503y3326v6msgvq0jwc0e8jp4t4q53z9p9jvd98arj7mtpqfac04p', config.addressPrefix),
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('trac1xvqvlzx4w2q2pfqrmycew87kq4rv0q0cewxk68ddvddgk2xm09cqvpc4jc', config.addressPrefix),
387
+ ia: addressToBuffer(asAddress('3300cf88d57280a0a403d931971fd60546c781f8cb8d6d1dad635a8b28db7970'), config.addressPrefix),
387
388
  am: b4a.from('00000000000000015af1d78b58c40001', 'hex'),
388
389
  is: b4a.from('5b534be7a374148962c271d194c26cf5b1ad705ab218a87709a33fe74f9d1b811772447c939b17b2f803e3da7648f49b666b929fbb20e458ced952f147162c08', 'hex')
389
390
  }