Skip to content

Commit

Permalink
use stricter interface on OfType functions
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Nov 1, 2024
1 parent 422d2ed commit e97c3bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions e2e/txserver/zeta_tx_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/gogoproto/proto"
"github.com/samber/lo"
"github.com/zeta-chain/ethermint/crypto/hd"
etherminttypes "github.com/zeta-chain/ethermint/types"
Expand Down Expand Up @@ -661,7 +662,7 @@ func newFactory(clientCtx client.Context) tx.Factory {
}

// EventsOfType gets events of a specified type
func EventsOfType[T any](events []abci.Event) ([]T, bool) {
func EventsOfType[T proto.Message](events []abci.Event) ([]T, bool) {
var filteredEvents []T
for _, ev := range events {
pEvent, err := sdktypes.ParseTypedEvent(ev)
Expand All @@ -676,7 +677,7 @@ func EventsOfType[T any](events []abci.Event) ([]T, bool) {
}

// EventOfType gets one event of a specific type
func EventOfType[T any](events []abci.Event) (T, bool) {
func EventOfType[T proto.Message](events []abci.Event) (T, bool) {
var event T
for _, ev := range events {
pEvent, err := sdktypes.ParseTypedEvent(ev)
Expand Down

0 comments on commit e97c3bf

Please sign in to comment.