diff --git a/internal/transform/liquidity_pool.go b/internal/transform/liquidity_pool.go index 5cd66674..6ee41209 100644 --- a/internal/transform/liquidity_pool.go +++ b/internal/transform/liquidity_pool.go @@ -36,14 +36,14 @@ func TransformPool(ledgerChange ingest.Change) (PoolOutput, error) { } var assetAType, assetACode, assetAIssuer string - err = cp.Params.AssetA.Extract(&assetACode, &assetAIssuer, &assetAType) + err = cp.Params.AssetA.Extract(&assetAType, &assetACode, &assetAIssuer) if err != nil { return PoolOutput{}, err } assetAID := FarmHashAsset(assetACode, assetAIssuer, assetAType) var assetBType, assetBCode, assetBIssuer string - err = cp.Params.AssetB.Extract(&assetBCode, &assetBIssuer, &assetBType) + err = cp.Params.AssetB.Extract(&assetBType, &assetBCode, &assetBIssuer) assetBID := FarmHashAsset(assetBCode, assetBIssuer, assetBType) transformedPool := PoolOutput{ diff --git a/internal/transform/liquidity_pool_test.go b/internal/transform/liquidity_pool_test.go index 27a37e7b..3664da3f 100644 --- a/internal/transform/liquidity_pool_test.go +++ b/internal/transform/liquidity_pool_test.go @@ -110,7 +110,7 @@ func makePoolTestOutput() PoolOutput { AssetAReserve: 0.0000105, AssetBType: "credit_alphanum4", AssetBCode: lpAssetB.GetCode(), - AssetBID: -9138108998176092786, + AssetBID: 6690054458235693884, AssetBIssuer: lpAssetB.GetIssuer(), AssetBReserve: 0.0000010, LastModifiedLedger: 30705278, diff --git a/internal/transform/trade_test.go b/internal/transform/trade_test.go index d0f9ee5d..8e963366 100644 --- a/internal/transform/trade_test.go +++ b/internal/transform/trade_test.go @@ -727,13 +727,13 @@ func makeTradeTestOutput() [][]TradeOutput { SellingAssetCode: "ETH", SellingAssetIssuer: testAccount3Address, SellingAssetType: "credit_alphanum4", - SellingAssetID: 7452978348057887059, + SellingAssetID: 4476940172956910889, SellingAmount: 13300347 * 0.0000001, BuyingAccountAddress: testAccount3Address, BuyingAssetCode: "USDT", BuyingAssetIssuer: testAccount4Address, BuyingAssetType: "credit_alphanum4", - BuyingAssetID: 4483110387055733902, + BuyingAssetID: -8205667356306085451, BuyingAmount: 12634 * 0.0000001, PriceN: 12634, PriceD: 13300347, @@ -749,7 +749,7 @@ func makeTradeTestOutput() [][]TradeOutput { SellingAssetCode: "USDT", SellingAssetIssuer: testAccount4Address, SellingAssetType: "credit_alphanum4", - SellingAssetID: 4483110387055733902, + SellingAssetID: -8205667356306085451, SellingAmount: 500 * 0.0000001, BuyingAccountAddress: testAccount3Address, BuyingAssetCode: "", @@ -771,13 +771,13 @@ func makeTradeTestOutput() [][]TradeOutput { SellingAssetCode: "WER", SellingAssetIssuer: testAccount4Address, SellingAssetType: "credit_alphanum4", - SellingAssetID: -7191734819702017351, + SellingAssetID: -7615773297180926952, SellingAmount: 123 * 0.0000001, BuyingAccountAddress: testAccount3Address, BuyingAssetCode: "NIJ", BuyingAssetIssuer: testAccount1Address, BuyingAssetType: "credit_alphanum4", - BuyingAssetID: 4209855448155423050, + BuyingAssetID: -8061435944444096568, BuyingAmount: 456 * 0.0000001, PriceN: 456, PriceD: 123, @@ -796,13 +796,13 @@ func makeTradeTestOutput() [][]TradeOutput { SellingAssetCode: "HAH", SellingAssetIssuer: testAccount1Address, SellingAssetType: "credit_alphanum4", - SellingAssetID: 1757348098415471193, + SellingAssetID: -6231594281606355691, SellingAmount: 1 * 0.0000001, BuyingAccountAddress: testAccount3Address, BuyingAssetCode: "WHO", BuyingAssetIssuer: testAccount4Address, BuyingAssetType: "credit_alphanum4", - BuyingAssetID: -1343268855198636280, + BuyingAssetID: -680582465233747022, BuyingAmount: 1 * 0.0000001, PriceN: 1, PriceD: 1,