diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 174ed9371..83e456dea 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -631,7 +631,7 @@ var ( StateDiffFlag = cli.BoolFlag{ Name: "statediff", - Usage: "Enables the calculation of state diffs between each block, persists these state diffs the configured persistance mode.", + Usage: "Enables the calculation of state diffs between each block, persists these state diffs the configured persistence mode.", } StateDiffModeFlag = cli.StringFlag{ diff --git a/statediff/builder/builder.go b/statediff/builder/builder.go index 22178b98f..d45708c2f 100644 --- a/statediff/builder/builder.go +++ b/statediff/builder/builder.go @@ -151,7 +151,7 @@ func (sdb *builder) buildDiffEventual(accounts map[common.Address]*state.Account sr := val.Root storageDiffs, err := sdb.buildStorageDiffsEventual(sr, created) if err != nil { - log.Error("Failed building eventual storage diffs", "Address", val, "error", err) + log.Error("Failed building eventual storage diffs", "Address", addr, "error", err) return nil, err } diff --git a/statediff/config_test.go b/statediff/config_test.go index 83851b9a5..82f2d3a92 100644 --- a/statediff/config_test.go +++ b/statediff/config_test.go @@ -2,8 +2,8 @@ package statediff_test import ( "github.com/ethereum/go-ethereum/statediff" - "testing" "github.com/ethereum/go-ethereum/statediff/testhelpers" + "testing" ) func TestNewMode(t *testing.T) { diff --git a/statediff/publisher/publisher_test.go b/statediff/publisher/publisher_test.go index 073e2cb0d..714accf06 100644 --- a/statediff/publisher/publisher_test.go +++ b/statediff/publisher/publisher_test.go @@ -13,16 +13,16 @@ import ( "path/filepath" "reflect" "strconv" - "testing" "strings" + "testing" ) var ( - tempDir = os.TempDir() - testFilePrefix = "test-statediff" - publisher p.Publisher - dir string - err error + tempDir = os.TempDir() + testFilePrefix = "test-statediff" + publisher p.Publisher + dir string + err error ) var expectedCreatedAccountRow = []string{ diff --git a/statediff/service/service.go b/statediff/service/service.go index 42711339e..ce4583b65 100644 --- a/statediff/service/service.go +++ b/statediff/service/service.go @@ -65,6 +65,7 @@ func (sds *StateDiffService) Loop(events chan core.ChainEvent) { } var eventsChannel chan core.ChainEvent + func (sds *StateDiffService) Start(server *p2p.Server) error { log.Info("Starting statediff service") eventsChannel := make(chan core.ChainEvent, 10) diff --git a/statediff/testhelpers/test_data.go b/statediff/testhelpers/test_data.go index 66376dade..27d6f7c29 100644 --- a/statediff/testhelpers/test_data.go +++ b/statediff/testhelpers/test_data.go @@ -11,13 +11,10 @@ var ( BlockNumber = rand.Int63() BlockHash = "0xfa40fbe2d98d98b3363a778d52f2bcd29d6790b9b3f3cab2b167fd12d3550f73" CodeHash = "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" - OldNonceValue = rand.Uint64() - NewNonceValue = OldNonceValue + 1 - OldBalanceValue = rand.Int63() - NewBalanceValue = OldBalanceValue - 1 + NewNonceValue = rand.Uint64() + NewBalanceValue = rand.Int63() ContractRoot = "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" StoragePath = "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" - oldStorage = "0x0" newStorage = "0x03" storage = map[string]builder.DiffString{StoragePath: {Value: &newStorage}} address = common.HexToAddress("0xaE9BEa628c4Ce503DcFD7E305CaB4e29E7476592")