Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 52 additions & 15 deletions .github/workflows/ci_e2e_walletkit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ env:
ROOT_PATH: wallets/rn_cli_wallet

jobs:
check-balance:
uses: ./.github/workflows/e2e-balance-check.yml
secrets:
SLACK_FAUCETBOT_WEBHOOK_URL: ${{ secrets.SLACK_FAUCETBOT_WEBHOOK_URL }}

e2e-ios:
if: inputs.platform != 'android'
needs: check-balance
if: always() && inputs.platform != 'android' # Balance alert should not block tests
Comment thread
ignaciosantise marked this conversation as resolved.
name: E2E Tests - iOS
runs-on: macos-latest-xlarge
timeout-minutes: 60
Expand Down Expand Up @@ -145,17 +151,41 @@ jobs:

- name: Run Maestro tests
id: maestro
uses: WalletConnect/actions/maestro/run@0c9875ae33fe85fa6a4110dc46c82876d91a551d
env:
APP_ID: ${{ env.MAESTRO_APP_ID }}
WPAY_CUSTOMER_KEY_MULTI_KYC: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_KYC }}
WPAY_MERCHANT_ID_MULTI_KYC: ${{ secrets.WPAY_MERCHANT_ID_MULTI_KYC }}
WPAY_CUSTOMER_KEY_MULTI_NOKYC: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_NOKYC }}
WPAY_MERCHANT_ID_MULTI_NOKYC: ${{ secrets.WPAY_MERCHANT_ID_MULTI_NOKYC }}
WPAY_CUSTOMER_KEY_SINGLE_NOKYC: ${{ secrets.WPAY_CUSTOMER_KEY_SINGLE_NOKYC }}
WPAY_MERCHANT_ID_SINGLE_NOKYC: ${{ secrets.WPAY_MERCHANT_ID_SINGLE_NOKYC }}
run: |
xcrun simctl launch "$DEVICE_ID" "$APP_ID" || true
set +e
$HOME/.maestro/bin/maestro test \
--include-tags "${{ env.MAESTRO_TAGS }}" \
--test-output-dir maestro-artifacts \
.maestro/ >maestro-output.log 2>&1
maestro_exit_code=$?
cat maestro-output.log
exit "$maestro_exit_code"

- name: Upload Maestro artifacts
if: always()
uses: actions/upload-artifact@v4
with:
app-id: ${{ env.MAESTRO_APP_ID }}
tags: ${{ env.MAESTRO_TAGS }}
wpay-customer-key-single-nokyc: ${{ secrets.WPAY_CUSTOMER_KEY_SINGLE_NOKYC }}
wpay-merchant-id-single-nokyc: ${{ secrets.WPAY_MERCHANT_ID_SINGLE_NOKYC }}
wpay-customer-key-multi-nokyc: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_NOKYC }}
wpay-merchant-id-multi-nokyc: ${{ secrets.WPAY_MERCHANT_ID_MULTI_NOKYC }}
wpay-customer-key-multi-kyc: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_KYC }}
wpay-merchant-id-multi-kyc: ${{ secrets.WPAY_MERCHANT_ID_MULTI_KYC }}
artifact-name: maestro-ios-artifacts
name: maestro-ios-artifacts
path: |
maestro-artifacts/**/*.png
maestro-artifacts/**/*.jpg
maestro-artifacts/**/*.jpeg
maestro-artifacts/**/*.mp4
maestro-artifacts/**/*.mov
maestro-artifacts/**/*.webm
maestro-artifacts/**/*.gif
maestro-output.log
if-no-files-found: warn
retention-days: 14

- name: Send Slack notification
if: failure()
Expand Down Expand Up @@ -207,7 +237,8 @@ jobs:
}

e2e-android:
if: inputs.platform != 'ios'
needs: check-balance
if: always() && inputs.platform != 'ios' # Balance alert should not block tests
name: E2E Tests - Android
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down Expand Up @@ -292,6 +323,14 @@ jobs:
- name: Run E2E tests on Android Emulator
id: maestro
uses: reactivecircus/android-emulator-runner@70f4dee990796918b78d040e3278474bdbd348a7 # v2
env:
APP_ID: ${{ env.MAESTRO_APP_ID }}
WPAY_CUSTOMER_KEY_MULTI_KYC: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_KYC }}
WPAY_MERCHANT_ID_MULTI_KYC: ${{ secrets.WPAY_MERCHANT_ID_MULTI_KYC }}
WPAY_CUSTOMER_KEY_MULTI_NOKYC: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_NOKYC }}
WPAY_MERCHANT_ID_MULTI_NOKYC: ${{ secrets.WPAY_MERCHANT_ID_MULTI_NOKYC }}
WPAY_CUSTOMER_KEY_SINGLE_NOKYC: ${{ secrets.WPAY_CUSTOMER_KEY_SINGLE_NOKYC }}
WPAY_MERCHANT_ID_SINGLE_NOKYC: ${{ secrets.WPAY_MERCHANT_ID_SINGLE_NOKYC }}
with:
api-level: 34
arch: x86_64
Expand All @@ -306,9 +345,7 @@ jobs:
disable-animations: true
script: |
adb install ${{ env.ROOT_PATH }}/android/app/build/outputs/apk/internal/app-internal.apk
$HOME/.maestro/bin/maestro test --env APP_ID="${{ env.MAESTRO_APP_ID }}" --env WPAY_CUSTOMER_KEY_MULTI_KYC="${{ secrets.WPAY_CUSTOMER_KEY_MULTI_KYC }}" --env WPAY_MERCHANT_ID_MULTI_KYC="${{ secrets.WPAY_MERCHANT_ID_MULTI_KYC }}" --env WPAY_CUSTOMER_KEY_MULTI_NOKYC="${{ secrets.WPAY_CUSTOMER_KEY_MULTI_NOKYC }}" --env WPAY_MERCHANT_ID_MULTI_NOKYC="${{ secrets.WPAY_MERCHANT_ID_MULTI_NOKYC }}" --env WPAY_CUSTOMER_KEY_SINGLE_NOKYC="${{ secrets.WPAY_CUSTOMER_KEY_SINGLE_NOKYC }}" --env WPAY_MERCHANT_ID_SINGLE_NOKYC="${{ secrets.WPAY_MERCHANT_ID_SINGLE_NOKYC }}" --include-tags "${{ env.MAESTRO_TAGS }}" --test-output-dir maestro-artifacts .maestro/ >maestro-output.log 2>&1; echo $? > maestro-exit-code
cat maestro-output.log
exit $(cat maestro-exit-code)
set +e; $HOME/.maestro/bin/maestro test --include-tags "${{ env.MAESTRO_TAGS }}" --test-output-dir maestro-artifacts .maestro/ >maestro-output.log 2>&1; maestro_exit_code=$?; cat maestro-output.log; exit "$maestro_exit_code"

