Vyper: Tests of ERC20 Solidity compatible doesn't work

Created on 23 Nov 2018  路  5Comments  路  Source: vyperlang/vyper

Version Information

  • vyper Version: 0.1.0b4
  • OS: osx
  • Python Version: 3.6.3

What's your issue about?

I'm going to update ERC20 in example repository to the latest Vyper version (0.1.0b4) and working on the test of this. I tried the current tests in tests/examples/tokens/ERC20_solidity_compatible with python run_tests.py command but it causes this error.

(vyper) nrryuya:ERC20_solidity_compatible nrryuya1$ python run_tests.py 

Failed to import bitcoin. This is not a fatal error but does
mean that you will not be able to determine the address from
your wallet file.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Running Solidity-compatible ERC20 tests, Suite 1 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Initializing chain from provided state
Initializing chain from provided state
ERROR
Initializing chain from provided state
Initializing chain from provided state
test_deposit_and_withdraw (test.erc20_tests_1.TestSolidity1ERC20) ... ERROR
test_failed_send_in_withdraw (test.erc20_tests_1.TestSolidity1ERC20) ... ERROR
test_initial_state (test.erc20_tests_1.TestSolidity1ERC20) ... ERROR
test_maxInts (test.erc20_tests_1.TestSolidity1ERC20) ... ERROR
test_payability (test.erc20_tests_1.TestSolidity1ERC20) ... ERROR
test_raw_logs (test.erc20_tests_1.TestSolidity1ERC20) ... ERROR
test_totalSupply (test.erc20_tests_1.TestSolidity1ERC20) ... ERROR
test_transfer (test.erc20_tests_1.TestSolidity1ERC20) ... ERROR
test_transferFromAndAllowance (test.erc20_tests_1.TestSolidity1ERC20) ... ERROR
Initializing chain from provided state
Initializing chain from provided state
test_deposit_and_withdraw (test.erc20_tests_1.TestSolidity2ERC20) ... ERROR
test_failed_send_in_withdraw (test.erc20_tests_1.TestSolidity2ERC20) ... ERROR
test_initial_state (test.erc20_tests_1.TestSolidity2ERC20) ... ERROR
test_maxInts (test.erc20_tests_1.TestSolidity2ERC20) ... ERROR
test_payability (test.erc20_tests_1.TestSolidity2ERC20) ... ERROR
test_raw_logs (test.erc20_tests_1.TestSolidity2ERC20) ... ERROR
test_totalSupply (test.erc20_tests_1.TestSolidity2ERC20) ... ERROR
test_transfer (test.erc20_tests_1.TestSolidity2ERC20) ... ERROR
test_transferFromAndAllowance (test.erc20_tests_1.TestSolidity2ERC20) ... ERROR

