Merge pull request #10062 from filecoin-project/iand/issue-9849-config
itests: verify eth filter api is disabled via config
This commit is contained in:
commit
b8c4fbaff0
@ -623,6 +623,11 @@ workflows:
|
||||
suite: itest-eth_block_hash
|
||||
target: "./itests/eth_block_hash_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-eth_config
|
||||
suite: itest-eth_config
|
||||
target: "./itests/eth_config_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-eth_deploy
|
||||
suite: itest-eth_deploy
|
||||
|
62
itests/eth_config_test.go
Normal file
62
itests/eth_config_test.go
Normal file
@ -0,0 +1,62 @@
|
||||
// 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()
|
||||
|
||||
// pass kit.DisableEthRPC() so RealTimeFilterAPI will not be enabled
|
||||
client, _, _ := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.DisableEthRPC())
|
||||
|
||||
_, 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())
|
||||
|
||||
_, err = client.EthSubscribe(ctx, "newHeads", nil)
|
||||
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())
|
||||
}
|
Loading…
Reference in New Issue
Block a user