Skip to content

Commit

Permalink
add integration tests for internal operations
Browse files Browse the repository at this point in the history
  • Loading branch information
kroggen committed Oct 29, 2024
1 parent f458255 commit 117ce2c
Show file tree
Hide file tree
Showing 3 changed files with 392 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ get_receipt() {
set +e

while true; do
output=$(../bin/aergocli receipt get --port $query_port $txhash 2>&1 > receipt.json)
output=$(../bin/aergocli receipt get $txhash --port $query_port 2>&1 > receipt.json)

#echo "output: $output"

Expand All @@ -118,6 +118,26 @@ get_receipt() {
set -e
}

get_internal_operations() {
txhash=$1
# do not stop on errors
set +e

output=$(../bin/aergocli operations $txhash --port $query_port 2>&1 > internal_operations.json)

#echo "output: $output"

if [[ $output == *"No internal operations found for this transaction"* ]]; then
echo -n "" > internal_operations.json
elif [[ -n $output ]]; then
echo "Error: $output"
exit 1
fi

# stop on errors
set -e
}

assert_equals() {
local var="$1"
local expected="$2"
Expand Down
2 changes: 2 additions & 0 deletions tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ check ./test-contract-deploy.sh
check ./test-pcall-events.sh
check ./test-transaction-types.sh
check ./test-name-service.sh
check ./test-internal-operations.sh

# change the hardfork version
set_version 4
Expand All @@ -165,6 +166,7 @@ check ./test-transaction-types.sh
check ./test-name-service.sh
check ./test-multicall.sh
check ./test-disabled-functions.sh
check ./test-internal-operations.sh

# terminate the server process
echo ""
Expand Down
Loading

0 comments on commit 117ce2c

Please sign in to comment.