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