@@ -33,7 +33,6 @@ import (
3333 "github.com/ethereum/go-ethereum/common"
3434 "github.com/ethereum/go-ethereum/common/hexutil"
3535 "github.com/ethereum/go-ethereum/common/math"
36- "github.com/ethereum/go-ethereum/consensus/clique"
3736 "github.com/ethereum/go-ethereum/consensus/ethash"
3837 "github.com/ethereum/go-ethereum/consensus/misc"
3938 "github.com/ethereum/go-ethereum/core"
@@ -1952,45 +1951,6 @@ func (api *PublicDebugAPI) GetBlockRlp(ctx context.Context, number uint64) (hexu
19521951 return rlp .EncodeToBytes (block )
19531952}
19541953
1955- // TestSignCliqueBlock fetches the given block number, and attempts to sign it as a clique header with the
1956- // given address, returning the address of the recovered signature
1957- //
1958- // This is a temporary method to debug the externalsigner integration,
1959- // TODO: Remove this method when the integration is mature
1960- func (api * PublicDebugAPI ) TestSignCliqueBlock (ctx context.Context , address common.Address , number uint64 ) (common.Address , error ) {
1961- block , _ := api .b .BlockByNumber (ctx , rpc .BlockNumber (number ))
1962- if block == nil {
1963- return common.Address {}, fmt .Errorf ("block #%d not found" , number )
1964- }
1965- header := block .Header ()
1966- header .Extra = make ([]byte , 32 + 65 )
1967- encoded := clique .CliqueRLP (header )
1968-
1969- // Look up the wallet containing the requested signer
1970- account := accounts.Account {Address : address }
1971- wallet , err := api .b .AccountManager ().Find (account )
1972- if err != nil {
1973- return common.Address {}, err
1974- }
1975-
1976- signature , err := wallet .SignData (account , accounts .MimetypeClique , encoded )
1977- if err != nil {
1978- return common.Address {}, err
1979- }
1980- sealHash := clique .SealHash (header ).Bytes ()
1981- log .Info ("test signing of clique block" ,
1982- "Sealhash" , fmt .Sprintf ("%x" , sealHash ),
1983- "signature" , fmt .Sprintf ("%x" , signature ))
1984- pubkey , err := crypto .Ecrecover (sealHash , signature )
1985- if err != nil {
1986- return common.Address {}, err
1987- }
1988- var signer common.Address
1989- copy (signer [:], crypto .Keccak256 (pubkey [1 :])[12 :])
1990-
1991- return signer , nil
1992- }
1993-
19941954// PrintBlock retrieves a block and returns its pretty printed form.
19951955func (api * PublicDebugAPI ) PrintBlock (ctx context.Context , number uint64 ) (string , error ) {
19961956 block , _ := api .b .BlockByNumber (ctx , rpc .BlockNumber (number ))
0 commit comments