From 50f00b80c1bd978a1f23fe92861eef0d73087d52 Mon Sep 17 00:00:00 2001 From: Matt Krump Date: Mon, 15 Jan 2018 11:21:08 -0600 Subject: [PATCH] Lowercase log address --- pkg/geth/log_to_core_log.go | 4 +++- pkg/geth/log_to_core_log_test.go | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/geth/log_to_core_log.go b/pkg/geth/log_to_core_log.go index f40983f4..bce6fd4c 100644 --- a/pkg/geth/log_to_core_log.go +++ b/pkg/geth/log_to_core_log.go @@ -1,6 +1,8 @@ package geth import ( + "strings" + "github.com/8thlight/vulcanizedb/pkg/core" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" @@ -13,7 +15,7 @@ func LogToCoreLog(gethLog types.Log) core.Log { hexTopics[i] = topic.Hex() } return core.Log{ - Address: gethLog.Address.Hex(), + Address: strings.ToLower(gethLog.Address.Hex()), BlockNumber: int64(gethLog.BlockNumber), Topics: hexTopics, diff --git a/pkg/geth/log_to_core_log_test.go b/pkg/geth/log_to_core_log_test.go index 44448ce3..ad15e826 100644 --- a/pkg/geth/log_to_core_log_test.go +++ b/pkg/geth/log_to_core_log_test.go @@ -1,6 +1,8 @@ package geth_test import ( + "strings" + "github.com/8thlight/vulcanizedb/pkg/core" "github.com/8thlight/vulcanizedb/pkg/geth" "github.com/ethereum/go-ethereum/common" @@ -14,7 +16,7 @@ var _ = Describe("Conversion of GethLog to core.Log", func() { It("converts geth log to internal log format", func() { gethLog := types.Log{ - Address: common.HexToAddress("0xecf8f87f810ecf450940c9f60066b4a7a501d6a7"), + Address: common.HexToAddress("0x448a5065aeBB8E423F0896E6c5D525C040f59af3"), BlockHash: common.HexToHash("0x656c34545f90a730a19008c0e7a7cd4fb3895064b48d6d69761bd5abad681056"), BlockNumber: 2019236, Data: hexutil.MustDecode("0x000000000000000000000000000000000000000000000001a055690d9db80000"), @@ -28,7 +30,7 @@ var _ = Describe("Conversion of GethLog to core.Log", func() { } expected := core.Log{ - Address: gethLog.Address.Hex(), + Address: strings.ToLower(gethLog.Address.Hex()), BlockNumber: int64(gethLog.BlockNumber), Data: hexutil.Encode(gethLog.Data), TxHash: gethLog.TxHash.Hex(),