forked from yug49/PyPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-proof-submission.js
More file actions
46 lines (40 loc) · 1.54 KB
/
test-proof-submission.js
File metadata and controls
46 lines (40 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const axios = require("axios");
async function testProofSubmission() {
console.log("🧪 Testing Proof Submission to Backend...");
console.log("=====================================");
// Use a real order ID from our previous tests
const orderId =
"0x5076471050bef9cb84f7a093c2f6949b7218057a75f50051877a45f275b2da3d";
const transactionId = "pout_RKgzmQdPNUiyYo"; // From our previous successful payment
const resolverAddress = "0xb862825240fC768515A26D09FAeB9Ab3236Df09e";
try {
console.log(`📋 Order ID: ${orderId}`);
console.log(`🔗 Transaction ID: ${transactionId}`);
console.log(`👤 Resolver: ${resolverAddress}`);
console.log();
const response = await axios.post(
`http://localhost:5001/api/orders/${orderId}/fulfill`,
{
transactionId: transactionId,
resolverAddress: resolverAddress,
},
{
headers: {
"Content-Type": "application/json",
},
timeout: 60000, // 60 seconds
}
);
console.log("✅ SUCCESS!");
console.log("Response:", JSON.stringify(response.data, null, 2));
} catch (error) {
console.log("❌ ERROR!");
if (error.response) {
console.log("Status:", error.response.status);
console.log("Data:", JSON.stringify(error.response.data, null, 2));
} else {
console.log("Error:", error.message);
}
}
}
testProofSubmission();