Skip to content

Commit

Permalink
fixed history_trade and liquidity_pool asset_id field
Browse files Browse the repository at this point in the history
  • Loading branch information
cayod committed Oct 11, 2023
1 parent 1132c44 commit e03565c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internal/transform/liquidity_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions internal/transform/trade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit e03565c

Please sign in to comment.