View Issue Details

IDProjectCategoryView StatusLast Update
0005066Talermerchant backend API (C)public2019-01-31 19:33
ReporterChristian GrothoffAssigned ToMarcello Stanisci 
PrioritynormalSeveritytweakReproducibilityN/A
Status resolvedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product VersionSVN HEAD 
Target Version0.6Fixed in Version0.6 
Summary0005066: /history API for merchant differs from /history for bank, and it is worse
DescriptionRight now, /history for the merchant backend differs from the /bank API in several ways, all of which seem to make it inferior:

1) start/offset are "unsigned int", while the bank uses uint64_t. The later is not only more precise, but also 32 bits may simply not be enough. 4 billion transactions are totally within the range of large sites, so we need to use 64 bit values here (and BIGSERIAL in the backend DB).

2) 'delta' can only be positive; the possibility to pass 'GNUNET_YES' to 'find_contract_terms_by_date_and_range' is thus not possible with this API. However, it does make sense to have the same backwards-or-forwards navigation capabilities for the merchant /history than what we have for the bank /history.
So 'delta' should become a int64_t. (Note that there is something with 'start' being not initialized and interpreted as -1 to go into the other direction implemented, but it seems more hack-ish than the bank /history version).

3) "unsigned int future" in 'find_contract_terms_by_date_and_range' should just be an 'int'.

TagsNo tags attached.

Activities

Marcello Stanisci

2018-12-13 16:11

manager   ~0013409

Just pointing out another divergence between the two APIs: the bank returns results YOUNGER than 'start' and the merchant returns results OLDER than 'start'. I think we should get them do the same thing (the bank's way).

Marcello Stanisci

2018-12-13 17:40

manager   ~0013410

2cce6fe addresses all the points reported in this issue. Just note that since the whole "delta" semantics has been inverted (in order to match the bank's), now 'future' got renamed as 'past' and has the desired type.

Marcello Stanisci

2018-12-13 17:58

manager   ~0013411

Reopening as docs need to be updated, and possibly some additional minor changes could be needed.

Also: the *backoffice* would need some attention after the change in the merchant /history API semantics.

Marcello Stanisci

2018-12-14 19:45

manager   ~0013414

exchange / merchant / api have all been adapted as for recent (private) discussion (*): 15c1a877 / d52b2b0 / d6c5eaa. Leaving open until the backoffice gets some attention too.

(*) long story short: okay to default 'start' to UINT64_MAX and okay to add a 'ordering' parameter that controls the way results are sorted.

Marcello Stanisci

2018-12-17 18:04

manager   ~0013417

317d1e5 made backoffice aligned with these API changes. Edit: 'start' defaults to *INT64_MAX* because Postgresql BIGSERIAL is a signed number type.

Issue History

Date Modified Username Field Change
2017-06-05 18:25 Christian Grothoff New Issue
2017-06-05 18:25 Christian Grothoff Status new => assigned
2017-06-05 18:25 Christian Grothoff Assigned To => Marcello Stanisci
2017-06-05 18:47 Christian Grothoff Description Updated View Revisions
2017-06-06 14:24 Christian Grothoff Target Version 0.4 => 0.7
2018-12-13 16:11 Marcello Stanisci Note Added: 0013409
2018-12-13 17:40 Marcello Stanisci Status assigned => resolved
2018-12-13 17:40 Marcello Stanisci Resolution open => fixed
2018-12-13 17:40 Marcello Stanisci Note Added: 0013410
2018-12-13 17:58 Marcello Stanisci Status resolved => assigned
2018-12-13 17:58 Marcello Stanisci Note Added: 0013411
2018-12-14 19:45 Marcello Stanisci Note Added: 0013414
2018-12-17 18:04 Marcello Stanisci Note Added: 0013417
2018-12-17 18:04 Marcello Stanisci Status assigned => resolved
2019-01-31 19:33 Christian Grothoff Fixed in Version => 0.6
2019-01-31 19:33 Christian Grothoff Target Version 0.7 => 0.6