Skip to content

Commit

Permalink
Self review
Browse files Browse the repository at this point in the history
  • Loading branch information
arijitAD committed Aug 26, 2021
1 parent 79857f8 commit ca7f7d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion statediff/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,10 @@ func (sdi *StateDiffIndexer) processReceiptsAndTxs(tx *sqlx.Tx, args processArgs

// Indexing
// extract topic and contract data from the receipt for indexing
topicSet := make([]string, 4)
mappedContracts := make(map[string]bool) // use map to avoid duplicate addresses
logDataSet := make([]*models.LogsModel, len(receipt.Logs))
for idx, l := range receipt.Logs {
topicSet := make([]string, 4)
for ti, topic := range l.Topics {
topicSet[ti] = topic.Hex()
}
Expand Down
3 changes: 1 addition & 2 deletions statediff/indexer/ipfs/ipld/eth_header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import (
"strconv"
"testing"

"github.com/ethereum/go-ethereum/core/types"
block "github.com/ipfs/go-block-format"
node "github.com/ipfs/go-ipld-format"
"github.com/multiformats/go-multihash"

"github.com/ethereum/go-ethereum/core/types"
)

func TestBlockBodyRlpParsing(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions statediff/indexer/ipfs/ipld/eth_log_trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type EthLogTrie struct {
OUTPUT
*/

// DecodeEthLogTrie returns an EthRctTrie object from its cid and rawdata.
// DecodeEthLogTrie returns an EthLogTrie object from its cid and rawdata.
func DecodeEthLogTrie(c cid.Cid, b []byte) (*EthLogTrie, error) {
tn, err := decodeTrieNode(c, b, decodeEthLogTrieLeaf)
if err != nil {
Expand All @@ -28,7 +28,7 @@ func DecodeEthLogTrie(c cid.Cid, b []byte) (*EthLogTrie, error) {
return &EthLogTrie{TrieNode: tn}, nil
}

// decodeEthLogTrieLeaf parses a eth-rct-trie leaf
// decodeEthLogTrieLeaf parses a eth-log-trie leaf
// from decoded RLP elements
func decodeEthLogTrieLeaf(i []interface{}) ([]interface{}, error) {
l := new(types.Log)
Expand Down Expand Up @@ -76,12 +76,12 @@ func (t *EthLogTrie) Loggable() map[string]interface{} {
}
}

// rctTrie wraps a localTrie for use on the receipt trie.
// logTrie wraps a localTrie for use on the receipt trie.
type logTrie struct {
*localTrie
}

// newRctTrie initializes and returns a rctTrie.
// newLogTrie initializes and returns a logTrie.
func newLogTrie() *logTrie {
return &logTrie{
localTrie: newLocalTrie(),
Expand Down

0 comments on commit ca7f7d7

Please sign in to comment.