Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
amishas157 committed Jul 22, 2024
1 parent b657484 commit 0eb659d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/transform/trustline.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ func TransformTrustline(ledgerChange ingest.Change, header xdr.LedgerHeaderHisto
return TrustlineOutput{}, errors.Wrap(err, fmt.Sprintf("could not create ledger key string for trustline with account %s and asset %s", outputAccountID, asset.ToAsset().StringCanonical()))
}

var assetTypeString string
if asset.Type == xdr.AssetTypeAssetTypePoolShare {
poolID = PoolIDToString(trustEntry.Asset.MustLiquidityPoolId())
assetTypeString = "pool_share"
assetType = "pool_share"
} else {
if err = asset.Extract(&assetType, &outputAssetCode, &outputAssetIssuer); err != nil {
return TrustlineOutput{}, errors.Wrap(err, fmt.Sprintf("could not parse asset for trustline with account %s", outputAccountID))
}
assetTypeString = assetType
}

outputAssetID := FarmHashAsset(outputAssetCode, outputAssetIssuer, asset.Type.String())
Expand All @@ -64,7 +62,7 @@ func TransformTrustline(ledgerChange ingest.Change, header xdr.LedgerHeaderHisto
transformedTrustline := TrustlineOutput{
LedgerKey: outputLedgerKey,
AccountID: outputAccountID,
AssetType: assetTypeString,
AssetType: assetType,
AssetCode: outputAssetCode,
AssetIssuer: outputAssetIssuer,
AssetID: outputAssetID,
Expand Down

0 comments on commit 0eb659d

Please sign in to comment.