diff --git a/cmd/soroban-rpc/internal/methods/simulate_transaction.go b/cmd/soroban-rpc/internal/methods/simulate_transaction.go index 2a26b08a..0fc318c2 100644 --- a/cmd/soroban-rpc/internal/methods/simulate_transaction.go +++ b/cmd/soroban-rpc/internal/methods/simulate_transaction.go @@ -398,13 +398,15 @@ func NewSimulateTransactionHandler(logger *log.Entry, ledgerEntryReader db.Ledge switch request.Format { case FormatJSON: - simResp.TransactionDataJSON, err = xdr2json.ConvertBytes( - xdr.SorobanTransactionData{}, - result.TransactionData) - if err != nil { - return SimulateTransactionResponse{ - Error: err.Error(), - LatestLedger: latestLedger, + if len(result.TransactionData) > 0 { + simResp.TransactionDataJSON, err = xdr2json.ConvertBytes( + xdr.SorobanTransactionData{}, + result.TransactionData) + if err != nil { + return SimulateTransactionResponse{ + Error: err.Error(), + LatestLedger: latestLedger, + } } }