aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-tracing-utils/src
diff options
context:
space:
mode:
authorJeremy Schlatter <jeremy.schlatter@gmail.com>2019-02-05 06:33:13 +0800
committerJeremy Schlatter <jeremy.schlatter@gmail.com>2019-02-05 06:33:13 +0800
commit3d2ed57c08c7e58ecc6698c87a42bafbe86a9c88 (patch)
tree0a717d16881ff82f84260452bffea8206a378bea /packages/sol-tracing-utils/src
parent74293d5bc844035781d65aa85051ef3bbb7b8b1a (diff)
downloaddexon-0x-contracts-3d2ed57c08c7e58ecc6698c87a42bafbe86a9c88.tar.gz
dexon-0x-contracts-3d2ed57c08c7e58ecc6698c87a42bafbe86a9c88.tar.zst
dexon-0x-contracts-3d2ed57c08c7e58ecc6698c87a42bafbe86a9c88.zip
Hook eth_sendRawTransaction in addition to eth_sendTransaction
Diffstat (limited to 'packages/sol-tracing-utils/src')
-rw-r--r--packages/sol-tracing-utils/src/trace_collection_subprovider.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/sol-tracing-utils/src/trace_collection_subprovider.ts b/packages/sol-tracing-utils/src/trace_collection_subprovider.ts
index 8279bda54..99f32335c 100644
--- a/packages/sol-tracing-utils/src/trace_collection_subprovider.ts
+++ b/packages/sol-tracing-utils/src/trace_collection_subprovider.ts
@@ -3,6 +3,7 @@ import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0x/subprovi
import { logUtils } from '@0x/utils';
import { CallDataRPC, marshaller, Web3Wrapper } from '@0x/web3-wrapper';
import { JSONRPCRequestPayload, Provider, TxData } from 'ethereum-types';
+import { utils } from 'ethers';
import * as _ from 'lodash';
import { Lock } from 'semaphore-async-await';
@@ -96,6 +97,18 @@ export abstract class TraceCollectionSubprovider extends Subprovider {
}
return;
+ case 'eth_sendRawTransaction':
+ if (!this._config.shouldCollectTransactionTraces) {
+ next();
+ } else {
+ const txData = utils.parseTransaction(payload.params[0]);
+ if (txData.to === null) {
+ txData.to = constants.NEW_CONTRACT;
+ }
+ next(logAsyncErrors(this._onTransactionSentAsync.bind(this, txData)));
+ }
+ return;
+
case 'eth_call':
if (!this._config.shouldCollectCallTraces) {
next();