Rename traceInfo.data to traceInfo.dataIfExists
This commit is contained in:
@@ -14,11 +14,11 @@ const G_COPY = 3;
|
|||||||
|
|
||||||
export const costUtils = {
|
export const costUtils = {
|
||||||
reportCallDataCost(traceInfo: TraceInfo): number {
|
reportCallDataCost(traceInfo: TraceInfo): number {
|
||||||
if (_.isUndefined(traceInfo.data)) {
|
if (_.isUndefined(traceInfo.dataIfExists)) {
|
||||||
// No call data to report
|
// No call data to report
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const callData = traceInfo.data;
|
const callData = traceInfo.dataIfExists;
|
||||||
const callDataBuf = Buffer.from(stripHexPrefix(callData), 'hex');
|
const callDataBuf = Buffer.from(stripHexPrefix(callData), 'hex');
|
||||||
const { true: zeroBytesCountIfExist, false: nonZeroBytesCountIfExist } = _.countBy(
|
const { true: zeroBytesCountIfExist, false: nonZeroBytesCountIfExist } = _.countBy(
|
||||||
callDataBuf,
|
callDataBuf,
|
||||||
|
@@ -15,7 +15,7 @@ export abstract class TraceInfoSubprovider extends TraceCollectionSubprovider {
|
|||||||
protected async _handleTraceInfoAsync(_traceInfo: TraceInfo): Promise<void> {
|
protected async _handleTraceInfoAsync(_traceInfo: TraceInfo): Promise<void> {
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
protected async _recordTxTraceAsync(address: string, data: string | undefined, txHash: string): Promise<void> {
|
protected async _recordTxTraceAsync(address: string, dataIfExists: string | undefined, txHash: string): Promise<void> {
|
||||||
await this._web3Wrapper.awaitTransactionMinedAsync(txHash, 0);
|
await this._web3Wrapper.awaitTransactionMinedAsync(txHash, 0);
|
||||||
const nodeType = await this._web3Wrapper.getNodeTypeAsync();
|
const nodeType = await this._web3Wrapper.getNodeTypeAsync();
|
||||||
let trace;
|
let trace;
|
||||||
@@ -73,7 +73,7 @@ export abstract class TraceInfoSubprovider extends TraceCollectionSubprovider {
|
|||||||
const traceInfo = {
|
const traceInfo = {
|
||||||
trace,
|
trace,
|
||||||
address,
|
address,
|
||||||
data,
|
dataIfExists,
|
||||||
txHash,
|
txHash,
|
||||||
};
|
};
|
||||||
await this._handleTraceInfoAsync(traceInfo);
|
await this._handleTraceInfoAsync(traceInfo);
|
||||||
@@ -90,7 +90,7 @@ export abstract class TraceInfoSubprovider extends TraceCollectionSubprovider {
|
|||||||
subtrace: traceForThatSubcall,
|
subtrace: traceForThatSubcall,
|
||||||
txHash,
|
txHash,
|
||||||
address: subcallAddress,
|
address: subcallAddress,
|
||||||
bytecode: data as string,
|
bytecode: dataIfExists as string,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
const runtimeBytecode = await this._web3Wrapper.getContractCodeAsync(subcallAddress);
|
const runtimeBytecode = await this._web3Wrapper.getContractCodeAsync(subcallAddress);
|
||||||
|
@@ -117,7 +117,7 @@ export interface TraceInfo {
|
|||||||
trace: TransactionTrace;
|
trace: TransactionTrace;
|
||||||
txHash: string;
|
txHash: string;
|
||||||
address: string;
|
address: string;
|
||||||
data: string | undefined;
|
dataIfExists: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum BlockParamLiteral {
|
export enum BlockParamLiteral {
|
||||||
|
Reference in New Issue
Block a user