Skip to content

Commit

Permalink
update trade and liquidity test
Browse files Browse the repository at this point in the history
  • Loading branch information
cayod committed Oct 11, 2023
1 parent e03565c commit 63016b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/transform/liquidity_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion internal/transform/liquidity_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions internal/transform/trade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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: "",
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 63016b3

Please sign in to comment.