@@ -32,7 +32,6 @@ import (
32
32
"github.com/ethereum/go-ethereum/common"
33
33
"github.com/ethereum/go-ethereum/common/hexutil"
34
34
"github.com/ethereum/go-ethereum/common/math"
35
- "github.com/ethereum/go-ethereum/consensus/clique"
36
35
"github.com/ethereum/go-ethereum/consensus/ethash"
37
36
"github.com/ethereum/go-ethereum/consensus/misc"
38
37
"github.com/ethereum/go-ethereum/core"
@@ -1875,45 +1874,6 @@ func (api *PublicDebugAPI) GetBlockRlp(ctx context.Context, number uint64) (hexu
1875
1874
return rlp .EncodeToBytes (block )
1876
1875
}
1877
1876
1878
- // TestSignCliqueBlock fetches the given block number, and attempts to sign it as a clique header with the
1879
- // given address, returning the address of the recovered signature
1880
- //
1881
- // This is a temporary method to debug the externalsigner integration,
1882
- // TODO: Remove this method when the integration is mature
1883
- func (api * PublicDebugAPI ) TestSignCliqueBlock (ctx context.Context , address common.Address , number uint64 ) (common.Address , error ) {
1884
- block , _ := api .b .BlockByNumber (ctx , rpc .BlockNumber (number ))
1885
- if block == nil {
1886
- return common.Address {}, fmt .Errorf ("block #%d not found" , number )
1887
- }
1888
- header := block .Header ()
1889
- header .Extra = make ([]byte , 32 + 65 )
1890
- encoded := clique .CliqueRLP (header )
1891
-
1892
- // Look up the wallet containing the requested signer
1893
- account := accounts.Account {Address : address }
1894
- wallet , err := api .b .AccountManager ().Find (account )
1895
- if err != nil {
1896
- return common.Address {}, err
1897
- }
1898
-
1899
- signature , err := wallet .SignData (account , accounts .MimetypeClique , encoded )
1900
- if err != nil {
1901
- return common.Address {}, err
1902
- }
1903
- sealHash := clique .SealHash (header ).Bytes ()
1904
- log .Info ("test signing of clique block" ,
1905
- "Sealhash" , fmt .Sprintf ("%x" , sealHash ),
1906
- "signature" , fmt .Sprintf ("%x" , signature ))
1907
- pubkey , err := crypto .Ecrecover (sealHash , signature )
1908
- if err != nil {
1909
- return common.Address {}, err
1910
- }
1911
- var signer common.Address
1912
- copy (signer [:], crypto .Keccak256 (pubkey [1 :])[12 :])
1913
-
1914
- return signer , nil
1915
- }
1916
-
1917
1877
// PrintBlock retrieves a block and returns its pretty printed form.
1918
1878
func (api * PublicDebugAPI ) PrintBlock (ctx context.Context , number uint64 ) (string , error ) {
1919
1879
block , _ := api .b .BlockByNumber (ctx , rpc .BlockNumber (number ))
0 commit comments