Skip to content

Commit 671f139

Browse files
authoredApr 27, 2022
🪛 Add eth_sendTransaction calls to call history (#715)
1 parent 51e05d8 commit 671f139

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
 

‎.changeset/tame-walls-speak.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ethereum-waffle/provider": patch
3+
---
4+
5+
Include eth_sendTransaction when recording call history

‎waffle-provider/src/CallHistory.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ export class CallHistory {
7777
/**
7878
* A method can be:
7979
* - `eth_call` - a query to the node,
80-
* - `eth_sendRawTransaction` - a transaction,
80+
* - `eth_sendRawTransaction` - a raw transaction,
81+
* - `eth_sendTransaction` - a transaction,
8182
* - `eth_estimateGas` - gas estimation, typically precedes `eth_sendRawTransaction`.
8283
*/
83-
if (method === 'eth_call') { // Record a query.
84+
if (method === 'eth_call' || method === 'eth_sendTransaction') { // Record a query or a transaction.
8485
callHistory.recordedCalls.push(toRecordedCall(args[0]?.params?.[0]));
85-
} else if (method === 'eth_sendRawTransaction') { // Record a transaction.
86+
} else if (method === 'eth_sendRawTransaction') { // Record a raw transaction.
8687
const parsedTx = parseTransaction(args[0]?.params?.[0]);
8788
callHistory.recordedCalls.push(toRecordedCall(parsedTx));
8889
}

0 commit comments

Comments
 (0)