Skip to content

Commit

Permalink
fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewcasale committed Oct 25, 2023
1 parent c5e3473 commit 9e1966f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 26 deletions.
68 changes: 44 additions & 24 deletions resources/NBTest/NBTest_036_Manager.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"id": "6b800d59",
"metadata": {
"ExecuteTime": {
"end_time": "2023-09-20T14:03:06.090221Z",
"start_time": "2023-09-20T14:03:02.984869Z"
"end_time": "2023-10-25T21:54:03.702203Z",
"start_time": "2023-10-25T21:54:03.673861Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ConstantProductCurve v3.3 (21/Sep/2023)\n",
"ConstantProductCurve v3.3.1 (05/Oct/2023)\n",
"CarbonBot v3-b2.2 (20/June/2023)\n",
"UniswapV2 v0.0.2 (2023-08-27)\n",
"UniswapV3 v0.0.2 (2023-08-27)\n",
Expand Down Expand Up @@ -66,8 +66,8 @@
"id": "80ddef38",
"metadata": {
"ExecuteTime": {
"end_time": "2023-09-20T14:03:06.128079Z",
"start_time": "2023-09-20T14:03:06.090785Z"
"end_time": "2023-10-25T21:54:03.740704Z",
"start_time": "2023-10-25T21:54:03.680472Z"
}
},
"outputs": [],
Expand All @@ -87,31 +87,51 @@
"id": "7919999a",
"metadata": {
"ExecuteTime": {
"end_time": "2023-09-20T14:03:08.151919Z",
"start_time": "2023-09-20T14:03:06.113589Z"
"end_time": "2023-10-25T21:54:06.879756Z",
"start_time": "2023-10-25T21:54:03.715830Z"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-09-26 17:02:08,875 [fastlane:INFO] - \n",
"2023-09-26 17:02:08,876 [fastlane:INFO] - **********************************************\n",
"2023-09-26 17:02:08,876 [fastlane:INFO] - The logging path is set to: logs/20230926-170208/bot.log\n",
"2023-09-26 17:02:08,877 [fastlane:INFO] - **********************************************\n",
"2023-09-26 17:02:08,877 [fastlane:INFO] - \n",
"2023-09-26 17:02:09,863 [fastlane:INFO] - Retrieved 176 carbon pairs from contract\n"
"2023-10-25 14:54:49,262 [fastlane:INFO] - \n",
"2023-10-25 14:54:49,262 [fastlane:INFO] - **********************************************\n",
"2023-10-25 14:54:49,263 [fastlane:INFO] - The logging path is set to: logs/20231025-145449/bot.log\n",
"2023-10-25 14:54:49,263 [fastlane:INFO] - **********************************************\n",
"2023-10-25 14:54:49,263 [fastlane:INFO] - \n",
"2023-10-25 14:54:50,368 [fastlane:INFO] - Retrieved 199 carbon pairs from contract\n",
"2023-10-25 14:54:52,025 [fastlane:INFO] - Adding 32720 uniswap_v2 pools to static pools\n",
"2023-10-25 14:54:52,027 [fastlane:INFO] - Adding 4877 uniswap_v3 pools to static pools\n"
]
}
],
"source": [
"from fastlane_bot.events.utils import handle_static_pools_update, get_static_data\n",
"\n",
"# Create mock instances for all required parameters\n",
"cfg = Config.new(config=Config.CONFIG_MAINNET)\n",
"\n",
"(\n",
" static_pool_data,\n",
" tokens,\n",
" uniswap_v2_event_mappings,\n",
" uniswap_v3_event_mappings,\n",
") = get_static_data(\n",
" cfg, ['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3'], 'static_pool_data', 'max'\n",
")\n",
"# create manager instance for all tests\n",
"manager = Manager(cfg.w3, cfg, pool_data, 20, SUPPORTED_EXCHANGES=['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3'])\n"
"manager = Manager(cfg.w3, \n",
" cfg, \n",
" pool_data, \n",
" 20, \n",
" SUPPORTED_EXCHANGES=['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3'],\n",
" forked_exchanges=['uniswap_v2', 'uniswap_v3'],\n",
" uniswap_v2_event_mappings=uniswap_v2_event_mappings,\n",
" uniswap_v3_event_mappings=uniswap_v3_event_mappings)\n",
"\n",
"handle_static_pools_update(manager)"
]
},
{
Expand All @@ -128,8 +148,8 @@
"id": "584c8056",
"metadata": {
"ExecuteTime": {
"end_time": "2023-09-20T14:03:08.158339Z",
"start_time": "2023-09-20T14:03:08.156731Z"
"end_time": "2023-10-25T21:54:06.982273Z",
"start_time": "2023-10-25T21:54:06.964246Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -158,8 +178,8 @@
"id": "2baa6f73",
"metadata": {
"ExecuteTime": {
"end_time": "2023-09-20T14:03:08.164064Z",
"start_time": "2023-09-20T14:03:08.162595Z"
"end_time": "2023-10-25T21:54:06.982571Z",
"start_time": "2023-10-25T21:54:06.968786Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -194,8 +214,8 @@
"id": "71334cab",
"metadata": {
"ExecuteTime": {
"end_time": "2023-09-20T14:03:08.800682Z",
"start_time": "2023-09-20T14:03:08.166659Z"
"end_time": "2023-10-25T21:54:07.613585Z",
"start_time": "2023-10-25T21:54:06.975784Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -225,8 +245,8 @@
"id": "71d67e1c",
"metadata": {
"ExecuteTime": {
"end_time": "2023-09-20T14:03:08.820959Z",
"start_time": "2023-09-20T14:03:08.805835Z"
"end_time": "2023-10-25T21:54:08.265334Z",
"start_time": "2023-10-25T21:54:07.618487Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -254,8 +274,8 @@
"id": "452029c9",
"metadata": {
"ExecuteTime": {
"end_time": "2023-09-20T14:03:08.838302Z",
"start_time": "2023-09-20T14:03:08.825262Z"
"end_time": "2023-10-25T21:54:08.876281Z",
"start_time": "2023-10-25T21:54:08.265614Z"
}
},
"outputs": [],
Expand Down
21 changes: 19 additions & 2 deletions resources/NBTest/NBTest_036_Manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,30 @@
pool_data = json.load(f)

# +
from fastlane_bot.events.utils import handle_static_pools_update, get_static_data

# Create mock instances for all required parameters
cfg = Config.new(config=Config.CONFIG_MAINNET)

(
static_pool_data,
tokens,
uniswap_v2_event_mappings,
uniswap_v3_event_mappings,
) = get_static_data(
cfg, ['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3'], 'static_pool_data', 'max'
)
# create manager instance for all tests
manager = Manager(cfg.w3, cfg, pool_data, 20, SUPPORTED_EXCHANGES=['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3'])

manager = Manager(cfg.w3,
cfg,
pool_data,
20,
SUPPORTED_EXCHANGES=['bancor_v3', 'carbon_v1', 'uniswap_v2', 'uniswap_v3'],
forked_exchanges=['uniswap_v2', 'uniswap_v3'],
uniswap_v2_event_mappings=uniswap_v2_event_mappings,
uniswap_v3_event_mappings=uniswap_v3_event_mappings)

handle_static_pools_update(manager)
# -

# ## test_update_from_event_uniswap_v2
Expand Down

0 comments on commit 9e1966f

Please sign in to comment.