======================================================================
ERROR: setUpClass (test.erc20_tests_1.TestVyperERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 343, in setUpClass
    cls.t.languages['vyper'] = compiler.Compiler()
AttributeError: module 'vyper.compiler' has no attribute 'Compiler'

======================================================================
ERROR: test_deposit_and_withdraw (test.erc20_tests_1.TestSolidity1ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 406, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_failed_send_in_withdraw (test.erc20_tests_1.TestSolidity1ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 406, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_initial_state (test.erc20_tests_1.TestSolidity1ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 406, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_maxInts (test.erc20_tests_1.TestSolidity1ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 406, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_payability (test.erc20_tests_1.TestSolidity1ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 406, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_raw_logs (test.erc20_tests_1.TestSolidity1ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 406, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_totalSupply (test.erc20_tests_1.TestSolidity1ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 406, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_transfer (test.erc20_tests_1.TestSolidity1ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 406, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_transferFromAndAllowance (test.erc20_tests_1.TestSolidity1ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 406, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_deposit_and_withdraw (test.erc20_tests_1.TestSolidity2ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 422, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_failed_send_in_withdraw (test.erc20_tests_1.TestSolidity2ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 422, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_initial_state (test.erc20_tests_1.TestSolidity2ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 422, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_maxInts (test.erc20_tests_1.TestSolidity2ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 422, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_payability (test.erc20_tests_1.TestSolidity2ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 422, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_raw_logs (test.erc20_tests_1.TestSolidity2ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 422, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_totalSupply (test.erc20_tests_1.TestSolidity2ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 422, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_transfer (test.erc20_tests_1.TestSolidity2ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 422, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_transferFromAndAllowance (test.erc20_tests_1.TestSolidity2ERC20)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 422, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_1.py", line 52, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

----------------------------------------------------------------------
Ran 18 tests in 0.415s

FAILED (errors=19)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Finished Solidity-compatible ERC20 tests, Suite 1 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Running Solidity-compatible ERC20 tests, Suite 2 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Initializing chain from provided state
Testing nonvyper/ERC20_solidity_2.sol
Deploying contract at 09f24956cac320a987934f5da542b19a4e1ff04e used 371261 gas
test_all (test.erc20_tests_2.ERC20_solidity_2_sol) ... ERROR
Initializing chain from provided state
Testing nonvyper/ERC20_solidity_1.sol
Deploying contract at 09f24956cac320a987934f5da542b19a4e1ff04e used 378559 gas
test_all (test.erc20_tests_2.ERC20_solidity_1_sol) ... ERROR

======================================================================
ERROR: test_all (test.erc20_tests_2.ERC20_solidity_2_sol)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_2.py", line 144, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/utils/pyethereum_test_utils.py", line 54, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

======================================================================
ERROR: test_all (test.erc20_tests_2.ERC20_solidity_1_sol)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/test/erc20_tests_2.py", line 144, in setUp
    super().setUp()
  File "/Users/nrryuya1/work/blockchain/nrryuya/vyper/tests/examples/tokens/ERC20_solidity_compatible/utils/pyethereum_test_utils.py", line 54, in setUp
    self.s.revert(self.initial_state)
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/ethereum/tools/tester.py", line 297, in revert
    self.block.transactions = self.block.transactions[:txcount]
  File "/Users/nrryuya1/.pyenv/versions/vyper/lib/python3.6/site-packages/rlp/sedes/serializable.py", line 334, in field_fn_setter
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

----------------------------------------------------------------------
Ran 2 tests in 0.287s

FAILED (errors=2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Finished Solidity-compatible ERC20 tests, Suite 2 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FAILED : Test failures encounting, exiting with error.

How can it be fixed?

As the first AttributeError: module 'vyper.compiler' has no attribute 'Compiler' shows, Compiler object is removed from vyper/compiler.py in this commit. We need to fix this somehow?

EDIT: I added the Compiler class in compiler.py and AttributeError: module 'vyper.compiler' has no attribute 'Compiler' disappeared. However, AttributeError: can't set attribute still remains.

Cute Animal Picture

image

Most helpful comment

Before starting with this PR, just wait for #1089 to be merged. As it #1089 changes the compiler interface slightly.

All 5 comments

This is also documented here (but it's not rendered correctly at docs ?)

Before starting with this PR, just wait for #1089 to be merged. As it #1089 changes the compiler interface slightly.

I think it actually is required, the reason is that one needs bad contract to access the specific branch.

Thanks. The code self.num_issued = uint256_add which is replaced to generate the bad_code doesn't exists so we need to modify that.

Also, AFAIK deposit & withdraw which allow users to exchange token at the ratio 1 wei = 1 token anytime is not a standard implementation. To implement mint and burn instead will make it more generally reusable while it's still enable the "bad code tests".

I want to refactor ERC20 example as follows.

  • Unify three types of ERC20 into one which has mint & burn, also name, symbol and decimal like vypercoin.vy
  • Reuse ERC20_solidity_compatible tests (because they are good one which tests for full branch/decision, statement coverage) with some modification
  • Add the tests to CI

I wonder rewriting ERC20_solidity_compatible tests with pytest, which makes it simple to add to CI and remove the dependency on pyethereum.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ben-kaufman picture ben-kaufman  路  3Comments

haydenadams picture haydenadams  路  3Comments

fubuloubu picture fubuloubu  路  3Comments

nrryuya picture nrryuya  路  3Comments

denis-bogdanas picture denis-bogdanas  路  3Comments