From fe1dd24147d1618fee7bf131b4bc14b36d5daaf4 Mon Sep 17 00:00:00 2001 From: Simon Chow Date: Thu, 2 Nov 2023 16:54:01 -0400 Subject: [PATCH] Move header var --- cmd/export_claimable_balances.go | 2 +- cmd/export_config_setting.go | 2 +- cmd/export_contract_code.go | 2 +- cmd/export_contract_data.go | 2 +- cmd/export_expiration.go | 2 +- cmd/export_liquidity_pools.go | 2 +- cmd/export_offers.go | 2 +- cmd/export_trustlines.go | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/export_claimable_balances.go b/cmd/export_claimable_balances.go index 5db70976..119693c4 100644 --- a/cmd/export_claimable_balances.go +++ b/cmd/export_claimable_balances.go @@ -36,8 +36,8 @@ var claimableBalancesCmd = &cobra.Command{ outFile := mustOutFile(path) numFailures := 0 totalNumBytes := 0 + var header xdr.LedgerHeaderHistoryEntry for _, balance := range balances { - var header xdr.LedgerHeaderHistoryEntry transformed, err := transform.TransformClaimableBalance(balance, header) if err != nil { cmdLogger.LogError(fmt.Errorf("could not transform balance %+v: %v", balance, err)) diff --git a/cmd/export_config_setting.go b/cmd/export_config_setting.go index 903f3c64..60630648 100644 --- a/cmd/export_config_setting.go +++ b/cmd/export_config_setting.go @@ -33,8 +33,8 @@ var configSettingCmd = &cobra.Command{ outFile := mustOutFile(path) numFailures := 0 totalNumBytes := 0 + var header xdr.LedgerHeaderHistoryEntry for _, setting := range settings { - var header xdr.LedgerHeaderHistoryEntry transformed, err := transform.TransformConfigSetting(setting, header) if err != nil { cmdLogger.LogError(fmt.Errorf("could not transform config setting %+v: %v", setting, err)) diff --git a/cmd/export_contract_code.go b/cmd/export_contract_code.go index 6273c2b1..2980286d 100644 --- a/cmd/export_contract_code.go +++ b/cmd/export_contract_code.go @@ -33,8 +33,8 @@ var codeCmd = &cobra.Command{ outFile := mustOutFile(path) numFailures := 0 totalNumBytes := 0 + var header xdr.LedgerHeaderHistoryEntry for _, code := range codes { - var header xdr.LedgerHeaderHistoryEntry transformed, err := transform.TransformContractCode(code, header) if err != nil { cmdLogger.LogError(fmt.Errorf("could not transform contract code %+v: %v", code, err)) diff --git a/cmd/export_contract_data.go b/cmd/export_contract_data.go index d2195d79..62c57a3f 100644 --- a/cmd/export_contract_data.go +++ b/cmd/export_contract_data.go @@ -33,8 +33,8 @@ var dataCmd = &cobra.Command{ outFile := mustOutFile(path) numFailures := 0 totalNumBytes := 0 + var header xdr.LedgerHeaderHistoryEntry for _, data := range datas { - var header xdr.LedgerHeaderHistoryEntry TransformContractData := transform.NewTransformContractDataStruct(transform.AssetFromContractData, transform.ContractBalanceFromContractData) transformed, err, ok := TransformContractData.TransformContractData(data, env.NetworkPassphrase, header) if err != nil { diff --git a/cmd/export_expiration.go b/cmd/export_expiration.go index a3a8a410..54fdd104 100644 --- a/cmd/export_expiration.go +++ b/cmd/export_expiration.go @@ -33,8 +33,8 @@ var expirationCmd = &cobra.Command{ outFile := mustOutFile(path) numFailures := 0 totalNumBytes := 0 + var header xdr.LedgerHeaderHistoryEntry for _, expiration := range expirations { - var header xdr.LedgerHeaderHistoryEntry transformed, err := transform.TransformExpiration(expiration, header) if err != nil { cmdLogger.LogError(fmt.Errorf("could not transform expiration %+v: %v", expiration, err)) diff --git a/cmd/export_liquidity_pools.go b/cmd/export_liquidity_pools.go index 3393f930..f0f7f236 100644 --- a/cmd/export_liquidity_pools.go +++ b/cmd/export_liquidity_pools.go @@ -36,8 +36,8 @@ the export_ledger_entry_changes command.`, outFile := mustOutFile(path) numFailures := 0 totalNumBytes := 0 + var header xdr.LedgerHeaderHistoryEntry for _, pool := range pools { - var header xdr.LedgerHeaderHistoryEntry transformed, err := transform.TransformPool(pool, header) if err != nil { cmdLogger.LogError(fmt.Errorf("could not transform pool %+v: %v", pool, err)) diff --git a/cmd/export_offers.go b/cmd/export_offers.go index 37b67cb8..17898e13 100644 --- a/cmd/export_offers.go +++ b/cmd/export_offers.go @@ -37,8 +37,8 @@ var offersCmd = &cobra.Command{ outFile := mustOutFile(path) numFailures := 0 totalNumBytes := 0 + var header xdr.LedgerHeaderHistoryEntry for _, offer := range offers { - var header xdr.LedgerHeaderHistoryEntry transformed, err := transform.TransformOffer(offer, header) if err != nil { cmdLogger.LogError(fmt.Errorf("could not transform offer %+v: %v", offer, err)) diff --git a/cmd/export_trustlines.go b/cmd/export_trustlines.go index f13dbd2b..52e4075e 100644 --- a/cmd/export_trustlines.go +++ b/cmd/export_trustlines.go @@ -37,8 +37,8 @@ var trustlinesCmd = &cobra.Command{ outFile := mustOutFile(path) numFailures := 0 totalNumBytes := 0 + var header xdr.LedgerHeaderHistoryEntry for _, trust := range trustlines { - var header xdr.LedgerHeaderHistoryEntry transformed, err := transform.TransformTrustline(trust, header) if err != nil { cmdLogger.LogError(fmt.Errorf("could not json transform trustline %+v: %v", trust, err))