-
Notifications
You must be signed in to change notification settings - Fork 808
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return evm logs from cosmos interface (#1825)
- Loading branch information
Wojciech Małota-Wójcik
authored
Aug 30, 2024
1 parent
7aeb9d1
commit f50837e
Showing
6 changed files
with
170 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package types | ||
|
||
import ethtypes "github.com/ethereum/go-ethereum/core/types" | ||
|
||
func NewLogsFromEth(ethlogs []*ethtypes.Log) []*Log { | ||
logs := make([]*Log, 0, len(ethlogs)) | ||
for _, ethlog := range ethlogs { | ||
logs = append(logs, newLogFromEth(ethlog)) | ||
} | ||
return logs | ||
} | ||
|
||
func newLogFromEth(log *ethtypes.Log) *Log { | ||
topics := make([]string, len(log.Topics)) | ||
for i, topic := range log.Topics { | ||
topics[i] = topic.String() | ||
} | ||
|
||
return &Log{ | ||
Address: log.Address.String(), | ||
Topics: topics, | ||
Data: log.Data, | ||
Index: uint32(log.Index), | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.