Skip to content

Commit

Permalink
fix: initialize involved account addresses to empty slice instead of nil
Browse files Browse the repository at this point in the history
  • Loading branch information
dadamu committed Mar 11, 2024
1 parent ff7add8 commit 2ef70b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/messages/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func DefaultMessagesParser(tx *types.Tx) ([]string, error) {
// function to remove duplicate values
func removeDuplicates(s []string) []string {
bucket := make(map[string]bool)
var result []string
result := []string{}
for _, str := range s {
if _, ok := bucket[str]; !ok {
bucket[str] = true
Expand All @@ -34,7 +34,7 @@ func removeDuplicates(s []string) []string {
}

func parseAddressesFromEvents(tx *types.Tx) []string {
var addresses []string
addresses := []string{}
for _, event := range tx.Events {
for _, attribute := range event.Attributes {
// Try parsing the address as a validator address
Expand Down

0 comments on commit 2ef70b8

Please sign in to comment.