This repository has been archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Fix abi generation using Python 3.8 #137
Open
meevee98
wants to merge
4
commits into
CityOfZion:development
Choose a base branch
from
simplitech:fix-abi-methods
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi @ixje , can you review this? |
ixje
suggested changes
Aug 17, 2020
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.
If there is an internal difference between Python 3.7 and Python 3.8 and we have different code paths for it, then we should extend the Travis-CI config to run all tests on both 3.7 and 3.8 and make sure they pass.We need to either wait for a new neo-python release (which has the fix for thepip
related error currently shown in travis, or change the travis config to manually downgrade to a pip version19.x
that's supported by the currentneo-python
release on PyPi.- Note: the tests seems to fail here on 3.8
======================================================================
ERROR: test_ICOTemplate_1 (tests.test_ico_template.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_ico_template.py", line 61, in test_ICOTemplate_1
out = output.write()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 240, in write
self.link_methods()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 309, in link_methods
raise Exception("Target method %s not found" % vmtoken.target_method)
Exception: Target method TOKEN_OWNER not found
======================================================================
ERROR: test_ICOTemplate_2 (tests.test_ico_template.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_ico_template.py", line 113, in test_ICOTemplate_2
out = output.write()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 240, in write
self.link_methods()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 309, in link_methods
raise Exception("Target method %s not found" % vmtoken.target_method)
Exception: Target method TOKEN_OWNER not found
======================================================================
ERROR: test_ICOTemplate_3_KYC (tests.test_ico_template.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_ico_template.py", line 170, in test_ICOTemplate_3_KYC
out = output.write()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 240, in write
self.link_methods()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 309, in link_methods
raise Exception("Target method %s not found" % vmtoken.target_method)
Exception: Target method TOKEN_OWNER not found
======================================================================
ERROR: test_ICOTemplate_4_attachments (tests.test_ico_template.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_ico_template.py", line 219, in test_ICOTemplate_4_attachments
out = output.write()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 240, in write
self.link_methods()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 309, in link_methods
raise Exception("Target method %s not found" % vmtoken.target_method)
Exception: Target method TOKEN_OWNER not found
======================================================================
ERROR: test_ICOTemplate_5_mint (tests.test_ico_template.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_ico_template.py", line 256, in test_ICOTemplate_5_mint
out = output.write()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 240, in write
self.link_methods()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 309, in link_methods
raise Exception("Target method %s not found" % vmtoken.target_method)
Exception: Target method TOKEN_OWNER not found
======================================================================
ERROR: test_ICOTemplate_6_approval (tests.test_ico_template.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_ico_template.py", line 297, in test_ICOTemplate_6_approval
out = output.write()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 240, in write
self.link_methods()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 309, in link_methods
raise Exception("Target method %s not found" % vmtoken.target_method)
Exception: Target method TOKEN_OWNER not found
======================================================================
ERROR: test_many_ops (tests.test_ico_template.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_ico_template.py", line 379, in test_many_ops
out = output.write()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 240, in write
self.link_methods()
File "/Users/erik/Documents/code/neo-boa/boa/code/module.py", line 309, in link_methods
raise Exception("Target method %s not found" % vmtoken.target_method)
Exception: Target method TOKEN_OWNER not found
======================================================================
FAIL: test_dict_keys1 (tests.test_dict_create.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_dict_create.py", line 31, in test_dict_keys1
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_dict_values1 (tests.test_dict_create.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_dict_create.py", line 38, in test_dict_values1
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_Iter1 (tests.test_iter.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_iter.py", line 34, in test_Iter1
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_Iter2 (tests.test_iter.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_iter.py", line 41, in test_Iter2
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_Iter3 (tests.test_iter.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_iter.py", line 48, in test_Iter3
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_Iter4 (tests.test_iter.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_iter.py", line 55, in test_Iter4
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_Iter5 (tests.test_iter.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_iter.py", line 62, in test_Iter5
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_Range2 (tests.test_iter.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_iter.py", line 77, in test_Range2
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_Range3 (tests.test_iter.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_iter.py", line 84, in test_Range3
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_Range4 (tests.test_iter.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_iter.py", line 91, in test_Range4
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_M2 (tests.test_module_vars.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_module_vars.py", line 22, in test_M2
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_Output (tests.test_tx.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_tx.py", line 23, in test_Output
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_Transaction (tests.test_tx.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_tx.py", line 126, in test_Transaction
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_TransactionWitnesses (tests.test_tx.TestContract)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-boa/boa_test/tests/test_tx.py", line 162, in test_TransactionWitnesses
self.assertEqual(len(results), 1)
AssertionError: 0 != 1
----------------------------------------------------------------------
Ran 111 tests in 13.835s
FAILED (failures=14, errors=7)
@ixje It seems that the tests were failing on 3.8 before this pull request as well. |
@meevee98 I didn't realize they were always failing on 3.8. I think it would be best to do it on a different PR and we can merge this PR afterwards. Note: we have to move the |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
The abi file generation using Python 3.8+ wasn't including any methods.
How did you solve this problem?
Passed the blocks that define the abi decorators codes to the
method
constructor as extra codes.Also included a verification, so python versions before 3.8 use the same code that was already working.
How did you make sure your solution works?
Ran the same unit tests that are working in Python 3.7, but using Python 3.8 instead