diff --git a/apps/api/src/app/routes/__chainId/simulation/simulateBundle.ts b/apps/api/src/app/routes/__chainId/simulation/simulateBundle.ts index 8dee80a2..9da503d2 100644 --- a/apps/api/src/app/routes/__chainId/simulation/simulateBundle.ts +++ b/apps/api/src/app/routes/__chainId/simulation/simulateBundle.ts @@ -85,12 +85,12 @@ const successSchema = { original: { title: 'Original', description: 'Original value before the state change', - type: ['string', 'object', 'null'], + type: ['string', 'number', 'boolean', 'object', 'array', 'null'], }, dirty: { title: 'Dirty', description: 'New value after the state change', - type: ['string', 'object', 'null'], + type: ['string', 'number', 'boolean', 'object', 'array', 'null'], }, raw: { title: 'Raw Elements', diff --git a/libs/repositories/src/repos/SimulationRepository/tenderlyTypes.ts b/libs/repositories/src/repos/SimulationRepository/tenderlyTypes.ts index 0361fb44..59d76c70 100644 --- a/libs/repositories/src/repos/SimulationRepository/tenderlyTypes.ts +++ b/libs/repositories/src/repos/SimulationRepository/tenderlyTypes.ts @@ -578,8 +578,8 @@ interface LogRaw { export interface StateDiff { address: string; soltype: SoltypeElement | null; - original: string | Record | null; - dirty: string | Record | null; + original: string | number | boolean | Record | unknown[] | null; + dirty: string | number | boolean | Record | unknown[] | null; raw?: RawElement[]; } diff --git a/libs/repositories/src/utils/buildStateDiff.ts b/libs/repositories/src/utils/buildStateDiff.ts index 17a76b7c..1e1a9a27 100644 --- a/libs/repositories/src/utils/buildStateDiff.ts +++ b/libs/repositories/src/utils/buildStateDiff.ts @@ -134,9 +134,9 @@ function processRawOnlyDiff( if (!updated) { const newDiff: StateDiff = { address: diff.address, - soltype: diff.soltype || null, - original: diff.original || null, - dirty: diff.dirty || null, + soltype: diff.soltype ?? null, + original: diff.original ?? null, + dirty: diff.dirty ?? null, raw: [structuredClone(rawElement)], }; @@ -153,7 +153,8 @@ function processSingleDiff( diff: StateDiff ): StateDiff[] { // Handle regular diffs (with complete soltype, original, dirty data) - if (diff?.soltype && diff?.original && diff?.dirty) { + // Using != null (loose check) intentionally to catch both null and undefined + if (diff?.soltype != null && diff?.original != null && diff?.dirty != null) { return processRegularDiff(accumulatedStateDiff, diff); } // Handle raw-only diffs (missing soltype, original, or dirty)