Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions integration-tests/fund_escrow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,27 @@ fi
echo ""
echo "========== FUNDING V2 ESCROW =========="

# Query the network subgraph to find the current allocation ID
echo "Querying network subgraph for current allocation ID..."
ALLOCATION_QUERY_RESULT=$(curl -s -X POST http://localhost:8000/subgraphs/name/graph-network \
-H "Content-Type: application/json" \
-d '{"query": "{ allocations(where: { status: Active }) { id indexer { id } subgraphDeployment { id } } }"}')

# Extract allocation ID from the JSON response
CURRENT_ALLOCATION_ID=$(echo "$ALLOCATION_QUERY_RESULT" | jq -r '.data.allocations[0].id')

if [ "$CURRENT_ALLOCATION_ID" == "null" ] || [ -z "$CURRENT_ALLOCATION_ID" ]; then
echo "❌ Failed to find current allocation ID from network subgraph"
echo "Response: $ALLOCATION_QUERY_RESULT"
exit 1
fi

echo "βœ… Found current allocation ID: $CURRENT_ALLOCATION_ID"

# For V2, we need to specify payer, collector, and receiver
# Payer is the test account, but receiver must be the indexer address
# Payer is the test account, collector is the allocation ID, receiver is the indexer
PAYER=$SENDER_ADDRESS
COLLECTOR=$SENDER_ADDRESS
COLLECTOR=$CURRENT_ALLOCATION_ID
RECEIVER="0xf4EF6650E48d099a4972ea5B414daB86e1998Bd3" # This must be the indexer address

# Check current V2 escrow balance before funding
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub const ACCOUNT0_SECRET: &str =
"ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
pub const CHAIN_ID: u64 = 1337;

pub const SUBGRAPH_ID: &str = "QmV4R5g7Go94bVFmKTVFG7vaMTb1ztUUWb45mNrsc7Yyqs";
pub const SUBGRAPH_ID: &str = "Qmc2CbqucMvaS4GFvt2QUZWvRwSZ3K5ipeGvbC6UUBf616";

pub const GRAPH_URL: &str = "http://localhost:8000/subgraphs/name/graph-network";

Expand Down
9 changes: 5 additions & 4 deletions integration-tests/src/rav_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ use thegraph_core::alloy::{primitives::Address, signers::local::PrivateKeySigner

use crate::{
constants::{
ACCOUNT0_SECRET, CHAIN_ID, GATEWAY_API_KEY, GATEWAY_URL, GRAPH_URL, INDEXER_URL,
MAX_RECEIPT_VALUE, SUBGRAPH_ID, TAP_AGENT_METRICS_URL, TAP_VERIFIER_CONTRACT,
ACCOUNT0_SECRET, CHAIN_ID, GATEWAY_API_KEY, GATEWAY_URL, GRAPH_TALLY_COLLECTOR_CONTRACT,
GRAPH_URL, INDEXER_URL, MAX_RECEIPT_VALUE, SUBGRAPH_ID, TAP_AGENT_METRICS_URL,
TAP_VERIFIER_CONTRACT,
},
utils::{
create_request, create_tap_receipt, create_tap_receipt_v2, encode_v2_receipt,
Expand Down Expand Up @@ -264,7 +265,7 @@ pub async fn test_tap_rav_v2() -> Result<()> {
let receipt = create_tap_receipt_v2(
MAX_RECEIPT_VALUE,
&allocation_id,
TAP_VERIFIER_CONTRACT,
GRAPH_TALLY_COLLECTOR_CONTRACT,
CHAIN_ID,
&wallet,
&payer,
Expand Down Expand Up @@ -336,7 +337,7 @@ pub async fn test_tap_rav_v2() -> Result<()> {
let receipt = create_tap_receipt_v2(
MAX_RECEIPT_VALUE / 10, // Smaller value for trigger receipts
&allocation_id,
TAP_VERIFIER_CONTRACT,
GRAPH_TALLY_COLLECTOR_CONTRACT,
CHAIN_ID,
&wallet,
&payer,
Expand Down
Loading