From 02b53b4c49bbb23245554784511ca6f7bafaea1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCller?= Date: Tue, 10 Dec 2024 18:24:57 +0100 Subject: [PATCH] chore: return error on unexpected code path --- halo/evmstaking/evmstaking.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/halo/evmstaking/evmstaking.go b/halo/evmstaking/evmstaking.go index e1aad4906..527ba4b55 100644 --- a/halo/evmstaking/evmstaking.go +++ b/halo/evmstaking/evmstaking.go @@ -11,6 +11,7 @@ import ( "github.com/omni-network/omni/halo/genutil/evm/predeploys" "github.com/omni-network/omni/lib/errors" "github.com/omni-network/omni/lib/ethclient" + "github.com/omni-network/omni/lib/feature" "github.com/omni-network/omni/lib/k1util" "github.com/omni-network/omni/lib/log" evmenginetypes "github.com/omni-network/omni/octane/evmengine/types" @@ -73,6 +74,9 @@ func New( // Prepare returns all omni stake contract EVM event logs from the provided block hash. func (p EventProcessor) Prepare(ctx context.Context, blockHash common.Hash) ([]evmenginetypes.EVMEvent, error) { + if feature.FlagEVMStakingModule.Enabled(ctx) { + return nil, errors.New("unexpected code path [BUG]") + } logs, err := p.ethCl.FilterLogs(ctx, ethereum.FilterQuery{ BlockHash: &blockHash, Addresses: p.Addresses(), @@ -110,6 +114,9 @@ func (p EventProcessor) Addresses() []common.Address { // - CreateValidator // - Delegate. func (p EventProcessor) Deliver(ctx context.Context, _ common.Hash, elog evmenginetypes.EVMEvent) error { + if feature.FlagEVMStakingModule.Enabled(ctx) { + return errors.New("unexpected code path [BUG]") + } ethlog, err := elog.ToEthLog() if err != nil { return err