@@ -11,7 +11,6 @@ import (
11
11
"github.com/ethereum/go-ethereum/core/types"
12
12
"github.com/ethereum/go-ethereum/ethclient"
13
13
ethrpc "github.com/ethereum/go-ethereum/rpc"
14
- "github.com/maticnetwork/polygon-cli/rpctypes"
15
14
"github.com/maticnetwork/polygon-cli/util"
16
15
"github.com/rs/zerolog/log"
17
16
"github.com/spf13/cobra"
@@ -57,31 +56,13 @@ var EcRecoverCmd = &cobra.Command{
57
56
}
58
57
}
59
58
60
- var rawBlock rpctypes. RawBlockResponse
61
- if err = json .Unmarshal (blockJSON , & rawBlock ); err != nil {
59
+ var header types. Header
60
+ if err = json .Unmarshal (blockJSON , & header ); err != nil {
62
61
log .Error ().Err (err ).Msg ("Unable to unmarshal JSON" )
63
62
return
64
63
}
65
64
66
- header := new (types.Header )
67
- pb := rpctypes .NewPolyBlock (& rawBlock )
68
- header .Extra = pb .Extra ()
69
- header .ParentHash = pb .ParentHash ()
70
- header .UncleHash = pb .UncleHash ()
71
- header .Coinbase = pb .Coinbase ()
72
- header .Root = pb .Root ()
73
- header .TxHash = pb .TxHash ()
74
- header .ReceiptHash = pb .ReceiptsRoot ()
75
- header .Bloom = types .Bloom (pb .LogsBloom ())
76
- header .Difficulty = pb .Difficulty ()
77
- header .Number = pb .Number ()
78
- header .GasLimit = pb .GasLimit ()
79
- header .GasUsed = pb .GasUsed ()
80
- header .Time = pb .Time ()
81
- header .MixDigest = pb .MixHash ()
82
- copy (header .Nonce [:], rawBlock .Nonce )
83
-
84
- block = types .NewBlockWithHeader (header )
65
+ block = types .NewBlockWithHeader (& header )
85
66
blockNumber = header .Number .Uint64 ()
86
67
} else {
87
68
var rpc * ethrpc.Client
0 commit comments