eth/catalyst: unexport testingAPI

This commit is contained in:
Felix Lange 2026-02-20 23:14:37 +01:00
parent f11bb4b632
commit 5717489b14
2 changed files with 5 additions and 5 deletions

View file

@ -28,22 +28,22 @@ import (
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
) )
// TestingAPI implements the testing_ namespace. // testingAPI implements the testing_ namespace.
// It's an engine-API adjacent namespace for testing purposes. // It's an engine-API adjacent namespace for testing purposes.
type TestingAPI struct { type testingAPI struct {
eth *eth.Ethereum eth *eth.Ethereum
} }
func newTestingAPI(backend *eth.Ethereum) rpc.API { func newTestingAPI(backend *eth.Ethereum) rpc.API {
return rpc.API{ return rpc.API{
Namespace: "testing", Namespace: "testing",
Service: &TestingAPI{backend}, Service: &testingAPI{backend},
Version: "1.0", Version: "1.0",
Authenticated: false, Authenticated: false,
} }
} }
func (api *TestingAPI) BuildBlockV1(parentHash common.Hash, payloadAttributes engine.PayloadAttributes, transactions *[]hexutil.Bytes, extraData *hexutil.Bytes) (*engine.ExecutionPayloadEnvelope, error) { func (api *testingAPI) BuildBlockV1(parentHash common.Hash, payloadAttributes engine.PayloadAttributes, transactions *[]hexutil.Bytes, extraData *hexutil.Bytes) (*engine.ExecutionPayloadEnvelope, error) {
if api.eth.BlockChain().CurrentBlock().Hash() != parentHash { if api.eth.BlockChain().CurrentBlock().Hash() != parentHash {
return nil, errors.New("parentHash is not current head") return nil, errors.New("parentHash is not current head")
} }

View file

@ -46,7 +46,7 @@ func TestBuildBlockV1(t *testing.T) {
currentNonce, _ := ethservice.APIBackend.GetPoolNonce(context.Background(), testAddr) currentNonce, _ := ethservice.APIBackend.GetPoolNonce(context.Background(), testAddr)
tx, _ := types.SignTx(types.NewTransaction(currentNonce, testAddr, big.NewInt(1), params.TxGas, big.NewInt(params.InitialBaseFee*2), nil), types.LatestSigner(ethservice.BlockChain().Config()), testKey) tx, _ := types.SignTx(types.NewTransaction(currentNonce, testAddr, big.NewInt(1), params.TxGas, big.NewInt(params.InitialBaseFee*2), nil), types.LatestSigner(ethservice.BlockChain().Config()), testKey)
api := &TestingAPI{eth: ethservice} api := &testingAPI{eth: ethservice}
t.Run("buildOnCurrentHead", func(t *testing.T) { t.Run("buildOnCurrentHead", func(t *testing.T) {
envelope, err := api.BuildBlockV1(parent.Hash(), attrs, nil, nil) envelope, err := api.BuildBlockV1(parent.Hash(), attrs, nil, nil)