-
Notifications
You must be signed in to change notification settings - Fork 1
Dexbot3 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Dexbot3 #2
Changes from all commits
6b0389c
5c6ab27
f4f4a05
5172ea1
468d7bd
6027063
2e9dc30
c5ecdb4
b1d8e75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,20 @@ | ||
| import sys | ||
| try: | ||
| sys.path.append('/opt/dexbot3/src/') | ||
| sys.path.append('/opt/dexbot3/src/dexilon-python-sdk') | ||
| except: | ||
| print("path not exist") | ||
|
|
||
| from DexilonClientImpl import DexilonClientImpl | ||
| from OrderErrorInfo import OrderErrorInfo | ||
| from responses import FullOrderInfo | ||
|
|
||
|
|
||
| class TestAuthentication: | ||
| TEST_METAMASK_ADDRESS = '0x201d980aeD5C04a7e75860cFE29CeD9b5da05A08' | ||
| TEST_PRIVATE_KEY = '87d25c8ade8c4bb32be098bb35cd594fd1c0511c4423bf36f006f4ecd27f017c' | ||
| # TEST_METAMASK_ADDRESS = '0x201d980aeD5C04a7e75860cFE29CeD9b5da05A08' | ||
| # TEST_PRIVATE_KEY = '87d25c8ade8c4bb32be098bb35cd594fd1c0511c4423bf36f006f4ecd27f017c' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. давай удалим это?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. да, удаляем |
||
| TEST_METAMASK_ADDRESS = '0x40e42c763Dfd16EF2302c49240040a480a081C3A' | ||
| TEST_PRIVATE_KEY = '8abc5ca595d9bb6ebe133936ede1f689450baba2e5a571c2a0e356872a695b28' | ||
|
|
||
| def setup(self): | ||
| self.test_instance = DexilonClientImpl(self.TEST_METAMASK_ADDRESS, self.TEST_PRIVATE_KEY) | ||
|
|
@@ -15,8 +24,7 @@ def setup(self): | |
| def test_should_get_cosmos_address_mapping_successfully(self): | ||
| cosmos_address_maping = self.test_instance.get_cosmos_address_mapping(self.TEST_METAMASK_ADDRESS) | ||
| assert cosmos_address_maping is not None | ||
| assert cosmos_address_maping.addressMapping is not None | ||
|
|
||
| # TODO add asserts | ||
|
|
||
| def test_should_get_address_not_found_if_there_is_no_mapping(self): | ||
| cosmos_address_maping = self.test_instance.get_cosmos_address_mapping(self.TEST_METAMASK_ADDRESS + "_WRONG") | ||
|
|
@@ -50,3 +58,8 @@ def test_should_reauthenticate_on_delete_order(self): | |
| self.test_instance.headers['Authorization'] = 'Bearer + ' + self.test_instance.JWT_KEY | ||
| result = self.test_instance.cancel_order('TESTORDERID1', 'btc_usdc') | ||
| assert result | ||
|
|
||
| if __name__ == "__main__": | ||
| t1 = TestAuthentication() | ||
| t1.setup() | ||
| t1.test_should_get_cosmos_address_mapping_successfully() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. и зачем нам здесь main?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. это тоже не надо, это патч на скорую руку когда не проходила аутентификацию. Не нужен |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем этот кусок?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это кусок надо переписать, это локальный патч на случай копирования библиотеки локально в пути. В тестах это не критично, это я проверял аутентификацию
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
давай удалим из codebase?