diff --git a/src/wallet.test.ts b/src/wallet.test.ts index b61a8d85..c9c61eb8 100644 --- a/src/wallet.test.ts +++ b/src/wallet.test.ts @@ -137,7 +137,11 @@ describe('wallet', () => { expect(sendTxResult).toBeDefined(); expect(sendTxResult).toStrictEqual(testTxHash); expect(witnessedTxParams).toHaveLength(1); - expect(witnessedTxParams[0]).toStrictEqual(txParams); + expect(witnessedTxParams[0]).toStrictEqual({ + from: testAddresses[0], + data: '0x0', + input: '0x0', + }); }); it('processes transaction with input field but without data field', async () => { @@ -161,8 +165,9 @@ describe('wallet', () => { expect(sendTxResult).toStrictEqual(testTxHash); expect(witnessedTxParams).toHaveLength(1); expect(witnessedTxParams[0]).toStrictEqual({ - from: txParams.from, - data: txParams.input, + from: testAddresses[0], + data: '0x0', + input: '0x0', }); }); @@ -188,8 +193,9 @@ describe('wallet', () => { expect(sendTxResult).toStrictEqual(testTxHash); expect(witnessedTxParams).toHaveLength(1); expect(witnessedTxParams[0]).toStrictEqual({ - from: txParams.from, - data: txParams.data, + from: testAddresses[0], + data: '0x0', + input: '0x0', }); }); @@ -227,6 +233,7 @@ describe('wallet', () => { from: testAddresses[0], to: testAddresses[1], data: '0x0', + input: '0x0', }; const payload = { method: 'eth_sendTransaction', params: [txParams] }; diff --git a/src/wallet.ts b/src/wallet.ts index 0b5941a2..4d4e5c07 100644 --- a/src/wallet.ts +++ b/src/wallet.ts @@ -172,9 +172,11 @@ WalletMiddlewareOptions): JsonRpcMiddleware { } const txParamsData = data || input; - const txParams: TransactionParams & { data?: string } = { + const txParams: TransactionParams & { data?: string; input?: string } = { ...restParams, - ...(txParamsData ? { data: txParamsData } : undefined), + ...(txParamsData + ? { data: txParamsData, input: txParamsData } + : undefined), from: await validateAndNormalizeKeyholder(from || '', req), }; res.result = await processTransaction(txParams, req);