Skip to content

Commit

Permalink
:wq
Browse files Browse the repository at this point in the history
erge branch 'develop' of github.com:LedgerHQ/ledger-live into feat/support-app-install
  • Loading branch information
chrisduma-ledger committed Nov 22, 2024
2 parents 1fbfcc9 + a6c762e commit 5d823c9
Show file tree
Hide file tree
Showing 216 changed files with 3,538 additions and 1,385 deletions.
6 changes: 6 additions & 0 deletions .changeset/afraid-poems-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"ledger-live-desktop": minor
"live-mobile": minor
---

Improve MEV analytics
5 changes: 5 additions & 0 deletions .changeset/blue-pigs-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

fix style for a completed sell tx
5 changes: 5 additions & 0 deletions .changeset/curly-pets-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

Fix flaky portfolio e2e test
5 changes: 5 additions & 0 deletions .changeset/dirty-walls-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

Add reborn landing pages
5 changes: 5 additions & 0 deletions .changeset/hot-cameras-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

broadcasting on e2e tests only on scheduled workflows on Monday
5 changes: 5 additions & 0 deletions .changeset/khaki-llamas-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/live-common": minor
---

swap history works for DEX swaps
9 changes: 9 additions & 0 deletions .changeset/slow-tips-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@ledgerhq/coin-polkadot": minor
"@ledgerhq/coin-stellar": minor
"@ledgerhq/coin-tezos": minor
"@ledgerhq/coin-xrp": minor
"@ledgerhq/coin-framework": minor
---

Alpaca allows delegate and undelegate tx crafting
5 changes: 5 additions & 0 deletions .changeset/thin-planets-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

Add swap related analytic events
5 changes: 5 additions & 0 deletions .changeset/tidy-baboons-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

Landing Page Sticky CTA Content Card
7 changes: 7 additions & 0 deletions .changeset/two-pigs-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@ledgerhq/coin-vechain": minor
"live-mobile": minor
"@ledgerhq/live-common": minor
---

move vechain to its own coin module
43 changes: 0 additions & 43 deletions .github/workflows/changeset-enforce.yml

This file was deleted.

22 changes: 18 additions & 4 deletions .github/workflows/test-mobile-e2e-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ permissions:
id-token: write
contents: read

env:
SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.11
COINAPPS: ${{ github.workspace }}/coin-apps

jobs:
detox-tests-ios:
name: "LLM - iOS Detox Tests"
runs-on: [m1, ARM64]
if: ${{ !inputs.speculos_tests }}
env:
NODE_OPTIONS: "--max-old-space-size=7168"
LANG: en_US.UTF-8
Expand Down Expand Up @@ -89,7 +94,7 @@ jobs:
id: detox-build
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile/ios/build/Build/Products/Release-iphonesimulator
key: ${{ runner.os }}-detox-${{ hashFiles('apps/ledger-live-mobile/ios/Podfile.lock', 'apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj', 'apps/ledger-live-mobile/detox.config.js') }}
key: ${{ runner.os }}-detox-${{ hashFiles('apps/ledger-live-mobile/ios/Podfile.lock', 'apps/ledger-live-mobile/ios/ledgerlivemobile.xcodeproj/project.pbxproj', 'apps/ledger-live-mobile/detox.config.js', 'apps/ledger-live-mobile/.env.mock') }}
accessKey: ${{ env.AWS_ACCESS_KEY_ID }}
secretKey: ${{ env.AWS_SECRET_ACCESS_KEY }}
sessionToken: ${{ env.AWS_SESSION_TOKEN}}
Expand Down Expand Up @@ -121,10 +126,21 @@ jobs:
- name: Build JS Bundle app for Detox test run
if: steps.detox-build.outputs.cache-hit == 'true'
run: pnpm mobile e2e:ci -p ios --bundle
- name: Setup Speculos image and Coin Apps
if: ${{ inputs.speculos_tests }}
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-speculos_image@develop
with:
coinapps_path: ${{ env.COINAPPS }}
speculos_tag: ${{ env.SPECULOS_IMAGE_TAG }}
bot_id: ${{ secrets.GH_BOT_APP_ID }}
bot_key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
- name: Test iOS app
id: detox
timeout-minutes: 75
run: pnpm mobile e2e:ci -p ios -t
run: pnpm mobile e2e:ci -p ios -t $([[ "$INPUT_SPECULOS" == "true" ]] && printf %s '--speculos')
env:
SEED: ${{ secrets.SEED_QAA_B2C }}
INPUT_SPECULOS: ${{ inputs.speculos_tests }}
- name: Delete iOS simulator
if: ${{ always() && steps.simulator.outputs.id }}
run: |
Expand Down Expand Up @@ -180,8 +196,6 @@ jobs:
AVD_CORES: 4
AVD_RAM_SIZE: 4096M
AVD_OPTIONS: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.11
COINAPPS: ${{ github.workspace }}/coin-apps
outputs:
status: ${{ steps.detox.outcome }}
steps:
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/test-ui-e2e-only-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ on:
required: false
type: string
default: "B2CQA-2461"
enable_send_test:
description: Enable broadcast
required: false
type: boolean
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name != 'develop' && github.ref || github.run_id }}
Expand All @@ -61,7 +56,6 @@ jobs:
CI_OS: "ubuntu-latest"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
SPECULOS_IMAGE_TAG: ghcr.io/ledgerhq/speculos:0.11
ENABLE_BROADCAST_TEST: ${{ inputs.enable_send_test }}
runs-on: [ledger-live-4xlarge]
strategy:
fail-fast: false
Expand All @@ -73,16 +67,6 @@ jobs:
with:
ref: ${{ inputs.ref || github.sha }}

