Skip to content

Commit

Permalink
fix manager tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewcasale committed Sep 20, 2023
1 parent 79b8426 commit 4056dd3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 23 deletions.
3 changes: 3 additions & 0 deletions fastlane_bot/tests/nbtest/test_036_Manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ def test_test_update_from_event_carbon_v1_update():
# ------------------------------------------------------------

# +
event_create_for_update = event_data['carbon_v1_event_create_for_update']
event = event_data['carbon_v1_event_update']

manager.update_from_event(event_create_for_update)
assert event['args']['order0'][0] != [pool['y_0'] for pool in manager.pool_data if pool['cid'] == event['args']['id']][0]

manager.update_from_event(event)
Expand Down
62 changes: 39 additions & 23 deletions resources/NBTest/NBTest_036_Manager.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
"id": "6b800d59",
"metadata": {
"ExecuteTime": {
"end_time": "2023-07-13T04:47:56.521013Z",
"start_time": "2023-07-13T04:47:56.487042Z"
"end_time": "2023-09-20T14:03:06.090221Z",
"start_time": "2023-09-20T14:03:02.984869Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ConstantProductCurve v2.14 (23/May/2023)\n",
"ConstantProductCurve v3.2 (15/Sep/2023)\n",
"CarbonBot v3-b2.2 (20/June/2023)\n",
"UniswapV2 v0.0.1 (2023-07-03)\n",
"UniswapV3 v0.0.1 (2023-07-03)\n",
"SushiswapV2 v0.0.1 (2023-07-03)\n",
"CarbonV1 v0.0.1 (2023-07-03)\n",
"BancorV3 v0.0.1 (2023-07-03)\n",
"UniswapV2 v0.0.2 (2023-08-27)\n",
"UniswapV3 v0.0.2 (2023-08-27)\n",
"SushiswapV2 v0.0.2 (2023-08-27)\n",
"CarbonV1 v0.0.2 (2023-08-27)\n",
"BancorV3 v0.0.2 (2023-08-27)\n",
"imported m, np, pd, plt, os, sys, decimal; defined iseq, raises, require\n",
"Version = 3-b2.2 [requirements >= 3.0 is met]\n"
]
Expand Down Expand Up @@ -68,8 +68,8 @@
"id": "80ddef38",
"metadata": {
"ExecuteTime": {
"end_time": "2023-07-13T04:47:56.527256Z",
"start_time": "2023-07-13T04:47:56.493598Z"
"end_time": "2023-09-20T14:03:06.128079Z",
"start_time": "2023-09-20T14:03:06.090785Z"
}
},
"outputs": [],
Expand All @@ -89,11 +89,24 @@
"id": "7919999a",
"metadata": {
"ExecuteTime": {
"end_time": "2023-07-13T04:47:57.071520Z",
"start_time": "2023-07-13T04:47:56.526210Z"
"end_time": "2023-09-20T14:03:08.151919Z",
"start_time": "2023-09-20T14:03:06.113589Z"
}
},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-09-20 07:03:06,113 [fastlane:INFO] - \n",
"2023-09-20 07:03:06,113 [fastlane:INFO] - **********************************************\n",
"2023-09-20 07:03:06,114 [fastlane:INFO] - The logging path is set to: logs/20230920-070306/bot.log\n",
"2023-09-20 07:03:06,114 [fastlane:INFO] - **********************************************\n",
"2023-09-20 07:03:06,114 [fastlane:INFO] - \n",
"2023-09-20 07:03:07,076 [fastlane:INFO] - Retrieved 169 carbon pairs from contract\n"
]
}
],
"source": [
"\n",
"# Create mock instances for all required parameters\n",
Expand All @@ -117,8 +130,8 @@
"id": "584c8056",
"metadata": {
"ExecuteTime": {
"end_time": "2023-07-13T04:47:57.078106Z",
"start_time": "2023-07-13T04:47:57.076377Z"
"end_time": "2023-09-20T14:03:08.158339Z",
"start_time": "2023-09-20T14:03:08.156731Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -147,8 +160,8 @@
"id": "2baa6f73",
"metadata": {
"ExecuteTime": {
"end_time": "2023-07-13T04:47:57.084015Z",
"start_time": "2023-07-13T04:47:57.082263Z"
"end_time": "2023-09-20T14:03:08.164064Z",
"start_time": "2023-09-20T14:03:08.162595Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -183,13 +196,16 @@
"id": "71334cab",
"metadata": {
"ExecuteTime": {
"end_time": "2023-07-13T04:47:57.089037Z",
"start_time": "2023-07-13T04:47:57.086893Z"
"end_time": "2023-09-20T14:03:08.800682Z",
"start_time": "2023-09-20T14:03:08.166659Z"
}
},
"outputs": [],
"source": [
"event_create_for_update = event_data['carbon_v1_event_create_for_update']\n",
"event = event_data['carbon_v1_event_update']\n",
"\n",
"manager.update_from_event(event_create_for_update)\n",
"assert event['args']['order0'][0] != [pool['y_0'] for pool in manager.pool_data if pool['cid'] == event['args']['id']][0]\n",
"\n",
"manager.update_from_event(event)\n",
Expand All @@ -211,8 +227,8 @@
"id": "71d67e1c",
"metadata": {
"ExecuteTime": {
"end_time": "2023-07-13T04:47:57.336085Z",
"start_time": "2023-07-13T04:47:57.092889Z"
"end_time": "2023-09-20T14:03:08.820959Z",
"start_time": "2023-09-20T14:03:08.805835Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -240,8 +256,8 @@
"id": "452029c9",
"metadata": {
"ExecuteTime": {
"end_time": "2023-07-13T04:47:57.572478Z",
"start_time": "2023-07-13T04:47:57.341059Z"
"end_time": "2023-09-20T14:03:08.838302Z",
"start_time": "2023-09-20T14:03:08.825262Z"
}
},
"outputs": [],
Expand Down

0 comments on commit 4056dd3

Please sign in to comment.