forked from ecotask-network/EcoTask-contract
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegration-test.sh
More file actions
executable file
·36 lines (29 loc) · 900 Bytes
/
Copy pathintegration-test.sh
File metadata and controls
executable file
·36 lines (29 loc) · 900 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
NETWORK="${NETWORK:-testnet}"
: "${SPONSOR_KEY:?SPONSOR_KEY is required}"
: "${SPONSOR_ADDRESS:?SPONSOR_ADDRESS is required}"
: "${TASK_REGISTRY_ID:?TASK_REGISTRY_ID is required}"
echo "=== EcoTask Contract Integration Test ==="
LOCATION_HASH=$(printf '%s' "test-integration-$(date +%s)" | sha256sum | cut -d' ' -f1)
echo "Creating task..."
soroban contract invoke \
--id "$TASK_REGISTRY_ID" \
--network "$NETWORK" \
--source "$SPONSOR_KEY" \
-- \
create_task \
--creator "$SPONSOR_ADDRESS" \
--task_type "{\"string\": \"TREE_PLANTING\"}" \
--location_hash "$LOCATION_HASH" \
--reward_amount 100 \
--max_completions 10 \
--expires_at 9999999999
echo "Task count:"
soroban contract invoke \
--id "$TASK_REGISTRY_ID" \
--network "$NETWORK" \
--source "$SPONSOR_KEY" \
-- \
task_count
echo "=== Integration test complete ==="