8
8
"github.com/stellar/go/xdr"
9
9
)
10
10
11
- type LedgerOutput struct {
11
+ type LedgerClosedOutput struct {
12
12
Sequence uint32 `json:"sequence"` // sequence number of the ledger
13
13
LedgerHash string `json:"ledger_hash"`
14
14
PreviousLedgerHash string `json:"previous_ledger_hash"`
@@ -32,51 +32,51 @@ type LedgerOutput struct {
32
32
TotalByteSizeOfBucketList uint64 `json:"total_byte_size_of_bucket_list"`
33
33
}
34
34
35
- func TransformLedger (lcm xdr.LedgerCloseMeta ) (LedgerOutput , error ) {
35
+ func TransformLedger (lcm xdr.LedgerCloseMeta ) (LedgerClosedOutput , error ) {
36
36
ledger := ledgers.Ledgers {
37
37
LedgerCloseMeta : lcm ,
38
38
}
39
39
40
40
outputLedgerHeader , err := xdr .MarshalBase64 (ledger .LedgerHeaderHistoryEntry ().Header )
41
41
if err != nil {
42
- return LedgerOutput {}, err
42
+ return LedgerClosedOutput {}, err
43
43
}
44
44
45
- outputSuccessfulTransactionCount , outputFailedTransactionCount , ok := ledger .GetTransactionCounts ()
45
+ outputSuccessfulTransactionCount , outputFailedTransactionCount , ok := ledger .TransactionCounts ()
46
46
if ! ok {
47
- return LedgerOutput {}, fmt .Errorf ("could not get transaction counts" )
47
+ return LedgerClosedOutput {}, fmt .Errorf ("could not get transaction counts" )
48
48
}
49
49
50
- outputOperationCount , outputTxSetOperationCount , ok := ledger .GetOperationCounts ()
50
+ outputOperationCount , outputTxSetOperationCount , ok := ledger .OperationCounts ()
51
51
if ! ok {
52
- return LedgerOutput {}, fmt .Errorf ("could not get operation counts" )
52
+ return LedgerClosedOutput {}, fmt .Errorf ("could not get operation counts" )
53
53
}
54
54
55
55
var outputSorobanFeeWrite1Kb int64
56
- sorobanFeeWrite1Kb , ok := ledger .GetSorobanFeeWrite1Kb ()
56
+ sorobanFeeWrite1Kb , ok := ledger .SorobanFeeWrite1Kb ()
57
57
if ok {
58
58
outputSorobanFeeWrite1Kb = sorobanFeeWrite1Kb
59
59
}
60
60
61
61
var outputTotalByteSizeOfBucketList uint64
62
- totalByteSizeOfBucketList , ok := ledger .GetTotalByteSizeOfBucketList ()
62
+ totalByteSizeOfBucketList , ok := ledger .TotalByteSizeOfBucketList ()
63
63
if ok {
64
64
outputTotalByteSizeOfBucketList = totalByteSizeOfBucketList
65
65
}
66
66
67
67
var outputNodeID string
68
- nodeID , ok := ledger .GetNodeID ()
68
+ nodeID , ok := ledger .NodeID ()
69
69
if ok {
70
70
outputNodeID = nodeID
71
71
}
72
72
73
73
var outputSigature string
74
- signature , ok := ledger .GetSignature ()
74
+ signature , ok := ledger .Signature ()
75
75
if ok {
76
76
outputSigature = signature
77
77
}
78
78
79
- ledgerOutput := LedgerOutput {
79
+ ledgerOutput := LedgerClosedOutput {
80
80
Sequence : ledger .LedgerSequence (),
81
81
LedgerHash : ledger .Hash (),
82
82
PreviousLedgerHash : ledger .Hash (),
0 commit comments