Commit 47feb4af authored by Hamdi Allam's avatar Hamdi Allam

feedback about type conversion

parent f3be6521
...@@ -23,7 +23,7 @@ type BlockHeader struct { ...@@ -23,7 +23,7 @@ type BlockHeader struct {
Timestamp uint64 Timestamp uint64
} }
func BlockHeaderFromHeader(header *types.Header) BlockHeader { func BlockHeaderFromGethHeader(header *types.Header) BlockHeader {
return BlockHeader{ return BlockHeader{
Hash: header.Hash(), Hash: header.Hash(),
ParentHash: header.ParentHash, ParentHash: header.ParentHash,
......
...@@ -23,7 +23,7 @@ type ContractEvent struct { ...@@ -23,7 +23,7 @@ type ContractEvent struct {
Timestamp uint64 Timestamp uint64
} }
func ContractEventFromLog(log *types.Log, timestamp uint64) ContractEvent { func ContractEventFromGethLog(log *types.Log, timestamp uint64) ContractEvent {
return ContractEvent{ return ContractEvent{
GUID: uuid.New(), GUID: uuid.New(),
......
...@@ -35,7 +35,7 @@ func NewProcessedContractEvents() *ProcessedContractEvents { ...@@ -35,7 +35,7 @@ func NewProcessedContractEvents() *ProcessedContractEvents {
} }
func (p *ProcessedContractEvents) AddLog(log *types.Log, time uint64) *database.ContractEvent { func (p *ProcessedContractEvents) AddLog(log *types.Log, time uint64) *database.ContractEvent {
contractEvent := database.ContractEventFromLog(log, time) contractEvent := database.ContractEventFromGethLog(log, time)
p.events = append(p.events, &contractEvent) p.events = append(p.events, &contractEvent)
p.eventsBySignature[contractEvent.EventSignature] = append(p.eventsBySignature[contractEvent.EventSignature], &contractEvent) p.eventsBySignature[contractEvent.EventSignature] = append(p.eventsBySignature[contractEvent.EventSignature], &contractEvent)
......
...@@ -192,7 +192,7 @@ func l1ProcessFn(processLog log.Logger, ethClient node.EthClient, l1Contracts L1 ...@@ -192,7 +192,7 @@ func l1ProcessFn(processLog log.Logger, ethClient node.EthClient, l1Contracts L1
continue continue
} }
indexedL1Headers = append(indexedL1Headers, &database.L1BlockHeader{BlockHeader: database.BlockHeaderFromHeader(header)}) indexedL1Headers = append(indexedL1Headers, &database.L1BlockHeader{BlockHeader: database.BlockHeaderFromGethHeader(header)})
} }
/** Update Database **/ /** Update Database **/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment