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({