From 8543663ca626adfbb5cffdefc6505b461a5fb05c Mon Sep 17 00:00:00 2001 From: tmcgroul Date: Tue, 20 Feb 2024 15:33:53 +0300 Subject: [PATCH] update evm trace schema definition --- .../evm-processor/fix-schema_2024-02-20-12-33.json | 10 ++++++++++ evm/evm-processor/src/interfaces/evm.ts | 2 +- evm/evm-processor/src/mapping/schema.ts | 6 +++--- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 common/changes/@subsquid/evm-processor/fix-schema_2024-02-20-12-33.json diff --git a/common/changes/@subsquid/evm-processor/fix-schema_2024-02-20-12-33.json b/common/changes/@subsquid/evm-processor/fix-schema_2024-02-20-12-33.json new file mode 100644 index 000000000..5d3cfda3f --- /dev/null +++ b/common/changes/@subsquid/evm-processor/fix-schema_2024-02-20-12-33.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@subsquid/evm-processor", + "comment": "update evm trace schema definition", + "type": "minor" + } + ], + "packageName": "@subsquid/evm-processor" +} \ No newline at end of file diff --git a/evm/evm-processor/src/interfaces/evm.ts b/evm/evm-processor/src/interfaces/evm.ts index b14872f66..3fe6436ef 100644 --- a/evm/evm-processor/src/interfaces/evm.ts +++ b/evm/evm-processor/src/interfaces/evm.ts @@ -101,7 +101,7 @@ export interface EvmTraceCreateAction { export interface EvmTraceCreateResult { gasUsed: bigint code: Bytes - address: Bytes20 + address?: Bytes20 } diff --git a/evm/evm-processor/src/mapping/schema.ts b/evm/evm-processor/src/mapping/schema.ts index ebbfb6781..16cc7ad8d 100644 --- a/evm/evm-processor/src/mapping/schema.ts +++ b/evm/evm-processor/src/mapping/schema.ts @@ -125,8 +125,8 @@ export function getTraceFrameValidator(fields: FieldSelection['trace'], forArchi address: fields?.createResultAddress }, { gasUsed: QTY, - code: BYTES, - address: BYTES + code: withDefault('0x', BYTES), + address: option(BYTES) }) let TraceCreate = object({ @@ -158,7 +158,7 @@ export function getTraceFrameValidator(fields: FieldSelection['trace'], forArchi output: fields?.callResultOutput }, { gasUsed: QTY, - output: BYTES + output: withDefault('0x', BYTES) }) let TraceCall = object({