- name: Upload Maestro artifacts
if: always()
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/e2e-balance-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
schedule:
- cron: '0 * * * *' # Every hour
workflow_dispatch: {}
workflow_call:
secrets:
SLACK_FAUCETBOT_WEBHOOK_URL:
required: false

permissions:
contents: read
Expand Down
21 changes: 16 additions & 5 deletions wallets/rn_cli_wallet/scripts/revoke-permit2-approval.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ const MIN_PRIORITY_FEE_GWEI_BY_CHAIN = {
function printUsage() {
const supportedChains = Object.keys(USDT_BY_CHAIN).join(', ');
console.log(`Usage:
yarn permit2:revoke --chainId <eip155:chainId|chainId> --walletAddress <0x...> --privateKey <0x...> --projectId <projectId> [--tokenAddress <0x...>] [--minPriorityFeeGwei <number>]
yarn permit2:revoke --chainId <eip155:chainId|chainId> --walletAddress <0x...> --privateKey <0x...> (--projectId <projectId> | --rpcUrl <url>) [--tokenAddress <0x...>] [--minPriorityFeeGwei <number>]

Example:
yarn permit2:revoke --chainId eip155:137 --walletAddress 0xYourAddress --privateKey 0xYourPrivateKey --projectId yourProjectId
yarn permit2:revoke --chainId eip155:42161 --walletAddress 0xYourAddress --privateKey 0xYourPrivateKey --rpcUrl https://arb1.arbitrum.io/rpc

Defaults:
If --tokenAddress is omitted, the script uses the USDT address for the selected chain.
If --rpcUrl is provided it takes precedence over --projectId (use this for chains where the
WalletConnect Blockchain API gates methods like eth_blockNumber, e.g. Arbitrum).
For Polygon (eip155:137), min priority fee defaults to 25 gwei.
Supported USDT chains: ${supportedChains}
`);
Expand Down Expand Up @@ -144,7 +147,7 @@ function extractMinTipFromError(error) {

function getWalletConnectRpcUrl(chainId, projectId) {
if (!projectId) {
throw new Error('Missing --projectId');
throw new Error('Missing --projectId (or pass --rpcUrl to use a custom RPC).');
}

return `${WALLETCONNECT_RPC_BASE_URL}?chainId=${encodeURIComponent(chainId)}&projectId=${encodeURIComponent(projectId)}`;
Expand All @@ -166,8 +169,15 @@ async function buildFeeOverrides({
from: signerAddress,
});
const feeData = await provider.getFeeData();
const latestBlock = await provider.getBlock('latest');
const baseFeePerGas = latestBlock?.baseFeePerGas || ethers.constants.Zero;
let baseFeePerGas = ethers.constants.Zero;
try {
const latestBlock = await provider.getBlock('latest');
baseFeePerGas = latestBlock?.baseFeePerGas || ethers.constants.Zero;
} catch (error) {
console.log(
`Skipping baseFee read (${error instanceof Error ? error.message : String(error)}); falling back to feeData.`,
);
}

const hasEip1559FeeData =
!!feeData.maxFeePerGas ||
Expand Down Expand Up @@ -224,14 +234,15 @@ async function main() {
args.minPriorityFeeGwei,
);
const projectId = String(args.projectId || '').trim();
const rpcUrlOverride = String(args.rpcUrl || '').trim();

if (!USDT_BY_CHAIN[chainId] && !args.tokenAddress) {
throw new Error(
`No default USDT address configured for ${chainId}. Pass --tokenAddress explicitly.`,
);
}

const rpcUrl = getWalletConnectRpcUrl(chainId, projectId);
const rpcUrl = rpcUrlOverride || getWalletConnectRpcUrl(chainId, projectId);
const chainIdNumber = Number(chainId.split(':')[1]);
const provider = new ethers.providers.StaticJsonRpcProvider(rpcUrl, {
chainId: chainIdNumber,
Expand Down
Loading