- name: Setup broadcast environment variables
id: set-env
run: |
day=$(date +%u)
if [ $day -eq 1 ] || "$ENABLE_BROADCAST_TEST" = "1" ; then
echo "ENABLE_TRANSACTION_BROADCAST=1" >> $GITHUB_ENV
else
echo "DISABLE_TRANSACTION_BROADCAST=1" >> $GITHUB_ENV
fi
- name: Setup caches
id: caches
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ LLD is using vite and will import in priority the esm libs so we need to watch a

```bash
# watch common
pnpm watch:common
pnpm watch:es:common

# watch ljs
pnpm watch:es:ljs
Expand Down
14 changes: 14 additions & 0 deletions apps/ledger-live-desktop/src/renderer/analytics/segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
languageSelector,
lastSeenDeviceSelector,
localeSelector,
mevProtectionSelector,
shareAnalyticsSelector,
sharePersonalizedRecommendationsSelector,
sidebarCollapsedSelector,
Expand Down Expand Up @@ -77,6 +78,17 @@ const getLedgerSyncAttributes = (state: State) => {
};
};

const getMEVAttributes = (state: State) => {
if (!analyticsFeatureFlagMethod) return false;
const mevProtection = analyticsFeatureFlagMethod("llMevProtection");

const hasMEVActivated = mevProtectionSelector(state);

return {
MEVProtectionActivated: !mevProtection?.enabled ? "Null" : hasMEVActivated ? "Yes" : "No",
};
};

const getPtxAttributes = () => {
if (!analyticsFeatureFlagMethod) return {};
const fetchAdditionalCoins = analyticsFeatureFlagMethod("fetchAdditionalCoins");
Expand Down Expand Up @@ -148,6 +160,7 @@ const extraProperties = (store: ReduxStore) => {
const ptxAttributes = getPtxAttributes();

const ledgerSyncAtributes = getLedgerSyncAttributes(state);
const mevProtectionAtributes = getMEVAttributes(state);

const deviceInfo = device
? {
Expand Down Expand Up @@ -203,6 +216,7 @@ const extraProperties = (store: ReduxStore) => {
...ptxAttributes,
...deviceInfo,
...ledgerSyncAtributes,
...mevProtectionAtributes,
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function TransactionBroadcastedContent(props: TransactionBroadcastedConte
)}
{mode === ExchangeModeEnum.Sell && sourceCurrency && (
<>
<Box>
<Box justifyContent="center" flex={1}>
<SellCompleted />
</Box>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { getMainAccount } from "@ledgerhq/live-common/account/index";
import LowGasAlertBuyMore from "~/renderer/families/evm/SendAmountFields/LowGasAlertBuyMore";
import TranslatedError from "~/renderer/components/TranslatedError";
import Alert from "~/renderer/components/Alert";
import { useTrack } from "~/renderer/analytics/segment";

type Props = {
setTransaction: SwapTransactionType["setTransaction"];
Expand All @@ -36,6 +37,7 @@ export default function FeesDrawerLiveApp({
disableSlowStrategy = false,
}: Props) {
const swapDefaultTrack = useGetSwapTrackingProperties();
const track = useTrack();

const [isOpen, setIsOpen] = useState(true);
const [transaction, setTransactionState] = useState(initialTransaction);
Expand Down Expand Up @@ -67,6 +69,15 @@ export default function FeesDrawerLiveApp({
(updater: (arg0: Transaction) => Transaction) => {
setTransactionState(prevTransaction => {
let updatedTransaction = updater(prevTransaction);

if (prevTransaction.feesStrategy !== updatedTransaction.feesStrategy) {
track("button_clicked", {
...swapDefaultTrack,
button: updatedTransaction.feesStrategy,
page: "quoteSwap",
});
}

bridge
.prepareTransaction(mainAccount, updatedTransaction)
.then(preparedTransaction =>
Expand All @@ -84,7 +95,7 @@ export default function FeesDrawerLiveApp({
return updatedTransaction;
});
},
[setTransaction, bridge, mainAccount],
[setTransaction, bridge, mainAccount, swapDefaultTrack, track],
);

const mapStrategies = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const Navbar = () => {
);

const onWrappedTabChange = (nextIndex: number) => {
track("button_clicked2", {
button: `${swapRoutes[nextIndex].name} Tab`,
track("button_clicked", {
button: `${swapRoutes[nextIndex].name}`,
page: "Page Swap Form",
...swapDefaultTrack,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const SWAP_VERSION = "2.35";
const SWAP_TRACKING_PROPERTIES = {
swapVersion: SWAP_VERSION,
flow: "swap",
live_app: "swap",
};

export const useGetSwapTrackingProperties = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { languageSelector } from "~/renderer/reducers/settings";
import { useSelector } from "react-redux";
import { useRemoteLiveAppManifest } from "@ledgerhq/live-common/platform/providers/RemoteLiveAppProvider/index";
import { useLocalLiveAppManifest } from "@ledgerhq/live-common/wallet-api/LocalLiveAppProvider/index";
import { useTrack } from "~/renderer/analytics/segment";
import { useGetSwapTrackingProperties } from "../exchange/Swap2/utils";

type Props = {
match: {
Expand All @@ -31,6 +33,8 @@ type Props = {

export function LiveApp({ match, appId: propsAppId, location }: Props) {
const history = useHistory();
const track = useTrack();
const swapTrackingProperties = useGetSwapTrackingProperties();
const { params: internalParams, search } = location;
const { state: urlParams, customDappUrl } = useLocation() as ReturnType<typeof useLocation> &
Props["location"] & {
Expand All @@ -55,7 +59,17 @@ export function LiveApp({ match, appId: propsAppId, location }: Props) {
);
}, [search, customDappUrl, urlParams?.customDappUrl, internalParams?.customDappUrl]);

const handleClose = useCallback(() => history.push(returnTo || `/platform`), [history, returnTo]);
const handleClose = useCallback(() => {
if (returnTo.startsWith("/swap")) {
track("button_click", {
...swapTrackingProperties,
button: "close X",
partner: appId,
page: "swap",
});
}
history.push(returnTo || `/platform`);
}, [history, returnTo, appId, swapTrackingProperties, track]);
const themeType = useTheme().colors.palette.type;
const lang = useSelector(languageSelector);
const params = {
Expand Down
2 changes: 0 additions & 2 deletions apps/ledger-live-desktop/src/sentry/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ const ignoreErrors = [
"CantOpenDevice",
"could not read from HID device",
"DeviceOnDashboardExpected",
"DisconnectedDevice",
"DisconnectedDeviceDuringOperation",
"EthAppPleaseEnableContractData",
"VechainAppPleaseEnableContractDataAndMultiClause",
"failed with status code",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from "tests/page/abstractClasses";
import { step } from "tests/misc/reporters/step";
import { Account } from "tests/enum/Account";
import { Account } from "@ledgerhq/live-common/e2e/enum/Account";

export class Drawer extends Component {
readonly content = this.page.getByTestId("drawer-content");
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/tests/families/algorand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
pressUntilTextFound,
containsSubstringInEvent,
} from "@ledgerhq/live-common/e2e/speculos";
import { DeviceLabels } from "tests/enum/DeviceLabels";
import { DeviceLabels } from "@ledgerhq/live-common/e2e/enum/DeviceLabels";

export async function sendAlgorand(tx: Transaction) {
const events = await pressUntilTextFound(DeviceLabels.CAPS_APPROVE);
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/tests/families/bitcoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
waitFor,
containsSubstringInEvent,
} from "@ledgerhq/live-common/e2e/speculos";
import { DeviceLabels } from "tests/enum/DeviceLabels";
import { DeviceLabels } from "@ledgerhq/live-common/e2e/enum/DeviceLabels";

export async function sendBTCBasedCoin(tx: Transaction) {
const events = await pressUntilTextFound(DeviceLabels.ACCEPT);
Expand Down
Loading

0 comments on commit 5d823c9

Please sign in to comment.