View Issue Details

IDProjectCategoryView StatusLast Update
0010081Talerlibeufin-bankpublic2025-08-31 17:09
Reportersebasjm Assigned ToAntoine A Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Versiongit (master) 
Target Version1.0 stretch goalsFixed in Version1.0 stretch goals 
Summary0010081: calculation from spa and libeufin server doesn't match
DescriptionI found out this when testing another issue.

The first query passes, the second request contains the value that the SPA calculate based on the configuration and get the error "Wrong currency conversion" but it may be related to the credit/debit amount.



curl -v 'http://bank.taler.test:1180/accounts/_illegal-data_/cashouts' \
    -H "Content-Type: application/json" \
  -H 'Authorization: Bearer secret-token:T7F8T8KFSVRPT80MZE2WZ22HZTR5X9WAAVSCWR2CVBD2YRRMFPXG' \
  --data-raw '{"request_uid":"R8V6YW2K0A04C9AWN1CQP8BZ0EEFZ7T07Y8NWT3N05S0H0EVGVX0","amount_credit":"EUR:2.51","amount_debit":"LAIA:2","subject":"qwe"}'

< HTTP/1.1 200 OK


curl -v 'http://bank.taler.test:1180/accounts/_illegal-data_/cashouts' \
    -H "Content-Type: application/json" \
  -H 'Authorization: Bearer secret-token:T7F8T8KFSVRPT80MZE2WZ22HZTR5X9WAAVSCWR2CVBD2YRRMFPXG' \
  --data-raw '{"request_uid":"R8V6YW2K0A04C9AWN1CQP8BZ0EEFZ7T07Y8NWT3N05S0H0EVGVX0","amount_credit":"EUR:2.52","amount_debit":"LAIA:2","subject":"qwe"}'

< HTTP/1.1 409 Conflict
* Connection #0 to host bank.taler.test left intact
{"code":5128,"hint":"Wrong currency conversion"}

$ curl bank.taler.test:1180/conversion-info/config | jq .

{
  "regional_currency": "LAIA",
  "regional_currency_specification": {
    "name": "LAIA",
    "num_fractional_input_digits": 2,
    "num_fractional_normal_digits": 2,
    "num_fractional_trailing_zero_digits": 2,
    "alt_unit_names": {
      "0": "LAIA"
    }
  },
  "fiat_currency": "EUR",
  "fiat_currency_specification": {
    "name": "Euro",
    "num_fractional_input_digits": 2,
    "num_fractional_normal_digits": 2,
    "num_fractional_trailing_zero_digits": 2,
    "alt_unit_names": {
      "0": "€"
    }
  },
  "conversion_rate": {
    "cashin_ratio": "0.8",
    "cashin_fee": "LAIA:0.02",
    "cashin_tiny_amount": "LAIA:0.01",
    "cashin_rounding_mode": "nearest",
    "cashin_min_amount": "EUR:0",
    "cashout_ratio": "1.26",
    "cashout_fee": "EUR:0.003",
    "cashout_tiny_amount": "EUR:0.01",
    "cashout_rounding_mode": "zero",
    "cashout_min_amount": "LAIA:0.1"
  },
  "name": "taler-conversion-info",
  "version": "0:1:0"
}
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

sebasjm

2025-06-05 15:18

developer   ~0025158

curl 'http://bank.taler.test:1180/conversion-info/cashout-rate?amount_credit=EUR%3A2'

#{"amount_debit":"LAIA:1.58","amount_credit":"EUR:2"}



curl 'http://bank.taler.test:1180/accounts/_illegal-data_/cashouts' \
  -H 'Authorization: Bearer secret-token:T7F8T8KFSVRPT80MZE2WZ22HZTR5X9WAAVSCWR2CVBD2YRRMFPXG' \
  -H 'Content-Type: application/json' \
  --data-raw '{"request_uid":"7QHKK3DNHC4MXFN45FVGK0229AHKCRXR8K5NVTYHWMPJNMG5EV1G","amount_credit":"EUR:2","amount_debit":"LAIA:1.58","subject":"we"}' \

#{"code":5128,"hint":"Wrong currency conversion"}

Antoine A

2025-06-07 13:10

manager   ~0025181

This was an error in the “revert” part of the calculation, so no incorrect conversion could have occurred.
The "Wrong currency conversion" is actually protecting against that.
Fixed in 9738c420533c7eafad8d28a5154b925d7265d1bb

Issue History

Date ModifiedUsernameFieldChange
2025-06-05 14:15sebasjmNew Issue
2025-06-05 14:15sebasjmStatusnew => assigned
2025-06-05 14:15sebasjmAssigned To => sebasjm
2025-06-05 15:18sebasjmNote Added: 0025158
2025-06-05 15:18sebasjmAssigned Tosebasjm => Antoine A
2025-06-05 15:18sebasjmCategorylibeufin-bank-ui (SPA) => libeufin-bank
2025-06-07 13:10Antoine AStatusassigned => informing
2025-06-07 13:10Antoine AResolutionopen => fixed
2025-06-07 13:10Antoine ANote Added: 0025181
2025-06-07 15:28Christian GrothoffFixed in Version => 1.0 stretch goals
2025-08-31 17:09Christian GrothoffStatusinforming => closed