View Issue Details

IDProjectCategoryView StatusLast Update
0004964Talerobsolete componentpublic2017-06-06 14:18
ReporterChristian Grothoff Assigned ToMarcello Stanisci  
PriorityurgentSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.3Fixed in Version0.3 
Summary0004964: bank needs API to query transaction history of user
DescriptionWe need an API to query the incoming and outgoing wire transfers of a bank account.

This is to test (future) auditor capabilities, where the wire plugins need to be able to enumerate all incoming/outgoing wire transfers (to check that the exchange DB is correct in its claims about how it interacted with the bank).

The API should basically be asked to return the next X wire transfers above offset Y (where offset 0 is the oldest transaction ever made by the account). Transfer details need to include the execution date, wire transfer subject, amount and target account, equivalent to what is given to /admin/add/incoming and/or specified when making a wire transfer.
TagsNo tags attached.

Relationships

related to 0005005 closedMarcello Stanisci /admin/add/incoming should return serial ID of created record 
child of 0004959 closedChristian Grothoff wire plugins need a way to enumerate outgoing wire transfers as well 

Activities

Marcello Stanisci

2017-03-30 11:39

reporter   ~0011998

As of yesterday's discussion, this API might be used by the exchange to know
when a reserve should be created.

For example, the exchange polls continuously its bank account situation, and whenever it gets money from someone, it automatically create a new reserve. This way, the bank
is exempted from checking if the money receiver is the exchange and then calling exchange's /admin/add/incoming on each wire transfer.

Marcello Stanisci

2017-03-30 18:14

reporter   ~0012001

The bank implements such a API by commit 0838e22. To be spec'd and it doesn't
serve that through the long poll tecnique we discussed yet.

So I'll leave this open.

Marcello Stanisci

2017-03-31 00:40

reporter   ~0012003

spec'd @ 86aff5a

Marcello Stanisci

2017-03-31 00:53

reporter   ~0012004

"websockets" may be the answer for doing long polling in django.

Marcello Stanisci

2017-04-26 13:49

reporter   ~0012069

https://channels.readthedocs.io/ might help

Christian Grothoff

2017-05-02 14:45

manager   ~0012096

As per discussion today, we decided to not go for long polling for now, and just expect the clients to poll-sleep-poll (to keep it simple).

Marcello Stanisci

2017-05-05 23:37

reporter   ~0012110

Last edited: 2017-05-05 23:38

The implementation matching new API is done (9d304a5). Testcases now must test the correctness of the parameter 'delta'.

Christian Grothoff

2017-05-07 21:15

manager   ~0012115

Please see the 0004964 line in src/bank-lib/Makefile.am of the exchange, move it under "TESTS" and check that the test passes before closing this one.

This will require implementing 0005005. We may also need to extend "test_bank_api.c" to create a username "user" and password "pass" with the right credentials ("full administrative") as well as bank accounts 1/2/3.
(See also test_bank_interpreter.c:567 for where "user" and "pass" are specified.)

Marcello Stanisci

2017-05-09 13:33

reporter   ~0012119

Last edited: 2017-05-09 13:33

Christian, you might be using some jargon here. Please, elaborate some more about the "00004964 line" and what is the "it" to be moved under "TESTS". You're saying that I should write tests in the exchange codebase that test this (00004964) new bank's feature?

Thanks !!

Christian Grothoff

2017-05-09 13:37

manager   ~0012120

The 0004964-line is a line in the source code that explicitly mentions the bug number in a comment.

Open Makefile.am in an editor, and it should become clear.

The tests in the exchange codebase exist, but that line comments them out from the TESTS-suite that are run on 'make check'.

Marcello Stanisci

2017-05-09 17:38

reporter   ~0012121

FYI: there is a 'feature' branch @exchange.git hosting this work in progress.

Marcello Stanisci

2017-05-10 11:16

reporter   ~0012123

The exchange complains about the history returned - although status code is 200 OK. Could you make the testcase print
the expected history, so it's easier to figure out whether the exchange or the bank are misbehaving?

10/May/2017:09:12:10 +0000 HTTP/1.1 GET /history?auth=basic&account_number=2&delta=5&direction=debit HTTP/1.1 => 200
May 10 11:12:10-503446 test-bank-api-23004 ERROR Assertion failed at test_bank_interpreter.c:520.
May 10 11:12:10-503513 test-bank-api-23004 ERROR Interpreter failed at command `history-2d'

Just in case: I'm on the 'feature' branch of the exchange.

Marcello Stanisci

2017-05-10 15:56

reporter   ~0012124

everything merged in 'master' now.

Marcello Stanisci

2017-05-16 14:14

reporter   ~0012136

Fixed and tested against exchange in 068bf61.

Issue History

Date Modified Username Field Change
2017-03-18 23:21 Christian Grothoff New Issue
2017-03-18 23:21 Christian Grothoff Status new => assigned
2017-03-18 23:21 Christian Grothoff Assigned To => Marcello Stanisci
2017-03-18 23:21 Christian Grothoff Relationship added child of 0004959
2017-03-18 23:23 Christian Grothoff Target Version => 0.7.1
2017-03-30 11:39 Marcello Stanisci Note Added: 0011998
2017-03-30 18:14 Marcello Stanisci Note Added: 0012001
2017-03-31 00:40 Marcello Stanisci Note Added: 0012003
2017-03-31 00:53 Marcello Stanisci Note Added: 0012004
2017-04-26 13:49 Marcello Stanisci Note Added: 0012069
2017-04-30 16:53 Christian Grothoff Target Version 0.7.1 => 0.3
2017-05-02 14:45 Christian Grothoff Note Added: 0012096
2017-05-05 23:37 Marcello Stanisci Note Added: 0012110
2017-05-05 23:38 Marcello Stanisci Note Edited: 0012110
2017-05-07 19:24 Christian Grothoff Relationship added related to 0005005
2017-05-07 21:15 Christian Grothoff Note Added: 0012115
2017-05-07 21:17 Christian Grothoff Priority normal => urgent
2017-05-09 13:33 Marcello Stanisci Note Added: 0012119
2017-05-09 13:33 Marcello Stanisci Note Edited: 0012119
2017-05-09 13:37 Christian Grothoff Note Added: 0012120
2017-05-09 17:38 Marcello Stanisci Note Added: 0012121
2017-05-10 11:16 Marcello Stanisci Note Added: 0012123
2017-05-10 15:56 Marcello Stanisci Note Added: 0012124
2017-05-16 14:14 Marcello Stanisci Note Added: 0012136
2017-05-16 14:14 Marcello Stanisci Status assigned => resolved
2017-05-16 14:14 Marcello Stanisci Resolution open => fixed
2017-05-28 23:01 Christian Grothoff Fixed in Version => 0.3
2017-06-06 14:18 Christian Grothoff Status resolved => closed
2022-08-23 20:26 Christian Grothoff Category bank (demonstrator) => py bank (demonstrator, obsolete)
2023-12-03 01:23 Christian Grothoff Category py bank (demonstrator, obsolete) => obsolete componet
2023-12-11 20:08 Florian Dold Category obsolete componet => obsolete component