Skip to content

Commit

Permalink
Change variable name from op to asset
Browse files Browse the repository at this point in the history
  • Loading branch information
cayod committed Jan 24, 2024
1 parent a9f0324 commit ae74baf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/transform/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ func TransformAsset(operation xdr.Operation, operationIndex int32, transactionIn
return AssetOutput{}, fmt.Errorf("operation of type %d cannot issue an asset (id %d)", opType, operationID)
}

op := xdr.Asset{}
asset := xdr.Asset{}
switch opType {
case xdr.OperationTypeManageSellOffer:
opSellOf, ok := operation.Body.GetManageSellOfferOp()
if ok {
return AssetOutput{}, fmt.Errorf("operation of type ManageSellOfferOp cannot issue an asset (id %d)", operationID)
}
op = opSellOf.Selling
asset = opSellOf.Selling

case xdr.OperationTypePayment:
opPayment, ok := operation.Body.GetPaymentOp()
if !ok {
return AssetOutput{}, fmt.Errorf("could not access Payment info for this operation (id %d)", operationID)
}
op = opPayment.Asset
asset = opPayment.Asset

}

outputAsset, err := transformSingleAsset(op)
outputAsset, err := transformSingleAsset(asset)
if err != nil {
return AssetOutput{}, fmt.Errorf("%s (id %d)", err.Error(), operationID)
}
Expand Down

0 comments on commit ae74baf

Please sign in to comment.