Skip to content

Commit d31d2a0

Browse files
committed
fix: lint
1 parent 1ba0dcb commit d31d2a0

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

app/components/UI/Predict/providers/polymarket/utils.test.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ const mockFetch = jest.fn();
4646
global.fetch = mockFetch;
4747
const mockQuery = jest.mocked(query);
4848
const mockEthQuery = jest.mocked(EthQuery);
49-
const mockNetworkController = Engine.context.NetworkController as {
50-
findNetworkClientIdByChainId: jest.Mock;
51-
getNetworkClientById: jest.Mock;
52-
};
49+
const mockFindNetworkClientIdByChainId = jest.mocked(
50+
Engine.context.NetworkController.findNetworkClientIdByChainId,
51+
);
52+
const mockGetNetworkClientById = jest.mocked(
53+
Engine.context.NetworkController.getNetworkClientById,
54+
);
5355

5456
const apiKeyCreds = {
5557
apiKey: 'api-key',
@@ -73,12 +75,12 @@ describe('polymarket utils', () => {
7375
beforeEach(() => {
7476
jest.clearAllMocks();
7577
mockSignTypedMessage.mockResolvedValue('0xsig');
76-
mockNetworkController.findNetworkClientIdByChainId.mockReturnValue(
77-
'test-network-client-id',
78-
);
79-
mockNetworkController.getNetworkClientById.mockReturnValue({
78+
mockFindNetworkClientIdByChainId.mockReturnValue('test-network-client-id');
79+
mockGetNetworkClientById.mockReturnValue({
8080
provider: {},
81-
});
81+
} as ReturnType<
82+
typeof Engine.context.NetworkController.getNetworkClientById
83+
>);
8284
});
8385

8486
it('creates API keys against the canonical CLOB host', async () => {

tests/api-mocking/mock-responses/polymarket/polymarket-mocks.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,10 +1073,9 @@ export const POLYMARKET_USDC_BALANCE_MOCKS = async (
10731073
body?.method === 'eth_sendRawTransaction' ||
10741074
body?.method === 'eth_sendTransaction'
10751075
) {
1076-
// Return a unique 32-byte hash per call so cross-chain transactions
1077-
// (e.g. Polygon deposit + Linea relay) don't share the same hash.
1078-
txHashCounter++;
1079-
result = `0x${txHashCounter.toString(16).padStart(64, '0')}`;
1076+
// A valid 32-byte tx hash is required; returning `0x` breaks submission and the
1077+
// activity list never shows Predict withdraw (or any) transactions.
1078+
result = MOCK_RPC_RESPONSES.TRANSACTION_RECEIPT_RESULT.transactionHash;
10801079
} else if (body?.method === 'eth_getBlockByNumber') {
10811080
// Return block details to enable EIP-1559 transactions
10821081
result = {

0 commit comments

Comments
 (0)