Skip to content

Commit

Permalink
some more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Aug 9, 2024
1 parent 4ebe495 commit ffc11b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions core/testing/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ package coretesting
import (
"context"

gogoproto "cosmossdk.io/core/transaction"

"cosmossdk.io/core/event"
"cosmossdk.io/core/store"
"cosmossdk.io/core/transaction"
)

type dummyKey struct{}
Expand All @@ -15,7 +14,7 @@ func Context() context.Context {
dummy := &dummyCtx{
stores: map[string]store.KVStore{},
events: map[string][]event.Event{},
protoEvents: map[string][]gogoproto.Msg{},
protoEvents: map[string][]transaction.Msg{},
}

ctx := context.WithValue(context.Background(), dummyKey{}, dummy)
Expand All @@ -28,7 +27,7 @@ type dummyCtx struct {
// maps event emitted by the actor.
events map[string][]event.Event
// maps proto events emitted by the actor.
protoEvents map[string][]gogoproto.Msg
protoEvents map[string][]transaction.Msg
}

func unwrap(ctx context.Context) *dummyCtx {
Expand Down
7 changes: 3 additions & 4 deletions core/testing/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package coretesting
import (
"context"

gogoproto "cosmossdk.io/core/transaction"

"cosmossdk.io/core/event"
"cosmossdk.io/core/transaction"
)

var _ event.Service = (*MemEventsService)(nil)
Expand All @@ -30,7 +29,7 @@ func (e MemEventsService) GetEvents(ctx context.Context) []event.Event {
return unwrap(ctx).events[e.moduleName]
}

func (e MemEventsService) GetProtoEvents(ctx context.Context) []gogoproto.Msg {
func (e MemEventsService) GetProtoEvents(ctx context.Context) []transaction.Msg {
return unwrap(ctx).protoEvents[e.moduleName]
}

Expand All @@ -39,7 +38,7 @@ type eventManager struct {
ctx *dummyCtx
}

func (e eventManager) Emit(event gogoproto.Msg) error {
func (e eventManager) Emit(event transaction.Msg) error {
e.ctx.protoEvents[e.moduleName] = append(e.ctx.protoEvents[e.moduleName], event)
return nil
}
Expand Down

0 comments on commit ffc11b8

Please sign in to comment.