View Issue Details

IDProjectCategoryView StatusLast Update
0004964Talerobsolete componentpublic2017-06-06 12:18
ReporterChristian Grothoff Assigned ToMarcello Stanisci 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
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.

Required notifications

Address or linkRemarkAdded byNotifiedActions

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 09: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 16: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-30 22:40

reporter   ~0012003

spec'd @ 86aff5a

Marcello Stanisci

2017-03-30 22:53

reporter   ~0012004

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

Marcello Stanisci

2017-04-26 11:49

reporter   ~0012069

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

Christian Grothoff

2017-05-02 12: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 21:37

reporter   ~0012110

Last edited: 2017-05-05 21:38

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

Christian Grothoff

2017-05-07 19: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 11:33

reporter   ~0012119

Last edited: 2017-05-09 11: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 11: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 15:38

reporter   ~0012121

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

Marcello Stanisci

2017-05-10 09: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 13:56

reporter   ~0012124

everything merged in 'master' now.

Marcello Stanisci

2017-05-16 12:14

reporter   ~0012136

Fixed and tested against exchange in 068bf61.

Issue History

Date ModifiedUsernameFieldChange
2017-03-18 22:21Christian GrothoffNew Issue
2017-03-18 22:21Christian GrothoffStatusnew => assigned
2017-03-18 22:21Christian GrothoffAssigned To => Marcello Stanisci
2017-03-18 22:21Christian GrothoffRelationship addedchild of 0004959
2017-03-18 22:23Christian GrothoffTarget Version => 0.7.1
2017-03-30 09:39Marcello StanisciNote Added: 0011998
2017-03-30 16:14Marcello StanisciNote Added: 0012001
2017-03-30 22:40Marcello StanisciNote Added: 0012003
2017-03-30 22:53Marcello StanisciNote Added: 0012004
2017-04-26 11:49Marcello StanisciNote Added: 0012069
2017-04-30 14:53Christian GrothoffTarget Version0.7.1 => 0.3
2017-05-02 12:45Christian GrothoffNote Added: 0012096
2017-05-05 21:37Marcello StanisciNote Added: 0012110
2017-05-05 21:38Marcello StanisciNote Edited: 0012110
2017-05-07 17:24Christian GrothoffRelationship addedrelated to 0005005
2017-05-07 19:15Christian GrothoffNote Added: 0012115
2017-05-07 19:17Christian GrothoffPrioritynormal => urgent
2017-05-09 11:33Marcello StanisciNote Added: 0012119
2017-05-09 11:33Marcello StanisciNote Edited: 0012119
2017-05-09 11:37Christian GrothoffNote Added: 0012120
2017-05-09 15:38Marcello StanisciNote Added: 0012121
2017-05-10 09:16Marcello StanisciNote Added: 0012123
2017-05-10 13:56Marcello StanisciNote Added: 0012124
2017-05-16 12:14Marcello StanisciNote Added: 0012136
2017-05-16 12:14Marcello StanisciStatusassigned => informing
2017-05-16 12:14Marcello StanisciResolutionopen => fixed
2017-05-28 21:01Christian GrothoffFixed in Version => 0.3
2017-06-06 12:18Christian GrothoffStatusinforming => closed
2022-08-23 18:26Christian GrothoffCategorybank (demonstrator) => py bank (demonstrator, obsolete)
2023-12-03 00:23Christian GrothoffCategorypy bank (demonstrator, obsolete) => obsolete componet
2023-12-11 19:08Florian DoldCategoryobsolete componet => obsolete component