Skip to content

Commit

Permalink
Pass ledger pointer instead of entire object
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya1702 committed Nov 1, 2024
1 parent 7bc1d6f commit 686545d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/soroban-rpc/internal/methods/get_ledgers.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (h ledgersHandler) parseLedgerInfo(ledger xdr.LedgerCloseMeta, format strin
switch format {
case FormatJSON:
var convErr error
ledgerInfo.LedgerMetadataJSON, ledgerInfo.LedgerHeaderJSON, convErr = ledgerToJSON(ledger)
ledgerInfo.LedgerMetadataJSON, ledgerInfo.LedgerHeaderJSON, convErr = ledgerToJSON(&ledger)
if convErr != nil {
return ledgerInfo, convErr
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/soroban-rpc/internal/methods/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ func transactionToJSON(tx db.Transaction) (
return result, envelope, resultMeta, nil
}

func ledgerToJSON(meta xdr.LedgerCloseMeta) ([]byte, []byte, error) {
func ledgerToJSON(meta *xdr.LedgerCloseMeta) ([]byte, []byte, error) {
var err error
var closeMetaJSON, headerJSON []byte

closeMetaJSON, err = xdr2json.ConvertInterface(meta)
closeMetaJSON, err = xdr2json.ConvertInterface(*meta)
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit 686545d

Please sign in to comment.