Commit graph

85 commits

Author SHA1 Message Date
Jonathan Zernik
315a84f846
Add comment for block hash and block header fixtures in bitcoin client test (#1533) 2021-10-07 19:52:45 -07:00
Jonathan Zernik
e0c63e2927
Add tests for bitcoin client get count method (#1530)
* Add tests for bitcoin client get count method

* Rename bitcoin exceptions

* Got test working for bitcoin http error

* Added tests for get block count and get block hash

* Added tests for all bitcoin client methods

* Added tests for invalid results

* Remove check for empty result which is not needed

* Add test for all bitcoin request errors

* Rename bitcoin connection error exception

* Remove print statments from bitcoin client

* Got 100% coverage for bitcoin client

* Add todos to assert mocks called with correct args

* Rename bitcoin core client class and module
2021-10-07 19:42:15 -07:00
Jonathan Zernik
8d0d658e4d
Better use of fixtures for profile ids (#1529) 2021-10-07 04:25:26 -07:00
Jonathan Zernik
7aa88efd17
Improve fixure for liked and unliked squeak hashes (#1528) 2021-10-07 03:59:52 -07:00
Jonathan Zernik
be5815d402
Use more fixtures for timeline query test (#1527)
* Use fixture for followed and unfollowed squeaks in timeline test

* Use fixture for inserted signing profile

* Use more fixtures for profiles in tests

* Use better fixture for get like squeaks query test

* Use fixtures for liked and unliked squeak in set liked and set unliked test
2021-10-07 03:50:03 -07:00
Jonathan Zernik
c5d189dde3
Use more fixtures for squeak db test (#1526)
* Add test for get liked squeaks and set like and set unliked

* Simplify squeak db tests with more fixtures

* Add test for get locked squeak

* Add test for get secret key for missing squeak
2021-10-07 02:51:46 -07:00
Jonathan Zernik
411db3d6b8
Add test for get liked squeaks and set like and set unliked (#1525) 2021-10-07 02:17:48 -07:00
Jonathan Zernik
e1a9674200
Add unit test for set profile following (#1520) 2021-10-06 15:39:42 -07:00
Jonathan Zernik
2a55b44b97
Add get timeline squeak entries test (#1518)
* WIP: most of timeline db query test

* Got unit test for timeline query working with followed profile

* Remove old commented create signing profile function
2021-10-05 19:38:35 -07:00
Jonathan Zernik
9c599ee0e3
Add test util functions (#1515)
* Create test utils module for unit tests

* Improve squeak db unit tests using generated block header object

* Add assertion for block time in get squeak entry test
2021-10-05 15:28:25 -07:00
Jonathan Zernik
c3f4f80d30
Move set up test socket function to util module (#1510) 2021-10-05 00:39:12 -07:00
Jonathan Zernik
dbb440afea
Simplify unit test for connection manager ignore address for inbound connection (#1509) 2021-10-04 22:15:53 -07:00
Jonathan Zernik
24dc6c7af3
Use context managers to open and close sockets in unit test for squeak node (#1508) 2021-10-04 22:04:57 -07:00
Jonathan Zernik
95d48ca74c
Use thread pool and futures for connection manager unit test (#1506) 2021-10-04 21:35:17 -07:00
Jonathan Zernik
c62dc14d65
Mock out more components in unit test for squeak node (#1505) 2021-10-04 20:52:32 -07:00
Jonathan Zernik
742f524263
Add unit test for network connection using connection manager (#1493) 2021-10-04 00:48:46 -07:00
Jonathan Zernik
5d753ace14
Add unit test for get squeak secret key from db (#1492)
* Add unit test for get squeak secret key from db

* Add unit test for get missing squeak secret key from db
2021-10-03 21:31:17 -07:00
Jonathan Zernik
3effe81546
Add unit test for get missing squeak entry from db (#1491) 2021-10-03 21:11:28 -07:00
Jonathan Zernik
2eb1f1025d
Add unit test for get squeak entry from db (#1490) 2021-10-03 21:02:29 -07:00
Jonathan Zernik
080d6299b5
Add unit test for duplicate squeak (#1489)
* Add unit test for insert duplicate squeak in db

* Add unit test for get missing squeak from db
2021-10-03 20:52:04 -07:00
Jonathan Zernik
2e0fc25051
Got unit test working for insert and retrieve squeak in db (#1488) 2021-10-03 20:39:24 -07:00
Jonathan Zernik
70511ea291
Remove print statements from unit test (#1487) 2021-10-03 19:53:06 -07:00
Jonathan Zernik
24e64fc30b
Mock out db in unit test (#1485)
* Simplify fixtures in squeak node unit test

* Mock out get connection string which creates data dir
2021-10-03 19:49:22 -07:00
Jonathan Zernik
be8ebe7f42
Add config to enable squeak node test to cover everything (#1484)
* Add config to enable squeak node test to cover everything

* Add separate test for webadmin enabled
2021-10-03 16:14:42 -07:00
Jonathan Zernik
4fe0953f43
Got test passing for start stop squeaknode (#1483)
* Got test passing for start stop squeaknode

* Remove print statements from test
2021-10-03 15:24:24 -07:00
Jonathan Zernik
1ede8b9468
Move create saved peer function to peers module (#1473) 2021-10-02 11:25:08 -07:00
Jonathan Zernik
e2bd6ae384
Add profiles module with unit tests (#1468) 2021-10-02 02:48:09 -07:00
Jonathan Zernik
f68d8628ea
Move secret key tweak functions to secret keys module (#1464) 2021-10-02 00:07:51 -07:00
Jonathan Zernik
77fda8114f
Create squeaks module (#1460)
* Create new squeaks module in core and add make squeak function

* Move get_hash function to squeaks module

* Add unit test for squeaks module

* Add check squeak function to squeaks module

* Add get decrypted content function to squeaks module

* Add function to get payment point in squeaks module

* Use conftest for fixtures in core directory

* Add test cases for squeak matches interest function

* Remove old comment in squeak core
2021-10-01 21:24:09 -07:00
Jonathan Zernik
62f5e332a8
Refactor core interest functions (#1449)
* Convert iterable to list in interest unit tests

* Refactor interests functions into separate module

* Simplify assertions in test interests unit tests
2021-09-30 21:59:55 -07:00
Jonathan Zernik
86088f4a9a
Use differential interests after updating subscribed interests (#1424) 2021-09-26 20:25:51 -07:00
Jonathan Zernik
c9b88ffd4a
Send secret key when profile configured to free (#1197)
* Set up itest for sending free secret key

* Got itest working for download and unlock free squeak

* Simplified getting offer or free secret key from controller

* Rename get offer method of controller
2021-09-05 14:38:52 -07:00
Jonathan Zernik
76ad744936
Updrage squeaklib to 0.7.1 (#1194)
* Updrage squeaklib to 0.7.1

* Add case to handle secret key msg in peer msg handler

* Add fields for custom price and use custom price to profile table

* Got itest working with new profile fields

* Use default values for profile struct constructor

* Fix db migration to use use profile columns

* Got itest passing for set use custom price

* Show custom price or default price in profile page

* Change wording of selling with price in profile page

* Got set use custom price toggle working in configure profile dialog
2021-09-05 12:30:58 -07:00
Jonathan Zernik
26fced200d
Upgrade squeaklib to version 7 (#1188)
* Use newer version of squeaklib with decryption key outside squeak object

* Remove todo comment about clearing decryption key before insert squeak in db
2021-09-04 16:58:33 -07:00
Jonathan Zernik
512129b8ec
Implement per address rate limit (#1102)
* Add check for per address rate limit in controller

* Delete rate limiter class

* Add check for interest and rate limit to save received squeak

* Got single squeak download working using temporary interest

* Use polymorphic interest classes for temporary interest manager

* Change order of checking temporary interests before permanent interests

* Used timed dict for temporary interests

* Include check for limit in temporary interest
2021-08-29 06:36:14 -07:00
Jonathan Zernik
620cdae96c
Add license headers (#1080)
* Add pre-commit hook for license headers

* Configure pre-commit hook for license headers only for python

* Add license headers to python files
2021-08-27 18:31:53 -07:00
Jonathan Zernik
dba7c525e9
Rename core config to node config (#1045) 2021-08-24 01:13:24 -07:00
Jonathan Zernik
e9fd648cd2
Improve squeak core (#1040)
* Update squeak core methods to return results

* Re-order controller methods
2021-08-23 23:36:47 -07:00
Jonathan Zernik
b9ac4b86b4
Use peer address struct in requests (#1004)
* Update connect peer and disconnect peer rpc to use peer addrss struct

* Update get connected peer rpc to use peer addrss struct

* Use peer address struct in create saved peer rpc

* Use peer address struct in squeak peer struct

* Use peer address for requests functions in frontend

* Update frontend build
2021-08-21 00:54:48 -07:00
Jonathan Zernik
f9197f7035
Remove uploading and downloading fields and add autoconnect field in … (#993)
* Remove uploading and downloading fields and add autoconnect field in all backend code

* Remove uploading and downloading fields and add autoconnect in frontend

* Update frontend build
2021-08-20 15:46:54 -07:00
Jonathan Zernik
deb8b1b99b
Remove sharing field profile (#990)
* Remove sharing field from all backend code

* Add db migration to remove sharing field

* Remove profile sharing field from frontend

* Update frontend build
2021-08-20 14:18:04 -07:00
Jonathan Zernik
4cc617a94c
Refactor network commands into network manager (#949)
* Refactor network commands into network manager

* Start and stop peer server and peer client inside network manager

* Pass handle connection fn to peer handler instead of self object

* Remove old comments
2021-08-15 22:15:42 -07:00
Jonathan Zernik
78b7f9a7f1
Fix default port for create peer command (#905) 2021-08-10 21:29:24 -07:00
Jonathan Zernik
7d266cdf5e
Split peer server client (#901)
* Split peer server and peer client

* Got itest passing

* Catch exception when closing peer socket

* Reconfigure all itests to run
2021-08-10 02:16:46 -07:00
Jonathan Zernik
f652915355
Use tcp peer connection (#900)
* Got basic tcp connection working

* Got passing itest for open tcp connection

* Got most of protocol working. still need to send offer correctly

* Got offer from peer over tcp connectrion

* Got single squeak download working on tcp connection

* Remove rpc peer client

* Remove old rpc clients

* Remove old squeak client modules

* Got sharesqueaks peer message working

* Remove peer rpc server

* Remove server rpc fixtures

* Remove old itests

* Remove old sync modules

* Run worker background task to keep peers synced

* Add peer connection worker

* Add test for disconnect peer

* Remove old itest util

* Delete old peer rpc client helpers.

* Handle insert duplicate received offer

* Use more specific exception handling for duplicate offer insert
2021-07-09 21:07:46 -07:00
Jonathan Zernik
c77bc943e8
Use host and port to identify peer in received offer and sent payment (#866) 2021-02-21 15:29:00 -08:00
Jonathan Zernik
00c8bd9769
Move controller to node directory (#841)
* Move squeak controller class to node directory

* Move test squeak controller to test node directory
2021-02-13 07:46:00 -08:00
Jonathan Zernik
d30150febc
Fix config name for max squeaks per address per block (#835) 2021-02-13 04:28:36 -08:00
Jonathan Zernik
9e15962d1a
Allow reprocess invoice without duplicate (#816)
* Allow reprocessing the same invoice without duplicate insert of received payment

* Use stopped event to stop processing invoices

* Got itest working with payment processor class

* Use payment processor class in squeak controller constructor

* Add rpc method for reprocess received payments

* Add reprocess received payments button

* Add reprocess received payments to admin web app

* Handle processing received payments subscription rpc better

* Add frontend button to reprocess received payments

* Clear settle indices in reprocess received payments

* Update static build
2021-02-12 00:14:45 -08:00
Jonathan Zernik
85c2bcdfbc
Rename bitcoin client (#807)
* Rename bitcoin client

* Remove log line from bitcoin client
2021-02-09 08:28:00 -08:00