Skip to content

Commit 575f427

Browse files
committed
test: add a new hoizon and estardig no improve V2.receipts
1 parent c2f9c26 commit 575f427

File tree

6 files changed

+1065
-16
lines changed

6 files changed

+1065
-16
lines changed

integration-tests/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,17 @@ clap = { version = "4.0", features = ["derive"] }
2828
base64 = { workspace = true }
2929
prost = { workspace = true }
3030
tap_aggregator = { workspace = true }
31+
bigdecimal = { workspace = true }
32+
sqlx = { workspace = true, features = [
33+
"macros",
34+
"postgres",
35+
"runtime-tokio",
36+
"migrate",
37+
"chrono",
38+
"json",
39+
"bigdecimal",
40+
"rust_decimal",
41+
"uuid",
42+
] }
43+
# rdkafka = { workspace = true }
44+
rdkafka = { version = "0.38.0", features = ["gssapi", "tracing"] }

integration-tests/src/constants.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ pub const TAP_AGENT_METRICS_URL: &str = "http://localhost:7300/metrics";
1818
// they must match otherwise receipts would be rejected
1919
pub const TAP_VERIFIER_CONTRACT: &str = "0xC9a43158891282A2B1475592D5719c001986Aaec";
2020

21+
pub const V1_DOMAIN_NAME: &str = "TAP";
22+
pub const V2_DOMAIN_NAME: &str = "GraphTally";
23+
2124
// V2 GraphTallyCollector contract address (for Horizon receipts)
2225
pub const GRAPH_TALLY_COLLECTOR_CONTRACT: &str = "0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07";
2326
pub const ACCOUNT0_SECRET: &str =
@@ -36,3 +39,17 @@ pub const MAX_RECEIPT_VALUE: u128 = GRT_BASE / 10_000;
3639
// Data service address for V2 testing
3740
// For testing, we'll use the indexer address as the data service
3841
pub const TEST_DATA_SERVICE: &str = "0xf4ef6650e48d099a4972ea5b414dab86e1998bd3"; // indexer address
42+
43+
// Gateway mnemonic for direct service testing (from local-network-semiotic/.env)
44+
pub const GATEWAY_MNEMONIC: &str = "test test test test test test test test test test test junk";
45+
46+
// Gateway uses ACCOUNT0_SECRET as raw private key (not mnemonic)
47+
pub const GATEWAY_PRIVATE_KEY: &str =
48+
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
49+
50+
// Kafka configuration (from local-network-semiotic/.env)
51+
pub const KAFKA_SERVERS: &str = "localhost:9092";
52+
53+
// Taken from indexer-service configuration
54+
pub const POSTGRES_PORT: &str = "5432";
55+
pub const POSTGRES_URL: &str = "postgresql://postgres@localhost:5432/indexer_components_1";

integration-tests/src/main.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
mod constants;
5+
mod database_checker;
56
mod load_test;
67
mod metrics;
78
mod rav_tests;
@@ -12,7 +13,9 @@ use anyhow::Result;
1213
use clap::Parser;
1314
use load_test::{receipt_handler_load_test, receipt_handler_load_test_v2};
1415
use metrics::MetricsChecker;
15-
pub(crate) use rav_tests::{test_invalid_chain_id, test_tap_rav_v1, test_tap_rav_v2};
16+
pub(crate) use rav_tests::{
17+
test_direct_service_rav_v2, test_invalid_chain_id, test_tap_rav_v1, test_tap_rav_v2,
18+
};
1619

1720
/// Main CLI parser structure
1821
#[derive(Parser, Debug)]
@@ -27,6 +30,9 @@ enum Commands {
2730
Rav1,
2831
Rav2,
2932

33+
#[clap(name = "direct-service")]
34+
DirectService,
35+
3036
#[clap(name = "load")]
3137
LoadService {
3238
// for example: --num-receipts 10000 or -n 10000
@@ -59,6 +65,13 @@ async fn main() -> Result<()> {
5965
Commands::Rav2 => {
6066
test_tap_rav_v2().await?;
6167
}
68+
Commands::DirectService => {
69+
use crate::rav_tests::test_direct_service_rav_v2_simplified;
70+
71+
// test_direct_service_rav_v2().await?;
72+
test_direct_service_rav_v2_simplified().await?;
73+
// test_direct_service_rav_v2_config_aligned().await?;
74+
}
6275
// cargo run -- load --num-receipts 1000
6376
Commands::LoadService { num_receipts } => {
6477
let concurrency = num_cpus::get();

0 commit comments

Comments
 (0)