@@ -23,31 +23,26 @@ func errChain(mappings ...error) error {
23
23
return nil
24
24
}
25
25
26
- func convertMasterchainInfo (info liteclient.LiteServerMasterchainInfoC ) ( * oas.GetRawMasterchainInfoOK , error ) {
26
+ func convertMasterchainInfo (info liteclient.LiteServerMasterchainInfoC ) * oas.GetRawMasterchainInfoOK {
27
27
convertedInfo := oas.GetRawMasterchainInfoOK {
28
28
Last : oas.BlockRaw {
29
29
Workchain : int32 (info .Last .Workchain ),
30
30
Shard : fmt .Sprintf ("%016x" , info .Last .Shard ),
31
31
Seqno : int32 (info .Last .Seqno ),
32
+ RootHash : fmt .Sprintf ("%x" , info .Last .RootHash ),
33
+ FileHash : fmt .Sprintf ("%x" , info .Last .FileHash ),
32
34
},
33
35
Init : oas.InitStateRaw {
34
36
Workchain : int32 (info .Init .Workchain ),
37
+ RootHash : fmt .Sprintf ("%x" , info .Init .RootHash ),
38
+ FileHash : fmt .Sprintf ("%x" , info .Init .FileHash ),
35
39
},
40
+ StateRootHash : fmt .Sprintf ("%x" , info .StateRootHash ),
36
41
}
37
- err := errChain (
38
- toJson (& convertedInfo .Last .RootHash , info .Last .RootHash ),
39
- toJson (& convertedInfo .Last .FileHash , info .Last .FileHash ),
40
- toJson (& convertedInfo .StateRootHash , info .StateRootHash ),
41
- toJson (& convertedInfo .Init .RootHash , info .Init .RootHash ),
42
- toJson (& convertedInfo .Init .FileHash , info .Init .FileHash ),
43
- )
44
- if err != nil {
45
- return nil , err
46
- }
47
- return & convertedInfo , nil
42
+ return & convertedInfo
48
43
}
49
44
50
- func convertMasterchainInfoExt (info liteclient.LiteServerMasterchainInfoExtC ) ( * oas.GetRawMasterchainInfoExtOK , error ) {
45
+ func convertMasterchainInfoExt (info liteclient.LiteServerMasterchainInfoExtC ) * oas.GetRawMasterchainInfoExtOK {
51
46
convertedInfo := oas.GetRawMasterchainInfoExtOK {
52
47
Mode : int32 (info .Mode ),
53
48
Version : int32 (info .Version ),
@@ -56,24 +51,19 @@ func convertMasterchainInfoExt(info liteclient.LiteServerMasterchainInfoExtC) (*
56
51
Workchain : int32 (info .Last .Workchain ),
57
52
Shard : fmt .Sprintf ("%016x" , info .Last .Shard ),
58
53
Seqno : int32 (info .Last .Seqno ),
54
+ RootHash : fmt .Sprintf ("%x" , info .Last .RootHash ),
55
+ FileHash : fmt .Sprintf ("%x" , info .Last .FileHash ),
59
56
},
60
57
LastUtime : int32 (info .LastUtime ),
61
58
Now : int32 (info .Now ),
62
59
Init : oas.InitStateRaw {
63
60
Workchain : int32 (info .Init .Workchain ),
61
+ RootHash : fmt .Sprintf ("%x" , info .Init .RootHash ),
62
+ FileHash : fmt .Sprintf ("%x" , info .Init .FileHash ),
64
63
},
64
+ StateRootHash : fmt .Sprintf ("%x" , info .StateRootHash ),
65
65
}
66
- err := errChain (
67
- toJson (& convertedInfo .Last .RootHash , info .Last .RootHash ),
68
- toJson (& convertedInfo .Last .FileHash , info .Last .FileHash ),
69
- toJson (& convertedInfo .StateRootHash , info .StateRootHash ),
70
- toJson (& convertedInfo .Init .RootHash , info .Init .RootHash ),
71
- toJson (& convertedInfo .Init .FileHash , info .Init .FileHash ),
72
- )
73
- if err != nil {
74
- return nil , err
75
- }
76
- return & convertedInfo , nil
66
+ return & convertedInfo
77
67
}
78
68
79
69
func convertBlock (block liteclient.LiteServerBlockDataC ) (* oas.GetRawBlockchainBlockOK , error ) {
0 commit comments