@@ -32,7 +32,6 @@ import (
3232 "github.com/ethereum/go-ethereum/common"
3333 "github.com/ethereum/go-ethereum/common/hexutil"
3434 "github.com/ethereum/go-ethereum/common/math"
35- "github.com/ethereum/go-ethereum/consensus/clique"
3635 "github.com/ethereum/go-ethereum/consensus/ethash"
3736 "github.com/ethereum/go-ethereum/consensus/misc"
3837 "github.com/ethereum/go-ethereum/core"
@@ -1875,45 +1874,6 @@ func (api *PublicDebugAPI) GetBlockRlp(ctx context.Context, number uint64) (hexu
18751874 return rlp .EncodeToBytes (block )
18761875}
18771876
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-
19171877// PrintBlock retrieves a block and returns its pretty printed form.
19181878func (api * PublicDebugAPI ) PrintBlock (ctx context.Context , number uint64 ) (string , error ) {
19191879 block , _ := api .b .BlockByNumber (ctx , rpc .BlockNumber (number ))
0 commit comments