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

test(aptos): bridge integration tests #8721

Open
wants to merge 23 commits into
base: feat/integrate-aptos
Choose a base branch
from
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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Account } from "@ledgerhq/live-common/e2e/enum/Account";
import { Fee } from "@ledgerhq/live-common/e2e/enum/Fee";
import { OperationType } from "@ledgerhq/live-common/e2e/enum/OperationType";
import { getEnv } from "@ledgerhq/live-env";
import { addBugLink, addTmsLink } from "tests/utils/allureUtils";
import { CLI } from "tests/utils/cliUtils";
import { test } from "../../fixtures/common";
import { Transaction } from "../../models/Transaction";
import { addTmsLink, addBugLink } from "tests/utils/allureUtils";
import { getDescription } from "../../utils/customJsonReporter";
import { CLI } from "tests/utils/cliUtils";
import { getEnv } from "@ledgerhq/live-env";

//Warning 🚨: XRP Tests may fail due to API HTTP 429 issue - Jira: LIVE-14237

Expand Down
44 changes: 22 additions & 22 deletions libs/ledger-live-common/src/__tests__/test-helpers/bridge.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
import invariant from "invariant";
import { AmountRequired, InvalidAddress, RecipientRequired } from "@ledgerhq/errors";
import { getDefaultAccountName } from "@ledgerhq/live-wallet/accountName";
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
import type {
Account,
AccountBridge,
AccountLike,
AccountRawLike,
CurrenciesData,
DatasetTest,
SubAccount,
SyncConfig,
TransactionCommon,
TransactionStatusCommon,
} from "@ledgerhq/types-live";
import { BigNumber } from "bignumber.js";
import { reduce, filter, map } from "rxjs/operators";
import invariant from "invariant";
import flatMap from "lodash/flatMap";
import omit from "lodash/omit";
import { InvalidAddress, RecipientRequired, AmountRequired } from "@ledgerhq/errors";
import { firstValueFrom } from "rxjs";
import { filter, map, reduce } from "rxjs/operators";
import {
fromAccountRaw,
toAccountRaw,
decodeAccountId,
encodeAccountId,
flattenAccounts,
fromAccountRaw,
isAccountBalanceUnconfirmed,
toAccountRaw,
} from "../../account";
import { getAccountBridge, getCurrencyBridge } from "../../bridge";
import { getCryptoCurrencyById } from "../../currencies";
import { getOperationAmountNumber } from "../../operation";
import { fromTransactionRaw, toTransactionRaw, toTransactionStatusRaw } from "../../transaction";
import { getAccountBridge, getCurrencyBridge } from "../../bridge";
import { mockDeviceWithAPDUs, releaseMockDevice } from "./mockDevice";
import type {
Account,
AccountBridge,
AccountLike,
AccountRawLike,
SubAccount,
SyncConfig,
DatasetTest,
CurrenciesData,
TransactionCommon,
TransactionStatusCommon,
} from "@ledgerhq/types-live";
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
import { firstValueFrom } from "rxjs";
import { getDefaultAccountName } from "@ledgerhq/live-wallet/accountName";

const warnDev = process.env.CI ? (..._args) => {} : (...msg) => console.warn(...msg);
// FIXME move out into DatasetTest to be defined in
Expand Down Expand Up @@ -500,7 +500,7 @@ export function testBridge<T extends TransactionCommon>(data: DatasetTest<T>): v
function expectStability(t, patch) {
const t2 = bridge.updateTransaction(t, patch);
const t3 = bridge.updateTransaction(t2, patch);
expect(t2).toBe(t3);
expect(t2).toStrictEqual(t3);
}

makeTest("ref stability on empty transaction", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import winston from "winston";
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
import { EnvName, setEnv, setEnvUnsafe } from "@ledgerhq/live-env";
import { listen } from "@ledgerhq/logs";
import winston from "winston";
import { liveConfig } from "../../config/sharedConfig";
import { setSupportedCurrencies } from "../../currencies";
import { EnvName, setEnvUnsafe, setEnv } from "@ledgerhq/live-env";
import { setWalletAPIVersion } from "../../wallet-api/version";
import { WALLET_API_VERSION } from "../../wallet-api/constants";
import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
import { liveConfig } from "../../config/sharedConfig";
import { setWalletAPIVersion } from "../../wallet-api/version";

setWalletAPIVersion(WALLET_API_VERSION);
setSupportedCurrencies([
Expand Down Expand Up @@ -104,6 +104,7 @@ setSupportedCurrencies([
"zksync",
"zksync_sepolia",
"mantra",
"aptos",
"xion",
]);
LiveConfig.setConfig(liveConfig);
Expand Down
Loading
Loading