From 114eb0066a31ff23c28f87671b418d7ea86961b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Tue, 18 Jun 2024 11:48:45 -0700 Subject: [PATCH] add a flag which forces value comparison --- cmd/util/cmd/diff-states/cmd.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmd/util/cmd/diff-states/cmd.go b/cmd/util/cmd/diff-states/cmd.go index ed1d13ef30a..414f7147d36 100644 --- a/cmd/util/cmd/diff-states/cmd.go +++ b/cmd/util/cmd/diff-states/cmd.go @@ -30,6 +30,7 @@ var ( flagStateCommitment1 string flagStateCommitment2 string flagRaw bool + flagAlwaysDiffValues bool flagNWorker int flagChain string ) @@ -113,6 +114,13 @@ func init() { "Raw or value", ) + Cmd.Flags().BoolVar( + &flagAlwaysDiffValues, + "always-diff-values", + false, + "always diff on value level. useful when trying to test iteration, by diffing same state.", + ) + Cmd.Flags().IntVar( &flagNWorker, "n-worker", @@ -294,6 +302,8 @@ func diffAccount( }) } + diffValues := flagAlwaysDiffValues + err = accountRegisters1.ForEach(func(owner, key string, value1 []byte) error { var value2 []byte value2, err = accountRegisters2.Get(owner, key) @@ -323,6 +333,10 @@ func diffAccount( return err } + diffValues = true + } + + if diffValues { address, err := common.BytesToAddress([]byte(owner)) if err != nil { return err