This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
chore: add sway app abi tests #1341
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
packages/fuel-indexer-tests/scripts/copy-swap-app-abi.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
# This script copies the JSON ABI for each Sway application into the indexer's | ||
# trybuild tests. | ||
# | ||
# This helps ensure that the indexers can be built with Sway projects that more | ||
# closely resemble "real-world" contracts, as oppposed to just indexer test | ||
# contracts. | ||
# | ||
# This script should be run from the repository root, and might have to be updated | ||
# to account for the addition/removal of Sway applications. | ||
|
||
usage() { | ||
echo "Usage: $0 [options] <directory_root_path>" | ||
echo "Options:" | ||
echo " -h, --help Show this help message and exit." | ||
echo | ||
echo "Arguments:" | ||
echo " <directory_root_path> The root path of the sway-application repository." | ||
echo | ||
} | ||
|
||
swayapps_root=$1 | ||
|
||
if [[ "$1" == "-h" || "$1" == "--help" ]]; then | ||
usage | ||
exit 0 | ||
fi | ||
|
||
if [[ -z "$1" || ! -d "$1" ]]; then | ||
echo "Error: Invalid or missing directory root path." | ||
usage | ||
exit 1 | ||
fi | ||
|
||
testdir=$(realpath $(dirname $(dirname $0))) | ||
abidir=$testdir/trybuild/abi | ||
echo $abidir | ||
|
||
paths=( | ||
"AMM/project/contracts/AMM-contract" | ||
"AMM/project/contracts/exchange-contract" | ||
"DAO/project/contracts/DAO-contract" | ||
"OTC-swap-predicate/project/predicates/swap-predicate" | ||
"airdrop/project/contracts/asset-contract" | ||
"airdrop/project/contracts/distributor-contract" | ||
"multisig-wallet/project/contracts/multisig-contract" | ||
"escrow/project/contracts/escrow-contract" | ||
"timelock/project/contracts/timelock-contract" | ||
"auctions/english-auction/project/contracts/auction-contract" | ||
"name-registry/project/contracts/registry-contract" | ||
"oracle/project/contracts/oracle-contract" | ||
) | ||
|
||
for path in "${paths[@]}"; do | ||
cd $swayapps_root/$path | ||
forc build | ||
cp -fv $path/out/debug/*-abi.json $abidir/ | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will ask the Sway team and the SDK team why this particular contract presents an issue. There is a simple struct
EvmAddress
that for whatever reason is just not returned in the ABI tokens (so on the SDK side)