File tree Expand file tree Collapse file tree
app/components/UI/Predict/providers/polymarket
tests/api-mocking/mock-responses/polymarket Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,10 +46,12 @@ const mockFetch = jest.fn();
4646global . fetch = mockFetch ;
4747const mockQuery = jest . mocked ( query ) ;
4848const 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
5456const 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 ( ) => {
Original file line number Diff line number Diff 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 = {
You can’t perform that action at this time.
0 commit comments