From 39055244e25b0bf8d34f5f5037c28c4dab6f5dd6 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Thu, 9 Nov 2023 12:05:05 +0800 Subject: [PATCH] remove test --- .../eth/filters/filter_system_test.go | 66 ------------------- 1 file changed, 66 deletions(-) delete mode 100644 rpc/namespaces/ethereum/eth/filters/filter_system_test.go diff --git a/rpc/namespaces/ethereum/eth/filters/filter_system_test.go b/rpc/namespaces/ethereum/eth/filters/filter_system_test.go deleted file mode 100644 index 908ded0f45..0000000000 --- a/rpc/namespaces/ethereum/eth/filters/filter_system_test.go +++ /dev/null @@ -1,66 +0,0 @@ -package filters - -import ( - "context" - "os" - "sync" - "testing" - "time" - - "github.com/cometbft/cometbft/libs/log" - coretypes "github.com/cometbft/cometbft/rpc/core/types" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/filters" - "github.com/ethereum/go-ethereum/rpc" - "github.com/evmos/ethermint/rpc/ethereum/pubsub" -) - -func makeSubscription(id, event string) *Subscription { - return &Subscription{ - id: rpc.ID(id), - typ: filters.LogsSubscription, - event: event, - created: time.Now(), - logs: make(chan []*ethtypes.Log), - hashes: make(chan []common.Hash), - headers: make(chan *ethtypes.Header), - eventCh: make(chan coretypes.ResultEvent), - err: make(chan error), - } -} - -func TestFilterSystem(t *testing.T) { - index := make(filterIndex) - for i := filters.UnknownSubscription; i < filters.LastIndexSubscription; i++ { - index[i] = make(map[rpc.ID]*Subscription) - } - es := &EventSystem{ - logger: log.NewTMLogger(log.NewSyncWriter(os.Stdout)), - ctx: context.Background(), - lightMode: false, - index: index, - topicChans: make(map[string]chan<- coretypes.ResultEvent, len(index)), - indexMux: new(sync.RWMutex), - uninstall: make(chan *Subscription), - eventBus: pubsub.NewEventBus(), - } - go es.eventLoop() - - event := "event" - sub := makeSubscription("1", event) - ch, ok := es.topicChans[sub.event] - if !ok { - t.Error("expect topic channel exist") - } - - sub = makeSubscription("2", event) - newCh, ok := es.topicChans[sub.event] - if !ok { - t.Error("expect topic channel exist") - } - - if newCh != ch { - t.Error("expect topic channel unchanged") - } -}