From 384b96557d1fac607fa8f831391307e0023989c6 Mon Sep 17 00:00:00 2001 From: Simon Chow Date: Tue, 12 Dec 2023 14:22:28 -0500 Subject: [PATCH] Add soroban function symbol params --- README.md | 8 ++++---- internal/transform/operation.go | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8135aa08..1501fa3c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The Stellar-ETL is a data pipeline that allows users to extract data from the hi - [export_contract_data (futurenet, testnet)](#export_contract_data) - [export_contract_code (futurenet, testnet)](#export_contract_code) - [export_config_settings (futurenet, testnet)](#export_config_settings) - - [export_expiration (futurenet, testnet)](#export_expiration) + - [export_ttl (futurenet, testnet)](#export_ttl) - [History Archive Commands](#history-archive-commands) - [export_ledgers](#export_ledgers) - [export_transactions](#export_transactions) @@ -65,7 +65,7 @@ The Stellar-ETL is a data pipeline that allows users to extract data from the hi - [export_contract_data](#export_contract_data) - [export_contract_code](#export_contract_code) - [export_config_settings](#export_config_settings) - - [export_expiration](#export_expiration) + - [export_ttl](#export_ttl) - [History Archive Commands](#history-archive-commands) - [export_ledgers](#export_ledgers) - [export_transactions](#export_transactions) @@ -186,10 +186,10 @@ Exports historical config settings data from the genesis ledger to the provided
-### **export_expiration** +### **export_ttl** ```bash -> stellar-etl export_expiration --end-ledger 500000 --output export_expiration.txt +> stellar-etl export_ttl --end-ledger 500000 --output export_ttl.txt ``` Exports historical expiration data from the genesis ledger to the provided end-ledger to an output file. The command reads from the bucket list, which includes the full history of the Stellar ledger. As a result, it should be used in an initial data dump. In order to get expiration information within a specified ledger range, see the export_ledger_entry_changes command. diff --git a/internal/transform/operation.go b/internal/transform/operation.go index 29c4ed9b..b8d74b92 100644 --- a/internal/transform/operation.go +++ b/internal/transform/operation.go @@ -945,6 +945,7 @@ func extractOperationDetails(operation xdr.Operation, transaction ingest.LedgerT args = append(args, xdr.ScVal{Type: xdr.ScValTypeScvSymbol, Sym: &invokeArgs.FunctionName}) args = append(args, invokeArgs.Args...) params := make([]map[string]string, 0, len(args)) + var decodedSymbolParamNames []string details["type"] = "invoke_contract" @@ -962,10 +963,14 @@ func extractOperationDetails(operation xdr.Operation, transaction ingest.LedgerT if raw, err := param.MarshalBinary(); err == nil { serializedParam["value"] = base64.StdEncoding.EncodeToString(raw) } + if scValTypeName == "Sym" { + decodedSymbolParamNames = append(decodedSymbolParamNames, param.String()) + } } params = append(params, serializedParam) } details["parameters"] = params + details["decoded_symbol_param_names"] = decodedSymbolParamNames if balanceChanges, err := parseAssetBalanceChangesFromContractEvents(transaction, network); err != nil { return nil, err @@ -1534,6 +1539,7 @@ func (operation *transactionOperationWrapper) Details() (map[string]interface{}, args = append(args, xdr.ScVal{Type: xdr.ScValTypeScvSymbol, Sym: &invokeArgs.FunctionName}) args = append(args, invokeArgs.Args...) params := make([]map[string]string, 0, len(args)) + var decodedSymbolParamNames []string details["type"] = "invoke_contract" @@ -1551,10 +1557,15 @@ func (operation *transactionOperationWrapper) Details() (map[string]interface{}, if raw, err := param.MarshalBinary(); err == nil { serializedParam["value"] = base64.StdEncoding.EncodeToString(raw) } + if scValTypeName == "Sym" { + decodedSymbolParamNames = append(decodedSymbolParamNames, param.String()) + } + } params = append(params, serializedParam) } details["parameters"] = params + details["decoded_symbol_param_names"] = decodedSymbolParamNames if balanceChanges, err := operation.parseAssetBalanceChangesFromContractEvents(); err != nil { return nil, err