From 2581bc93e5893d43642b240d290c141f0d9419bf Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 14 Jan 2019 12:02:32 +0100 Subject: Fix the bug with incorrect source maps parsing by changing contract data from an array to a mapping --- packages/sol-tracing-utils/src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/sol-tracing-utils/src/types.ts') diff --git a/packages/sol-tracing-utils/src/types.ts b/packages/sol-tracing-utils/src/types.ts index 54ade0400..fa10a93d6 100644 --- a/packages/sol-tracing-utils/src/types.ts +++ b/packages/sol-tracing-utils/src/types.ts @@ -81,8 +81,8 @@ export interface ContractData { sourceMap: string; runtimeBytecode: string; sourceMapRuntime: string; - sourceCodes: string[]; - sources: string[]; + sourceCodes: { [sourceId: number]: string }; + sources: { [sourceId: number]: string }; } // Part of the trace executed within the same context -- cgit v1.2.3 From 4689309857126669563dc9ea0e912ec9cec74157 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 14 Jan 2019 14:43:03 +0100 Subject: Add SourceCodes and Sources types --- packages/sol-tracing-utils/src/types.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'packages/sol-tracing-utils/src/types.ts') diff --git a/packages/sol-tracing-utils/src/types.ts b/packages/sol-tracing-utils/src/types.ts index fa10a93d6..2b305c16e 100644 --- a/packages/sol-tracing-utils/src/types.ts +++ b/packages/sol-tracing-utils/src/types.ts @@ -76,13 +76,20 @@ export interface Coverage { }; } +export interface SourceCodes { + [sourceId: number]: string; +} +export interface Sources { + [sourceId: number]: string; +} + export interface ContractData { bytecode: string; sourceMap: string; runtimeBytecode: string; sourceMapRuntime: string; - sourceCodes: { [sourceId: number]: string }; - sources: { [sourceId: number]: string }; + sourceCodes: SourceCodes; + sources: Sources; } // Part of the trace executed within the same context -- cgit v1.2.3 From 83b46cbf71abd897b434ff510035171297a51255 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 14 Jan 2019 14:48:59 +0100 Subject: Rename mappins to have a direct naming scheme instead of a reverse one --- packages/sol-tracing-utils/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/sol-tracing-utils/src/types.ts') diff --git a/packages/sol-tracing-utils/src/types.ts b/packages/sol-tracing-utils/src/types.ts index 2b305c16e..27568ae03 100644 --- a/packages/sol-tracing-utils/src/types.ts +++ b/packages/sol-tracing-utils/src/types.ts @@ -16,7 +16,7 @@ export interface SingleFileSourceRange { end: LineColumn; } -export interface LocationByOffset { +export interface OffsetToLocation { [offset: number]: LineColumn; } -- cgit v1.2.3