We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ab6c16 commit 402c030Copy full SHA for 402c030
consensus/bor/heimdall/milestone/milestone.go
@@ -1,6 +1,7 @@
1
package milestone
2
3
import (
4
+ "encoding/base64"
5
"encoding/json"
6
"fmt"
7
"strconv"
@@ -24,6 +25,7 @@ func (m *Milestone) UnmarshalJSON(data []byte) error {
24
25
temp := &struct {
26
StartBlock string `json:"start_block"`
27
EndBlock string `json:"end_block"`
28
+ Hash string `json:"hash"`
29
*Alias
30
}{
31
Alias: (*Alias)(m),
@@ -45,6 +47,12 @@ func (m *Milestone) UnmarshalJSON(data []byte) error {
45
47
}
46
48
m.EndBlock = endBlock
49
50
+ decodedHash, err := base64.StdEncoding.DecodeString(temp.Hash)
51
+ if err != nil {
52
+ return fmt.Errorf("failed to decode hash: %w", err)
53
+ }
54
+ m.Hash = common.BytesToHash(decodedHash)
55
+
56
return nil
57
58
0 commit comments