diff --git a/docker/stellar-core.cfg b/docker/stellar-core.cfg index 449e0806..753d16c7 100644 --- a/docker/stellar-core.cfg +++ b/docker/stellar-core.cfg @@ -2,6 +2,8 @@ # see https://developers.stellar.org/docs/run-core-node/ # for how to properly configure your environment +ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true + #FAILURE_SAFETY is minimum number of nodes that are allowed to fail before you no longer have quorum FAILURE_SAFETY=1 diff --git a/docker/stellar-core_futurenet.cfg b/docker/stellar-core_futurenet.cfg index ecd4873a..8ab94fb0 100644 --- a/docker/stellar-core_futurenet.cfg +++ b/docker/stellar-core_futurenet.cfg @@ -6,6 +6,8 @@ PUBLIC_HTTP_PORT=false NETWORK_PASSPHRASE="Test SDF Future Network ; October 2022" +ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true + # DATABASE="sqlite3://stellar.db" PEER_PORT=11725 diff --git a/docker/stellar-core_testnet.cfg b/docker/stellar-core_testnet.cfg index e021da5e..94502b2c 100644 --- a/docker/stellar-core_testnet.cfg +++ b/docker/stellar-core_testnet.cfg @@ -5,6 +5,8 @@ NETWORK_PASSPHRASE="Test SDF Network ; September 2015" # DATABASE="sqlite3://stellar.db" +ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true + # Stellar Testnet validators [[HOME_DOMAINS]] HOME_DOMAIN="testnet.stellar.org" diff --git a/internal/transform/diagnostic_events.go b/internal/transform/diagnostic_events.go index 46161c07..b7ade6b3 100644 --- a/internal/transform/diagnostic_events.go +++ b/internal/transform/diagnostic_events.go @@ -26,18 +26,14 @@ func TransformDiagnosticEvent(transaction ingest.LedgerTransaction, lhe xdr.Ledg return []DiagnosticEventOutput{}, fmt.Errorf("for ledger %d; transaction %d (transaction id=%d): %v", outputLedgerSequence, transactionIndex, outputTransactionID, err), false } - transactionMeta, ok := transaction.UnsafeMeta.GetV3() - if !ok { - return []DiagnosticEventOutput{}, nil, false - } - - if transactionMeta.SorobanMeta == nil { + diagnosticEvents, err := transaction.GetDiagnosticEvents() + if err != nil { return []DiagnosticEventOutput{}, nil, false } var transformedDiagnosticEvents []DiagnosticEventOutput - for _, diagnoticEvent := range transactionMeta.SorobanMeta.DiagnosticEvents { + for _, diagnoticEvent := range diagnosticEvents { var outputContractId string outputInSuccessfulContractCall := diagnoticEvent.InSuccessfulContractCall @@ -45,15 +41,9 @@ func TransformDiagnosticEvent(transaction ingest.LedgerTransaction, lhe xdr.Ledg outputExtV := event.Ext.V outputType := event.Type.String() outputBodyV := event.Body.V - body, ok := event.Body.GetV0() - if !ok { - continue - } + body, _ := event.Body.GetV0() - outputBody, err := xdr.MarshalBase64(body) - if err != nil { - continue - } + outputBody, _ := xdr.MarshalBase64(body) if event.ContractId != nil { contractId := *event.ContractId