Skip to content

Commit 54705e7

Browse files
committed
fix: swap broadcasts, ref #4750
1 parent 51320f9 commit 54705e7

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

src/app/pages/swap/alex-swap-container.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { LoadingKeys, useLoading } from '@app/common/hooks/use-loading';
1919
import { useWalletType } from '@app/common/use-wallet-type';
2020
import { NonceSetter } from '@app/components/nonce-setter';
2121
import { defaultFeesMinValues } from '@app/query/stacks/fees/fees.hooks';
22-
import { useStacksPendingTransactions } from '@app/query/stacks/mempool/mempool.hooks';
2322
import { useCurrentStacksAccount } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';
2423
import { useGenerateStacksContractCallUnsignedTx } from '@app/store/transactions/contract-call.hooks';
2524
import { useSignStacksTransaction } from '@app/store/transactions/transaction.hooks';
@@ -43,12 +42,13 @@ function AlexSwapContainer() {
4342
const currentAccount = useCurrentStacksAccount();
4443
const generateUnsignedTx = useGenerateStacksContractCallUnsignedTx();
4544
const signTx = useSignStacksTransaction();
46-
const { transactions: pendingTransactions } = useStacksPendingTransactions();
4745
const { whenWallet } = useWalletType();
4846

47+
// Setting software to false until we revisit:
48+
// https://github.com/leather-wallet/extension/issues/4750
4949
const isSponsoredByAlex = whenWallet({
5050
ledger: false,
51-
software: !pendingTransactions.length,
51+
software: false,
5252
});
5353

5454
const {

tests/specs/swap/swap.spec.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { test } from '../../fixtures/fixtures';
22

3-
const alexSdkPostRoute = 'https://*.alexlab.co/v1/graphql';
43
const hiroApiPostRoute = '*/**/v2/transactions';
54

65
test.describe('Swaps', () => {
@@ -36,20 +35,11 @@ test.describe('Swaps', () => {
3635
});
3736

3837
test('that the swap is broadcast', async ({ swapPage }) => {
39-
let requestPromise;
40-
const isSponsoredSwap = swapPage.page.getByText('Sponsored');
41-
42-
if (isSponsoredSwap) {
43-
requestPromise = swapPage.page.waitForRequest(alexSdkPostRoute);
44-
await swapPage.page.route(alexSdkPostRoute, async route => {
45-
await route.abort();
46-
});
47-
} else {
48-
requestPromise = swapPage.page.waitForRequest(hiroApiPostRoute);
49-
await swapPage.page.route(alexSdkPostRoute, async route => {
50-
await route.abort();
51-
});
52-
}
38+
const requestPromise = swapPage.page.waitForRequest(hiroApiPostRoute);
39+
40+
await swapPage.page.route(hiroApiPostRoute, async route => {
41+
await route.abort();
42+
});
5343

5444
await swapPage.inputSwapAmountFrom();
5545
await swapPage.selectAssetToReceive();

0 commit comments

Comments
 (0)