From 1c8b85cd41213605ffd66af033f64d9b7c71d712 Mon Sep 17 00:00:00 2001 From: Anton Rusev Date: Tue, 3 May 2022 10:48:04 +0300 Subject: [PATCH] test: fix integration db tests Signed-off-by: Anton Rusev --- ...5-repeated-topics-with-timestamp.spec.json | 49 ++++++++++--------- ...topics-with-timestamp-no-results.spec.json | 41 ++++++++++++++++ 2 files changed, 68 insertions(+), 22 deletions(-) create mode 100644 hedera-mirror-rest/__tests__/specs/contracts-logs-19-repeated-topics-with-timestamp-no-results.spec.json diff --git a/hedera-mirror-rest/__tests__/specs/contracts-logs-15-repeated-topics-with-timestamp.spec.json b/hedera-mirror-rest/__tests__/specs/contracts-logs-15-repeated-topics-with-timestamp.spec.json index 7f84b7a67f7..cc7884b1ab9 100644 --- a/hedera-mirror-rest/__tests__/specs/contracts-logs-15-repeated-topics-with-timestamp.spec.json +++ b/hedera-mirror-rest/__tests__/specs/contracts-logs-15-repeated-topics-with-timestamp.spec.json @@ -1,49 +1,54 @@ { - "description": "Contract logs api calls with multiple topic0 and timestamp param", + "description": "Contract logs api calls with multiple topic1 and timestamp param", "setup": { "contractlogs": [ { "consensus_timestamp": 1639010141000000000, "contract_id": 1000, "index": 0, - "topic0": [ - 151, 193, 252, 10, 110, 213, 85, 27, 200, 49, 87, 19, 37, 233, 189, 179, 101, 208, 104, 3, 16, 13, 194, 6, 72, - 100, 11, 162, 76, 230, 151, 80 - ] + "topic0": [10], + "topic1": [11] }, { "consensus_timestamp": 1639010141000000000, "contract_id": 1000, "index": 1, - "topic0": [ - 152, 193, 252, 10, 110, 213, 85, 27, 200, 49, 87, 19, 37, 233, 189, 179, 101, 208, 104, 3, 16, 13, 194, 6, 72, - 100, 11, 162, 76, 230, 151, 80 - ] - }, - { - "consensus_timestamp": 1639010141000000000, - "contract_id": 1000, - "index": 2, - "topic0": null + "topic0": [10], + "topic1": [12], + "topic2": [13] }, { "consensus_timestamp": 1639010141000000000, "contract_id": 1000, "index": 3, "topic0": null, - "topic1": [ - 151, 193, 252, 10, 110, 213, 85, 27, 200, 49, 87, 19, 37, 233, 189, 179, 101, 208, 104, 3, 16, 13, 194, 6, 72, - 100, 11, 162, 76, 230, 151, 80 - ] + "topic1": null, + "topic2": null } ] }, "urls": [ - "/api/v1/contracts/0.0.1000/results/logs?topic0=0x97c1fc0a6ed5551bc831571325e9bdb365d06803100dc20648640ba24ce69750&topic0=0xe8d47b56e8cdfa95f871b19d4f50a857217c44a95502b0811a350fec1500dd67×tamp=1639010141.000000000" + "/api/v1/contracts/0.0.1000/results/logs?topic0=A×tamp=1639010141.000000000", + "/api/v1/contracts/0.0.1000/results/logs?topic1=B&topic1=C×tamp=1639010141.000000000" ], "responseStatus": 200, "responseJson": { "logs": [ + { + "address": "0x00000000000000000000000000000000000003e8", + "bloom": "0x0123", + "contract_id": "0.0.1000", + "data": "0x0123", + "index": 1, + "root_contract_id": null, + "timestamp": "1639010141.000000000", + "topics": [ + "0x000000000000000000000000000000000000000000000000000000000000000a", + "0x000000000000000000000000000000000000000000000000000000000000000c", + "0x000000000000000000000000000000000000000000000000000000000000000d", + "0xe8d47b56e8cdfa95f871b19d4f50a857217c44a95502b0811a350fec1500dd67" + ] + }, { "address": "0x00000000000000000000000000000000000003e8", "bloom": "0x0123", @@ -53,8 +58,8 @@ "root_contract_id": null, "timestamp": "1639010141.000000000", "topics": [ - "0x97c1fc0a6ed5551bc831571325e9bdb365d06803100dc20648640ba24ce69750", - "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000000000000000000000000000000000000000000a", + "0x000000000000000000000000000000000000000000000000000000000000000b", "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0xe8d47b56e8cdfa95f871b19d4f50a857217c44a95502b0811a350fec1500dd67" ] diff --git a/hedera-mirror-rest/__tests__/specs/contracts-logs-19-repeated-topics-with-timestamp-no-results.spec.json b/hedera-mirror-rest/__tests__/specs/contracts-logs-19-repeated-topics-with-timestamp-no-results.spec.json new file mode 100644 index 00000000000..079bb82ce76 --- /dev/null +++ b/hedera-mirror-rest/__tests__/specs/contracts-logs-19-repeated-topics-with-timestamp-no-results.spec.json @@ -0,0 +1,41 @@ +{ + "description": "Contract logs api calls with mismatching topics", + "setup": { + "contractlogs": [ + { + "consensus_timestamp": 1639010141000000000, + "contract_id": 1000, + "index": 0, + "topic0": [10], + "topic1": [11] + }, + { + "consensus_timestamp": 1639010141000000000, + "contract_id": 1000, + "index": 1, + "topic0": [10], + "topic1": [12], + "topic2": [13] + }, + { + "consensus_timestamp": 1639010141000000000, + "contract_id": 1000, + "index": 3, + "topic0": null, + "topic1": null, + "topic2": null + }, + { + "consensus_timestamp": 1639010141000000000, + "contract_id": 1000, + "index": 4, + "topic0": [14] + } + ] + }, + "urls": ["/api/v1/contracts/0.0.1000/results/logs?topic0=E&topic2=D×tamp=1639010141.000000000"], + "responseStatus": 200, + "responseJson": { + "logs": [] + } +}