From 90e57e08cc77ae77ae836a3263cd097024cc4b77 Mon Sep 17 00:00:00 2001 From: Siegfried Puchbauer Date: Mon, 29 Mar 2021 18:45:16 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20enable=20reconciliation?= =?UTF-8?q?=20of=20struct=20data=20by=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This changes the default behavior to attempt to reconcile the shape of structs from tuples in ABI information by default. If names are not provided in the ABI definition for tuple components, then reconciliation will fail gracfully. BREAKING CHANGE: Output of decoded transactions and events may look different with the change of the default behavior. Set `reconcileStructShapeFromTuples` to false in ethlogger.yaml to restore the behavior of previous versions. --- defaults.ethlogger.yaml | 2 +- src/config.ts | 2 +- test/config.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/defaults.ethlogger.yaml b/defaults.ethlogger.yaml index 6cabc67..186b59f 100644 --- a/defaults.ethlogger.yaml +++ b/defaults.ethlogger.yaml @@ -65,7 +65,7 @@ abi: fingerprintContracts: true requireContractMatch: true decodeAnonymous: true - reconcileStructShapeFromTuples: false + reconcileStructShapeFromTuples: true contractInfo: maxCacheEntries: 25000 blockWatcher: diff --git a/src/config.ts b/src/config.ts index dc1fe55..e53c8fe 100644 --- a/src/config.ts +++ b/src/config.ts @@ -785,7 +785,7 @@ export async function loadEthloggerConfig(flags: CliFlags, dryRun: boolean = fal fingerprintContracts: defaults.abi?.fingerprintContracts ?? true, requireContractMatch: defaults.abi?.requireContractMatch ?? true, decodeAnonymous: defaults.abi?.decodeAnonymous ?? true, - reconcileStructShapeFromTuples: defaults.abi?.reconcileStructShapeFromTuples ?? false, + reconcileStructShapeFromTuples: defaults.abi?.reconcileStructShapeFromTuples ?? true, }, blockWatcher: { enabled: diff --git a/test/config.test.ts b/test/config.test.ts index a703068..4efb70f 100644 --- a/test/config.test.ts +++ b/test/config.test.ts @@ -15,7 +15,7 @@ test('defaults', async () => { "decodeAnonymous": true, "directory": undefined, "fingerprintContracts": true, - "reconcileStructShapeFromTuples": false, + "reconcileStructShapeFromTuples": true, "requireContractMatch": true, }, "blockWatcher": Object {