From c0b4b2bf79e01728c0bebc95fd5aa33371670a00 Mon Sep 17 00:00:00 2001 From: Snezhkko Date: Sun, 2 Nov 2025 16:04:13 +0200 Subject: [PATCH] Update api.go --- signer/core/api.go | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/signer/core/api.go b/signer/core/api.go index 12acf925f0..d4d3857794 100644 --- a/signer/core/api.go +++ b/signer/core/api.go @@ -497,19 +497,21 @@ func logDiff(original *SignTxRequest, new *SignTxResponse) bool { modified = true log.Info("Value changed by UI", "was", v0, "is", v1) } - if d0, d1 := original.Transaction.Data, new.Transaction.Data; d0 != d1 { - d0s := "" - d1s := "" - if d0 != nil { - d0s = hexutil.Encode(*d0) - } - if d1 != nil { - d1s = hexutil.Encode(*d1) - } - if d1s != d0s { - modified = true - log.Info("Data changed by UI", "was", d0s, "is", d1s) - } + // Compare effective calldata (prefer Input over Data) + var oldData, newData []byte + if original.Transaction.Input != nil { + oldData = *original.Transaction.Input + } else if original.Transaction.Data != nil { + oldData = *original.Transaction.Data + } + if new.Transaction.Input != nil { + newData = *new.Transaction.Input + } else if new.Transaction.Data != nil { + newData = *new.Transaction.Data + } + if !bytes.Equal(oldData, newData) { + modified = true + log.Info("Data changed by UI", "was", hexutil.Encode(oldData), "is", hexutil.Encode(newData)) } if n0, n1 := original.Transaction.Nonce, new.Transaction.Nonce; n0 != n1 { modified = true