new fields in eth.receipt_cids to index contract addresses seen in

logs; handle null dst/contract addrs in trxs/rcts
This commit is contained in:
Ian Norden
2020-04-04 15:45:54 -05:00
parent 1d05938b25
commit aa9f78a028
27 changed files with 441 additions and 346 deletions
+12 -3
View File
@@ -20,6 +20,7 @@ import (
"bytes"
"github.com/ethereum/go-ethereum/common"
"github.com/vulcanize/vulcanizedb/pkg/ipfs"
)
@@ -53,10 +54,18 @@ func ListContainsGap(gapList []Gap, gap Gap) bool {
return false
}
// HandleNullAddr converts a nil pointer to an address to a zero-valued hex address string
func HandleNullAddr(to *common.Address) string {
// HandleNullAddrPointer will return an emtpy string for a nil address pointer
func HandleNullAddrPointer(to *common.Address) string {
if to == nil {
return "0x0000000000000000000000000000000000000000000000000000000000000000"
return ""
}
return to.Hex()
}
// HandleNullAddr will return an empty string for a a null address
func HandleNullAddr(to common.Address) string {
if to.Hex() == "0x0000000000000000000000000000000000000000" {
return ""
}
return to.Hex()
}