mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
eth/catalyst: unexport testingAPI
This commit is contained in:
parent
f11bb4b632
commit
5717489b14
2 changed files with 5 additions and 5 deletions
|
|
@ -28,22 +28,22 @@ import (
|
|||
"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.
|
||||
type TestingAPI struct {
|
||||
type testingAPI struct {
|
||||
eth *eth.Ethereum
|
||||
}
|
||||
|
||||
func newTestingAPI(backend *eth.Ethereum) rpc.API {
|
||||
return rpc.API{
|
||||
Namespace: "testing",
|
||||
Service: &TestingAPI{backend},
|
||||
Service: &testingAPI{backend},
|
||||
Version: "1.0",
|
||||
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 {
|
||||
return nil, errors.New("parentHash is not current head")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ func TestBuildBlockV1(t *testing.T) {
|
|||
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)
|
||||
|
||||
api := &TestingAPI{eth: ethservice}
|
||||
api := &testingAPI{eth: ethservice}
|
||||
|
||||
t.Run("buildOnCurrentHead", func(t *testing.T) {
|
||||
envelope, err := api.BuildBlockV1(parent.Hash(), attrs, nil, nil)
|
||||
|
|
|
|||
Loading…
Reference in a new issue