This project contains scripts capable to trigger Execution flows on Sygma testnet and mainnet environments and Sprinter API calls with execution.
- Location:
src/Sygma_Tests/
- Contains end-to-end test flows for Sygma testnet and mainnet environments
- Includes tests for:
- EVM to EVM fungible transfers
- EVM to EVM GMP transfers
- Combined fungible and GMP transfers
- The scripts are capable of running the tests with specific parameters so we can use specific scenarios for testing
- Each script has reports to the console with the results of the execution and stored in the
src/Sygma_Tests/reports
folder
- Location:
src/Sprinter_API_Tests/
- Contains direct API call tests for the Sprinter service
- Tests various API endpoints and functionality
Make sure you have the following installed on your system:
- Node.js (version 14.x or later)
- Yarn
-
Clone the repository:
git clone https://github.com/sygmaprotocol/qa-utils.git
-
Navigate to project directory:
cd qa-utils
-
Install dependencies:
yarn install
-
Populate with correct values the
.env
file. Check the.env.example
for reference.
The fungible transfer script supports the following optional parameters:
# Basic usage will trigger ALL 2 ALL transfers
yarn transfer:fungible
# With specific source chains
yarn transfer:fungible -s 2,6,11
# With specific destination chains
yarn transfer:fungible -d 5,6,10
# With specific resource IDs
yarn transfer:fungible -r 0x0000000000000000000000000000000000000000000000000000000000001100
# With specific amount
yarn transfer:fungible -a 1000000000000000000
# Combining parameters
yarn transfer:fungible -s 2,6 -d 5,10 -r 0x0000000000000000000000000000000000000000000000000000000000001100 -a 1000000000000000000
Parameters:
-s, --source
: Source chain IDs (comma-separated)-d, --destination
: Destination chain IDs (comma-separated)-r, --resources
: Resource IDs (comma-separated)-a, --amount
: Amount (comma-separated)- if a parameter is not provided, the script will use the default values which are all the valid values for the parameter
- the amount parameter is recommended to be provided only with a sepcific resource ID so that the decimals are correctly applied
# Basic usage will trigger ALL 2 ALL transfers
yarn transfer:gmp
# With specific source chains
yarn transfer:fungible -s 2,6,11
# With specific destination chains
yarn transfer:fungible -d 5,6,10
# Combining parameters
yarn transfer:fungible -s 2,6 -d 5,10
Parameters:
-s, --source
: Source chain IDs (comma-separated)-d, --destination
: Destination chain IDs (comma-separated)- if a parameter is not provided, the script will use the default values which are all the valid values for the parameter
yarn transfer:fungible_and_gmp
Be sure to set account, amount, destination, token, whitelistedSourceChains and threshold in the PostCallNoContractCall.ts file prior to running the script.
yarn postCall
Be sure to set account, amount, destination, token, whitelistedSourceChains, threshold, approvalAddress, callData, contractAddress, gasLimit and outputTokenAddress in the PostCallWithContractCall.ts file prior to running the script.
yarn postCallContract
Be sure to set account, amount, destination, token, whitelistedSourceChains, threshold, approvalAddress, callData, contractAddress, gasLimit and outputTokenAddress in the PostCallWithContractCall.ts file prior to running the script.
yarn postSwapCall