Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sync dev from private to public repository #2509

Merged
merged 33 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6679d93
fix(tests): failing unit and integration tests (#167)
takenagain Oct 1, 2024
f8a7e51
add arbitrum coin type (#166)
naezith Oct 3, 2024
643c2db
Enable Test Coins Setting (#165)
naezith Oct 3, 2024
b66b703
chore(deps): Upgrade deps/Flutter and add support for native mobile b…
takenagain Oct 7, 2024
ad626a0
DEX Swap form gets filled with URL parameters (#162)
naezith Oct 9, 2024
aea8776
fix onPopPage deprecated (#172)
naezith Oct 17, 2024
0a3a594
add are you sure prompt at close/refresh (#173)
naezith Oct 17, 2024
357e4b4
fix(log-export): cross platform log export (#174)
takenagain Oct 23, 2024
476eab3
feat(fiat-on-ramp): cross-platform fiat on-ramp (#170)
takenagain Oct 28, 2024
db1db2d
Private Key Export (#183)
naezith Nov 15, 2024
2c49ac1
Hot-fix for CDN fallback of missing coin icons (#180)
CharlVS Nov 22, 2024
e3e1c98
fix(lp-tools): ux inconsistency and coin amounts while order is being…
takenagain Nov 25, 2024
22d547c
feat(system-time-check): add fallback world time apis (#182)
takenagain Nov 25, 2024
ccf5faf
feature: kdf sdk integration part 1 - startup (#177)
takenagain Nov 26, 2024
4c448c8
bump sdk version (#190)
takenagain Dec 9, 2024
b7e71d4
update kdf hashes in build_config (#189)
smk762 Dec 9, 2024
f406ff5
Merge coin icon fallback
CharlVS Nov 12, 2024
8371a91
Fix zero balance issue of tokens without parent coin gas (#186)
naezith Dec 17, 2024
6981e8e
fix(trezor): breaking hd wallet balance status rpc (#194)
takenagain Dec 20, 2024
3f7d01a
limit max_connected to 1 for electrum activation (#195)
takenagain Dec 24, 2024
aa2f3ac
Disable trading features
CharlVS Jan 6, 2025
07ac6d6
bug: Fix incorrect wallet mode logic
CharlVS Jan 6, 2025
34cd3c8
feat: Hide incorrect time banner in wallet-only mode
CharlVS Jan 6, 2025
a9e1f85
Bug: Fix missing coin detail buttons in wallet-only mode
CharlVS Jan 6, 2025
998f3ca
fix: missing conditional wallet mode check
CharlVS Jan 7, 2025
9b3f5bd
SDK Integration & HD Coin Details page + Coin Addresses (#178)
naezith Jan 7, 2025
17a2a1e
hide trading bot setting
naezith Jan 8, 2025
536b31d
default to wallet route parser if wallet only
naezith Jan 8, 2025
a0af4f1
Merge branch 'main' into merge/dev-hotfixes-v0_8_2
takenagain Jan 9, 2025
d8f9460
add removed max maker vol models
takenagain Jan 9, 2025
c1971e3
fix merge conflicts with moved/modified code
takenagain Jan 9, 2025
3491155
wallet only logout confirmation description
naezith Jan 9, 2025
600976c
Merge branch 'dev' into disable-trading-bot-setting
naezith Jan 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
63 changes: 63 additions & 0 deletions .github/actions/code-coverage/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Code Coverage"
description: "Generates and uploads code coverage report"
inputs:
test_file:
description: "The test file to run"
required: false
default: "test_units/main.dart"
runs:
using: "composite"
steps:
- name: Code Coverage
continue-on-error: false
shell: bash
run: |
echo "Running code coverage"
if [ "$RUNNER_OS" == "Linux" ]; then
echo "Installing lcov..."
sudo apt-get update -qq -y 2>&1 > /dev/null
sudo apt-get install lcov -y 2>&1 > /dev/null
echo "lcov has been successfully installed."
elif [ "$RUNNER_OS" == "macOS" ]; then
if ! command -v brew &> /dev/null; then
echo "Homebrew is not installed. Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Check if installation was successful
if [ $? -eq 0 ]; then
echo "Homebrew has been successfully installed."
else
echo "Failed to install Homebrew. Please check the error messages above and try again."
exit 1
fi
fi

brew install lcov
else
echo "Unsupported operating system"
exit 1
fi
flutter test --coverage ${{ inputs.test_file }} 2>&1 > /dev/null && \
echo "Generated code coverage report" || \
echo "ERROR: Failed to generate code coverage report"

echo "Generating HTML report from lcov.info..."
genhtml -q coverage/lcov.info -o coverage/html && \
echo "Generated code coverage report" || \
echo "ERROR: Failed to generate code coverage report"

zip -q -r coverage-html.zip coverage/html && \
echo "Created coverage-html.zip" || \
echo "ERROR: Failed to compress coverage/html into a ZIP archive"
echo "Done running code coverage"

- name: Upload Code Coverage Report
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-lcov.info
path: ./coverage/lcov.info

- name: Upload Code Coverage HTML Report
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-coverage-html
path: ./coverage-html.zip
20 changes: 20 additions & 0 deletions .github/actions/flutter-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Flutter Dependencies"
description: "Installs Flutter and any other dependencies required for the build"
runs:
using: "composite"
steps:
- name: Get stable flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.27.x"
channel: "stable"

- name: Prepare build directory
shell: bash
run: |
flutter clean
rm -rf build/*
rm -rf web/src/mm2/*
rm -rf web/src/kdfi/*
rm -rf web/dist/*

43 changes: 43 additions & 0 deletions .github/actions/generate-assets/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Generates assets"
description: "Runs the flutter build command to transform and generate assets for the deployment build"

inputs:
GITHUB_TOKEN:
description: "The GitHub API public readonly token"
required: true
runs:
using: "composite"
steps:
- name: Fetch packages and generate assets
shell: bash
env:
GITHUB_API_PUBLIC_READONLY_TOKEN: ${{ inputs.GITHUB_TOKEN }}
run: |
echo "Running \`flutter build\` to generate assets for the deployment build"

if [ -n "$GITHUB_API_PUBLIC_READONLY_TOKEN" ]; then
echo "GITHUB_TOKEN provided, running flutter build with token"
else
echo "GITHUB_TOKEN not provided or empty, running flutter build without token"
unset GITHUB_API_PUBLIC_READONLY_TOKEN
fi

# Run flutter build once to download coin icons and config files.
# This step is expected to "fail", since flutter build has to run again
# after the assets are downloaded to register them in AssetManifest.bin
flutter pub get > /dev/null 2>&1
flutter build web --release > /dev/null 2>&1 || true
rm -rf build/*

# Run flutter build and capture its output and exit status
flutter pub get > /dev/null 2>&1
output=$(flutter build web --release)
exit_status=$?

# Check if the exit status is non-zero (indicating an error)
if [ $exit_status -ne 0 ]; then
echo "Flutter build exited with status $exit_status. Output:"
echo "$output"
exit $exit_status
fi
echo "Done fetching packages and generating assets"
79 changes: 79 additions & 0 deletions .github/actions/validate-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: "Validate build"
description: "Checks that all the necessary files are present in the build directory"
runs:
using: "composite"
steps:
- name: Validate build
continue-on-error: false
shell: bash
run: |
COIN_ASSETS_DIR=build/web/assets/packages/komodo_defi_framework/assets

# Check that the web build folder contains a wasm file in the format build/web/kdf/*.wasm
if [ ! -f build/web/kdf/kdf/bin/*.wasm ]; then
echo "Error: Web build failed. No wasm file found in build/web/kdf/kdf/bin"
# List files for debugging
echo "Listing files in build/web recursively"
ls -R build/web

echo "Listing files in web recursively"
ls -R web

exit 1
fi

# Check that the index.html is present and that it is equal to the source index.html
if ! cmp -s web/index.html build/web/index.html; then
echo "Error: Web build failed. index.html is not equal to the source index.html"
exit 1
fi

# Decode the AssetManifest.bin and check for the coin icon presence
if [ ! -f build/web/assets/AssetManifest.bin ]; then
echo "Error: AssetManifest.bin file not found."
exit 1
fi
if ! strings build/web/assets/AssetManifest.bin | grep -qi "assets/coin_icons/png/kmd.png"; then
echo "Error: Coin icon not found in AssetManifest.bin"
echo "Output of case-invariant grep on build/web/assets/AssetManifest.bin"
strings build/web/assets/AssetManifest.bin | grep -i "assets/coin_icons/png/kmd.png"
echo "Listing kmd png files in assets/coin_icons/png"
ls -R build/web/assets | grep kmd.png
if ! strings build/web/assets/AssetManifest.bin | grep -qi "assets/coin_icons/png/kmd.png"; then
echo "Error: Coin icon not found in AssetManifest.bin"
exit 1
fi
fi

# Check that app_build/build_config.json is present, is valid json
# and does not contain "LAST_RUN" in the first line (invalid json format)
if [ ! -f app_build/build_config.json ]; then
echo "Error: build_config.json file not found."
exit 1
fi
if ! jq . app_build/build_config.json > /dev/null; then
echo "Error: build_config.json is not valid json"
exit 1
fi

# Check that $COIN_ASSETS_DIR/config/coins.json is present, is valid json
# and does not contain "LAST_RUN" in the first line (invalid json format)
if [ ! -f $COIN_ASSETS_DIR/config/coins.json ]; then
echo "Error: coins.json file not found."
exit 1
fi
if ! jq . $COIN_ASSETS_DIR/config/coins.json > /dev/null; then
echo "Error: coins.json is not valid json"
exit 1
fi

# Check that $COIN_ASSETS_DIR/config/coins_config.json is present, is valid json
# and does not contain "LAST_RUN" in the first line (invalid json format)
if [ ! -f $COIN_ASSETS_DIR/config/coins_config.json ]; then
echo "Error: coins_config.json file not found."
exit 1
fi
if ! jq . $COIN_ASSETS_DIR/config/coins_config.json > /dev/null; then
echo "Error: coins_config.json is not valid json"
exit 1
fi
83 changes: 15 additions & 68 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: Deploy to Firebase Hosting on merge
# Deploys a Release Candidate build to Firebase Hosting (https://walletrc.web.app) when pushing/merging commits into the `dev` branch.
name: Deploy RC to Firebase Hosting on merge
run-name: ${{ github.actor }} is deploying RC build to Firebase 🚀

on:
push:
branches:
- dev

jobs:
build_and_deploy:
runs-on: ubuntu-latest
Expand All @@ -21,74 +25,16 @@ jobs:
- name: Setup GH Actions
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Get stable flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.x'
channel: 'stable'

- name: Prepare build directory
run: |
flutter clean
rm -rf build/*
rm -rf web/src/mm2/*
rm -rf web/src/kdfi/*
rm -rf web/dist/*

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Flutter and dependencies
uses: ./.github/actions/flutter-deps

- name: Fetch packages and generate assets
run: |
echo "Running \`flutter build\` to generate assets for the deployment build"
flutter pub get > /dev/null 2>&1
flutter build web --release > /dev/null 2>&1 || true
flutter pub get > /dev/null 2>&1
echo "Done fetching packages and generating assets"

- name: Build Komodo Wallet web
run: |
flutter doctor -v
flutter build web --csp --profile --no-web-resources-cdn

uses: ./.github/actions/generate-assets
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Validate build
run: |
# Check that the web build folder contains a file with format build/web/dist/*.wasm
if [ ! -f build/web/dist/*.wasm ]; then
echo "Error: Web build failed. No wasm file found in build/web/dist/"

echo "Listing files in build/web recursively"
ls -R build/web

echo "Listing files in web recursively"
ls -R web

exit 1
fi
# Check that the index.html is present and that it is equal to the source index.html
if ! cmp -s web/index.html build/web/index.html; then
echo "Error: Web build failed. index.html is not equal to the source index.html"
exit 1
fi
# Check that the index.html has uncommitted changes to ensure that the placeholder was replaced with the generated content
if git diff --exit-code web/index.html; then
echo "Error: Web build failed. index.html has no uncommitted changes which indicates an issue with the \`template.html\` to \`index.html\` generation"
exit 1
fi
# Decode the AssetManifest.bin and check for the coin icon presence
if [ ! -f build/web/assets/AssetManifest.bin ]; then
echo "Error: AssetManifest.bin file not found."
exit 1
fi
if ! strings build/web/assets/AssetManifest.bin | grep -q "assets/coin_icons/png/kmd.png"; then
echo "Error: Coin icon not found in AssetManifest.bin"
exit 1
fi
uses: ./.github/actions/validate-build

- name: Deploy Komodo Wallet Web dev preview (`dev` branch)
if: github.ref == 'refs/heads/dev'
Expand All @@ -100,12 +46,13 @@ jobs:
target: walletrc
projectId: komodo-wallet-official

- name: Deploy Komodo Wallet Web RC (`master` branch)
if: github.ref == 'refs/heads/master'
- name: Deploy Komodo Wallet Web RC (`main` branch)
if: github.ref == 'refs/heads/main'
uses: FirebaseExtended/[email protected]
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_KOMODO_WALLET_OFFICIAL }}'
channelId: live
target: prodrc
projectId: komodo-wallet-official

Loading
Loading