From e03565ccf0789ab0d6931afa8ffb55766800f7c7 Mon Sep 17 00:00:00 2001 From: Cayod Date: Wed, 11 Oct 2023 11:11:15 -0300 Subject: [PATCH] fixed history_trade and liquidity_pool asset_id field --- internal/transform/liquidity_pool.go | 8 ++++---- internal/transform/trade.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/transform/liquidity_pool.go b/internal/transform/liquidity_pool.go index e6a34a0f..5cd66674 100644 --- a/internal/transform/liquidity_pool.go +++ b/internal/transform/liquidity_pool.go @@ -36,15 +36,15 @@ func TransformPool(ledgerChange ingest.Change) (PoolOutput, error) { } var assetAType, assetACode, assetAIssuer string - err = cp.Params.AssetA.Extract(&assetAType, &assetACode, &assetAIssuer) + err = cp.Params.AssetA.Extract(&assetACode, &assetAIssuer, &assetAType) if err != nil { return PoolOutput{}, err } - assetAID := FarmHashAsset(assetAType, assetACode, assetAIssuer) + assetAID := FarmHashAsset(assetACode, assetAIssuer, assetAType) var assetBType, assetBCode, assetBIssuer string - err = cp.Params.AssetB.Extract(&assetBType, &assetBCode, &assetBIssuer) - assetBID := FarmHashAsset(assetBType, assetBCode, assetBIssuer) + err = cp.Params.AssetB.Extract(&assetBCode, &assetBIssuer, &assetBType) + assetBID := FarmHashAsset(assetBCode, assetBIssuer, assetBType) transformedPool := PoolOutput{ PoolID: PoolIDToString(lp.LiquidityPoolId), diff --git a/internal/transform/trade.go b/internal/transform/trade.go index 57bb07ab..27dfc0da 100644 --- a/internal/transform/trade.go +++ b/internal/transform/trade.go @@ -46,7 +46,7 @@ func TransformTrade(operationIndex int32, operationID int64, transaction ingest. if err != nil { return []TradeOutput{}, err } - outputSellingAssetID := FarmHashAsset(outputSellingAssetType, outputSellingAssetCode, outputSellingAssetIssuer) + outputSellingAssetID := FarmHashAsset(outputSellingAssetCode, outputSellingAssetIssuer, outputSellingAssetType) outputSellingAmount := claimOffer.AmountSold() if outputSellingAmount < 0 { @@ -58,7 +58,7 @@ func TransformTrade(operationIndex int32, operationID int64, transaction ingest. if err != nil { return []TradeOutput{}, err } - outputBuyingAssetID := FarmHashAsset(outputBuyingAssetType, outputBuyingAssetCode, outputBuyingAssetIssuer) + outputBuyingAssetID := FarmHashAsset(outputBuyingAssetCode, outputBuyingAssetIssuer, outputBuyingAssetType) outputBuyingAmount := int64(claimOffer.AmountBought()) if outputBuyingAmount < 0 {