diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/test/typescript/integration/run-transaction-endpoint-v1.test.ts b/packages/cactus-plugin-ledger-connector-iroha/src/test/typescript/integration/run-transaction-endpoint-v1.test.ts index 9388683eed..24da1e1964 100644 --- a/packages/cactus-plugin-ledger-connector-iroha/src/test/typescript/integration/run-transaction-endpoint-v1.test.ts +++ b/packages/cactus-plugin-ledger-connector-iroha/src/test/typescript/integration/run-transaction-endpoint-v1.test.ts @@ -8,7 +8,6 @@ import express from "express"; import { Containers, - //IrohaTestLedger, pruneDockerAllIfGithubAction, PostgresTestContainer, IrohaTestLedger, @@ -25,7 +24,6 @@ import { import { PluginLedgerConnectorIroha, DefaultApi as IrohaApi, - //RunTransactionRequest, PluginFactoryLedgerConnector, RunTransactionRequest, } from "../../../main/typescript/public-api"; @@ -126,7 +124,7 @@ test(testCase, async (t: Test) => { const adminID = `${admin}@${domain}`; const user = uuidv4().substring(0, 5); /** - * Account is formatted as: `account_name@domain_id` + * An account in Iroha ledger is formatted as: `account_name@domain_id` * @see https://iroha.readthedocs.io/en/main/concepts_architecture/er_model.html?highlight=%3Casset_name%3E%23%3Cdomain_id%3E#account */ const userID = `${user}@${domain}`; @@ -199,7 +197,7 @@ test(testCase, async (t: Test) => { const asset = "coolcoin"; /** - * Asset is formatted as: `asset_name#domain_id` + * An asset in Iroha ledger is formatted as: `asset_name#domain_id` * @see https://iroha.readthedocs.io/en/main/concepts_architecture/er_model.html?highlight=%3Casset_name%3E%23%3Cdomain_id%3E#asset */ const assetID = `${asset}#${domain}`; @@ -946,6 +944,33 @@ test(testCase, async (t: Test) => { ); } + /** + * FIXME - the Iroha Javascript SDK does not give any output if we try to produce a pending transaction + * This results in an infinite loop and thus the following code cannot be executed. + * Once the Iroha Javascript SDK is justitied. We can safely produce a pending transaction. + * @see https://github.com/hyperledger/iroha-javascript/issues/66 + * Dealing with it will cause the test suite fail, so only testing against an empty pending transaction case. + */ + { + const req = { + commandName: IrohaQuery.GetPendingTransactions, + baseConfig: { + irohaHost: irohaHost, + irohaPort: irohaPort, + creatorAccountId: adminID, + privKey: [adminPriv], + quorum: 1, + timeoutLimit: 5000, + }, + params: [5, undefined], + }; + const res = await apiClient.runTransactionV1(req as RunTransactionRequest); + t.ok(res); + t.ok(res.data); + t.equal(res.status, 200); + t.deepEqual(res.data.transactionReceipt, []); + } + const keyPair5: KeyPair = cryptoHelper.generateKeyPair(); const adminPubC = keyPair5.publicKey; const adminPrivC = keyPair5.privateKey; @@ -993,8 +1018,8 @@ test(testCase, async (t: Test) => { const keyPair6: KeyPair = cryptoHelper.generateKeyPair(); const nodePubB = keyPair6.publicKey; /** - * Fake the peer address with Postgres's address because - * it is different from existing Iroha node's address + * Take advantage of Postgres's address to fake it as the peer address + * since it is different from existing Iroha node's address */ const peerAddr = `${postgresHost}:${postgresPort}`; {