@@ -1916,29 +1916,21 @@ func NewPublicDebugAPI(b Backend) *PublicDebugAPI {
1916
1916
}
1917
1917
1918
1918
// GetHeaderRlp retrieves the RLP encoded for of a single header.
1919
- func (api * PublicDebugAPI ) GetHeaderRlp (ctx context.Context , number uint64 ) (string , error ) {
1919
+ func (api * PublicDebugAPI ) GetHeaderRlp (ctx context.Context , number uint64 ) (hexutil. Bytes , error ) {
1920
1920
header , _ := api .b .HeaderByNumber (ctx , rpc .BlockNumber (number ))
1921
1921
if header == nil {
1922
- return "" , fmt .Errorf ("header #%d not found" , number )
1922
+ return nil , fmt .Errorf ("header #%d not found" , number )
1923
1923
}
1924
- encoded , err := rlp .EncodeToBytes (header )
1925
- if err != nil {
1926
- return "" , err
1927
- }
1928
- return fmt .Sprintf ("%x" , encoded ), nil
1924
+ return rlp .EncodeToBytes (header )
1929
1925
}
1930
1926
1931
1927
// GetBlockRlp retrieves the RLP encoded for of a single block.
1932
- func (api * PublicDebugAPI ) GetBlockRlp (ctx context.Context , number uint64 ) (string , error ) {
1928
+ func (api * PublicDebugAPI ) GetBlockRlp (ctx context.Context , number uint64 ) (hexutil. Bytes , error ) {
1933
1929
block , _ := api .b .BlockByNumber (ctx , rpc .BlockNumber (number ))
1934
1930
if block == nil {
1935
- return "" , fmt .Errorf ("block #%d not found" , number )
1936
- }
1937
- encoded , err := rlp .EncodeToBytes (block )
1938
- if err != nil {
1939
- return "" , err
1931
+ return nil , fmt .Errorf ("block #%d not found" , number )
1940
1932
}
1941
- return fmt . Sprintf ( "%x" , encoded ), nil
1933
+ return rlp . EncodeToBytes ( block )
1942
1934
}
1943
1935
1944
1936
// TestSignCliqueBlock fetches the given block number, and attempts to sign it as a clique header with the
0 commit comments