Skip to content

Commit 491bd8a

Browse files
committed
test(integration-tests): update test setup for v2
1 parent 3528164 commit 491bd8a

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
lines changed

contrib/indexer-service/config.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ status_url = "http://graph-node:8030/graphql"
1212
[subgraphs.network]
1313
query_url = "http://graph-node:8000/subgraphs/name/graph-network"
1414
deployment_id = "NETWORK_DEPLOYMENT_PLACEHOLDER"
15-
syncing_interval_secs = 30
16-
recently_closed_allocation_buffer_secs = 60
15+
syncing_interval_secs = 5
16+
recently_closed_allocation_buffer_secs = 10
1717

1818
[subgraphs.escrow]
1919
query_url = "http://graph-node:8000/subgraphs/name/semiotic/tap"
2020
deployment_id = "ESCROW_DEPLOYMENT_PLACEHOLDER"
21-
syncing_interval_secs = 30
21+
syncing_interval_secs = 5
2222

2323
# Note: V2 escrow accounts are in the network subgraph, not a separate TAP v2 subgraph
2424

contrib/tap-agent/config.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ status_url = "http://graph-node:8030/graphql"
1212
[subgraphs.network]
1313
query_url = "http://graph-node:8000/subgraphs/name/graph-network"
1414
deployment_id = "NETWORK_DEPLOYMENT_PLACEHOLDER"
15-
syncing_interval_secs = 30
16-
recently_closed_allocation_buffer_secs = 60
15+
syncing_interval_secs = 5
16+
recently_closed_allocation_buffer_secs = 10
1717

1818
[subgraphs.escrow]
1919
query_url = "http://graph-node:8000/subgraphs/name/semiotic/tap"
2020
deployment_id = "ESCROW_DEPLOYMENT_PLACEHOLDER"
21-
syncing_interval_secs = 30
21+
syncing_interval_secs = 5
2222

2323
# Note: V2 escrow accounts are in the network subgraph, not a separate TAP v2 subgraph
2424

integration-tests/fund_escrow.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ echo ""
126126
echo "========== FUNDING V2 ESCROW =========="
127127

128128
# For V2, we need to specify payer, collector, and receiver
129-
# In test setup, we'll use the same address for all three
129+
# Payer is the test account, but receiver must be the indexer address
130130
PAYER=$SENDER_ADDRESS
131-
COLLECTOR=$SENDER_ADDRESS
132-
RECEIVER=$SENDER_ADDRESS
131+
COLLECTOR=$SENDER_ADDRESS
132+
RECEIVER="0xf4EF6650E48d099a4972ea5B414daB86e1998Bd3" # This must be the indexer address
133133

134134
# Check current V2 escrow balance before funding
135135
echo "Checking current V2 escrow balance..."

integration-tests/src/constants.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ pub const GRT_DECIMALS: u8 = 18;
2929
pub const GRT_BASE: u128 = 10u128.pow(GRT_DECIMALS as u32);
3030

3131
pub const MAX_RECEIPT_VALUE: u128 = GRT_BASE / 10_000;
32+
33+
// Data service address for V2 testing
34+
// For testing, we'll use the indexer address as the data service
35+
pub const TEST_DATA_SERVICE: &str = "0xf4ef6650e48d099a4972ea5b414dab86e1998bd3"; // indexer address

integration-tests/src/utils.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ use tap_graph::Receipt;
1919
use thegraph_core::alloy::{primitives::Address, signers::local::PrivateKeySigner};
2020
use thegraph_core::CollectionId;
2121

22+
use crate::constants::TEST_DATA_SERVICE;
23+
2224
pub fn create_tap_receipt(
2325
value: u128,
2426
allocation_id: &Address,
@@ -56,7 +58,7 @@ pub fn create_tap_receipt(
5658

5759
pub fn create_tap_receipt_v2(
5860
value: u128,
59-
allocation_id: &Address,
61+
allocation_id: &Address, // Used to derive collection_id in V2
6062
verifier_contract: &str,
6163
chain_id: u64,
6264
wallet: &PrivateKeySigner,
@@ -71,8 +73,9 @@ pub fn create_tap_receipt_v2(
7173
.as_nanos();
7274
let timestamp_ns = timestamp as u64;
7375

74-
// Convert allocation_id to collection_id (as per V2 design)
75-
let collection_id = *CollectionId::from(*allocation_id);
76+
// In V2, convert the allocation_id to a collection_id
77+
// For the migration period, we derive collection_id from allocation_id
78+
let collection_id = CollectionId::from(*allocation_id);
7679

7780
// Create domain separator
7881
let eip712_domain_separator =
@@ -83,10 +86,10 @@ pub fn create_tap_receipt_v2(
8386
let receipt = Eip712SignedMessage::new(
8487
&eip712_domain_separator,
8588
tap_graph::v2::Receipt {
86-
collection_id,
89+
collection_id: *collection_id,
8790
payer: *payer,
8891
service_provider: *service_provider,
89-
data_service: Address::ZERO, // Using zero address for data service
92+
data_service: Address::from_str(TEST_DATA_SERVICE)?, // Use proper data service
9093
nonce,
9194
timestamp_ns,
9295
value,

0 commit comments

Comments
 (0)