@@ -35,7 +35,6 @@ import (
3535 "github.com/ethereum/go-ethereum/common/hexutil"
3636 "github.com/ethereum/go-ethereum/common/math"
3737 "github.com/ethereum/go-ethereum/consensus"
38- "github.com/ethereum/go-ethereum/consensus/clique"
3938 "github.com/ethereum/go-ethereum/consensus/ethash"
4039 "github.com/ethereum/go-ethereum/consensus/misc"
4140 "github.com/ethereum/go-ethereum/core"
@@ -2312,45 +2311,6 @@ func (api *PublicDebugAPI) GetBlockRlp(ctx context.Context, number uint64) (hexu
23122311 return rlp .EncodeToBytes (block )
23132312}
23142313
2315- // TestSignCliqueBlock fetches the given block number, and attempts to sign it as a clique header with the
2316- // given address, returning the address of the recovered signature
2317- //
2318- // This is a temporary method to debug the externalsigner integration,
2319- // TODO: Remove this method when the integration is mature
2320- func (api * PublicDebugAPI ) TestSignCliqueBlock (ctx context.Context , address common.Address , number uint64 ) (common.Address , error ) {
2321- block , _ := api .b .BlockByNumber (ctx , rpc .BlockNumber (number ))
2322- if block == nil {
2323- return common.Address {}, fmt .Errorf ("block #%d not found" , number )
2324- }
2325- header := block .Header ()
2326- header .Extra = make ([]byte , 32 + 65 )
2327- encoded := clique .CliqueRLP (header )
2328-
2329- // Look up the wallet containing the requested signer
2330- account := accounts.Account {Address : address }
2331- wallet , err := api .b .AccountManager ().Find (account )
2332- if err != nil {
2333- return common.Address {}, err
2334- }
2335-
2336- signature , err := wallet .SignData (account , accounts .MimetypeClique , encoded )
2337- if err != nil {
2338- return common.Address {}, err
2339- }
2340- sealHash := clique .SealHash (header ).Bytes ()
2341- log .Info ("test signing of clique block" ,
2342- "Sealhash" , fmt .Sprintf ("%x" , sealHash ),
2343- "signature" , fmt .Sprintf ("%x" , signature ))
2344- pubkey , err := crypto .Ecrecover (sealHash , signature )
2345- if err != nil {
2346- return common.Address {}, err
2347- }
2348- var signer common.Address
2349- copy (signer [:], crypto .Keccak256 (pubkey [1 :])[12 :])
2350-
2351- return signer , nil
2352- }
2353-
23542314// PrintBlock retrieves a block and returns its pretty printed form.
23552315func (api * PublicDebugAPI ) PrintBlock (ctx context.Context , number uint64 ) (string , error ) {
23562316 block , _ := api .b .BlockByNumber (ctx , rpc .BlockNumber (number ))
0 commit comments