2023-01-19 14:59:11 +00:00
|
|
|
// stm: #integration
|
|
|
|
package itests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
|
|
|
"github.com/filecoin-project/lotus/api"
|
|
|
|
"github.com/filecoin-project/lotus/chain/types/ethtypes"
|
|
|
|
"github.com/filecoin-project/lotus/itests/kit"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestEthFilterAPIDisabledViaConfig(t *testing.T) {
|
|
|
|
ctx := context.Background()
|
|
|
|
|
|
|
|
kit.QuietMiningLogs()
|
|
|
|
|
2023-02-01 23:50:36 +00:00
|
|
|
// pass kit.DisableEthRPC() so RealTimeFilterAPI will not be enabled
|
|
|
|
client, _, _ := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.DisableEthRPC())
|
2023-01-19 14:59:11 +00:00
|
|
|
|
|
|
|
_, err := client.EthNewPendingTransactionFilter(ctx)
|
|
|
|
require.NotNil(t, err)
|
|
|
|
require.Equal(t, err.Error(), api.ErrNotSupported.Error())
|
|
|
|
|
|
|
|
_, err = client.EthGetLogs(ctx, ðtypes.EthFilterSpec{})
|
|
|
|
require.NotNil(t, err)
|
|
|
|
require.Equal(t, err.Error(), api.ErrNotSupported.Error())
|
|
|
|
|
|
|
|
_, err = client.EthGetFilterChanges(ctx, ethtypes.EthFilterID{})
|
|
|
|
require.NotNil(t, err)
|
|
|
|
require.Equal(t, err.Error(), api.ErrNotSupported.Error())
|
|
|
|
|
|
|
|
_, err = client.EthGetFilterLogs(ctx, ethtypes.EthFilterID{})
|
|
|
|
require.NotNil(t, err)
|
|
|
|
require.Equal(t, err.Error(), api.ErrNotSupported.Error())
|
|
|
|
|
|
|
|
_, err = client.EthNewFilter(ctx, ðtypes.EthFilterSpec{})
|
|
|
|
require.NotNil(t, err)
|
|
|
|
require.Equal(t, err.Error(), api.ErrNotSupported.Error())
|
|
|
|
|
|
|
|
_, err = client.EthNewBlockFilter(ctx)
|
|
|
|
require.NotNil(t, err)
|
|
|
|
require.Equal(t, err.Error(), api.ErrNotSupported.Error())
|
|
|
|
|
|
|
|
_, err = client.EthNewPendingTransactionFilter(ctx)
|
|
|
|
require.NotNil(t, err)
|
|
|
|
require.Equal(t, err.Error(), api.ErrNotSupported.Error())
|
|
|
|
|
|
|
|
_, err = client.EthUninstallFilter(ctx, ethtypes.EthFilterID{})
|
|
|
|
require.NotNil(t, err)
|
|
|
|
require.Equal(t, err.Error(), api.ErrNotSupported.Error())
|
|
|
|
|
2023-02-02 13:26:56 +00:00
|
|
|
_, err = client.EthSubscribe(ctx, []byte{})
|
2023-01-19 14:59:11 +00:00
|
|
|
require.NotNil(t, err)
|
|
|
|
require.Equal(t, err.Error(), api.ErrNotSupported.Error())
|
|
|
|
|
|
|
|
_, err = client.EthUnsubscribe(ctx, ethtypes.EthSubscriptionID{})
|
|
|
|
require.NotNil(t, err)
|
|
|
|
require.Equal(t, err.Error(), api.ErrNotSupported.Error())
|
|
|
|
}
|