From 921cf664f1f953f193ae675ce6d4777521c7c2f7 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Mon, 30 Oct 2023 11:25:31 +0100 Subject: [PATCH] Add eth_executionAddress endpoint --- internal/ethapi/api.go | 5 +++++ suave/e2e/workflow_test.go | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 03dead53ed..44d6434592 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -2333,3 +2333,8 @@ func toHexSlice(b [][]byte) []string { } return r } + +// ExecutionAddress returns the execution addresseses available in the Kettle. +func (s *TransactionAPI) ExecutionAddress(ctx context.Context) ([]common.Address, error) { + return s.b.AccountManager().Accounts(), nil +} diff --git a/suave/e2e/workflow_test.go b/suave/e2e/workflow_test.go index 8cd8c1a89b..4440d6316a 100644 --- a/suave/e2e/workflow_test.go +++ b/suave/e2e/workflow_test.go @@ -1034,6 +1034,17 @@ func TestE2EPrecompile_Call(t *testing.T) { require.Error(t, err) } +func TestE2EExecutionAddressEndpoint(t *testing.T) { + // this end-to-end tests ensures that we can call eth_executionAddress endpoint in a MEVM node + // and return the correct execution address list + fr := newFramework(t, WithExecutionNode()) + defer fr.Close() + + var addrs []common.Address + require.NoError(t, fr.suethSrv.RPCNode().Call(&addrs, "eth_executionAddress")) + require.NotEmpty(t, addrs) +} + type clientWrapper struct { t *testing.T