Automated Tests fail
hernandp opened this issue · 8 comments
Issue Type
[x] bug report
[ ] feature request
Current Behavior
11 Tests are failing. Header is:
======================================= test session starts ========================================
platform darwin -- Python 3.7.0, pytest-3.6.3, py-1.5.4, pluggy-0.6.0
rootdir: /Users/coinfabrik/src/plasma-mvp, inifile:
collected 40 items
tests/child_chain/test_block.py .. [ 5%]
tests/child_chain/test_child_chain.py FFFFF... [ 25%]
tests/child_chain/test_child_chain_integration.py FFFFFF [ 40%]
tests/child_chain/test_transaction.py . [ 42%]
tests/root_chain/contracts/data_structures/test_priority_queue.py ....... [ 60%]
tests/root_chain/contracts/root_chain/test_rlp.py .. [ 65%]
tests/root_chain/contracts/root_chain/test_root_chain.py ...... [ 80%]
tests/utils/test_fixed_merkle.py ........ [100%]
Failure list follows:
________________________________________ test_apply_deposit ________________________________________
test_lang = <testlang.testing_language.TestingLanguage object at 0x10f7b7cc0>
def test_apply_deposit(test_lang):
owner = test_lang.get_account()
test_lang.deposit(owner, 100)
deposit_block_number = 1
> deposit_block = test_lang.child_chain.blocks[deposit_block_number]
E KeyError: 1
tests/child_chain/test_child_chain.py:13: KeyError
-------------------------------------- Captured stdout setup ---------------------------------------
Successfully deployed RootChain contract!
______________________________________ test_send_tx_with_sig _______________________________________
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
> result.append(sedes.serialize(element))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, obj = None
def serialize(self, obj):
if not is_integer(obj):
> raise SerializationError('Can only serialize integers', obj)
E rlp.exceptions.SerializationError: Can only serialize integers
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/big_endian_int.py:17: SerializationError
During handling of the above exception, another exception occurred:
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x10f67bb00>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
> result = cls.get_sedes().serialize(field_values)
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
result.append(sedes.serialize(element))
except SerializationError as e:
> raise ListSerializationError(obj=obj, element_exception=e, index=index)
E rlp.exceptions.ListSerializationError: Serialization failed because of element at index 0 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:61: ListSerializationError
During handling of the above exception, another exception occurred:
test_lang = <testlang.testing_language.TestingLanguage object at 0x10f6c61d0>
def test_send_tx_with_sig(test_lang):
owner_1 = test_lang.get_account()
owner_2 = test_lang.get_account()
deposit_id = test_lang.deposit(owner_1, 100)
> test_lang.transfer(deposit_id, 0, owner_2, 100, owner_1)
tests/child_chain/test_child_chain.py:22:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testlang/testing_language.py:76: in transfer
tx.sign1(key1)
plasma_core/transaction.py:71: in sign1
self.sig1 = sign(self.hash, key)
plasma_core/transaction.py:64: in hash
return utils.sha3(rlp.encode(self, UnsignedTransaction))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/codec.py:53: in encode
item = sedes.serialize(obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x10f67bb00>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
result = cls.get_sedes().serialize(field_values)
except ListSerializationError as e:
> raise ObjectSerializationError(obj=obj, sedes=cls, list_exception=e)
E rlp.exceptions.ObjectSerializationError: Serialization failed because of field blknum1 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:238: ObjectSerializationError
-------------------------------------- Captured stdout setup ---------------------------------------
Successfully deployed RootChain contract!
_______________________________________ test_send_tx_no_sig ________________________________________
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...ject at 0x10e5c7400>, <rlp.sedes.binary.Binary object at 0x10e5c7c18>, <rlp.sedes.binary.Binary object at 0x10e5c7c18>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
> result.append(sedes.serialize(element))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, obj = None
def serialize(self, obj):
if not is_integer(obj):
> raise SerializationError('Can only serialize integers', obj)
E rlp.exceptions.SerializationError: Can only serialize integers
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/big_endian_int.py:17: SerializationError
During handling of the above exception, another exception occurred:
cls = <class 'plasma_core.transaction.Transaction'>
obj = <plasma_core.transaction.Transaction object at 0x10f67b828>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
> result = cls.get_sedes().serialize(field_values)
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...ject at 0x10e5c7400>, <rlp.sedes.binary.Binary object at 0x10e5c7c18>, <rlp.sedes.binary.Binary object at 0x10e5c7c18>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
result.append(sedes.serialize(element))
except SerializationError as e:
> raise ListSerializationError(obj=obj, element_exception=e, index=index)
E rlp.exceptions.ListSerializationError: Serialization failed because of element at index 0 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:61: ListSerializationError
During handling of the above exception, another exception occurred:
test_lang = <testlang.testing_language.TestingLanguage object at 0x10f79d6a0>
def test_send_tx_no_sig(test_lang):
owner_1 = test_lang.get_account()
owner_2 = test_lang.get_account()
key = None
deposit_id = test_lang.deposit(owner_1, 100)
with pytest.raises(InvalidTxSignatureException):
> test_lang.transfer(deposit_id, 0, owner_2, 100, key)
tests/child_chain/test_child_chain.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testlang/testing_language.py:82: in transfer
encoded_tx = rlp.encode(tx).hex()
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/codec.py:55: in encode
item = infer_sedes(obj).serialize(obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'plasma_core.transaction.Transaction'>
obj = <plasma_core.transaction.Transaction object at 0x10f67b828>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
result = cls.get_sedes().serialize(field_values)
except ListSerializationError as e:
> raise ObjectSerializationError(obj=obj, sedes=cls, list_exception=e)
E rlp.exceptions.ObjectSerializationError: Serialization failed because of field blknum1 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:238: ObjectSerializationError
-------------------------------------- Captured stdout setup ---------------------------------------
Successfully deployed RootChain contract!
_____________________________________ test_send_tx_invalid_sig _____________________________________
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
> result.append(sedes.serialize(element))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, obj = None
def serialize(self, obj):
if not is_integer(obj):
> raise SerializationError('Can only serialize integers', obj)
E rlp.exceptions.SerializationError: Can only serialize integers
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/big_endian_int.py:17: SerializationError
During handling of the above exception, another exception occurred:
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x10f6f07f0>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
> result = cls.get_sedes().serialize(field_values)
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
result.append(sedes.serialize(element))
except SerializationError as e:
> raise ListSerializationError(obj=obj, element_exception=e, index=index)
E rlp.exceptions.ListSerializationError: Serialization failed because of element at index 0 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:61: ListSerializationError
During handling of the above exception, another exception occurred:
test_lang = <testlang.testing_language.TestingLanguage object at 0x10f767828>
def test_send_tx_invalid_sig(test_lang):
owner_1 = test_lang.get_account()
owner_2 = test_lang.get_account()
owner_3 = test_lang.get_account()
deposit_id = test_lang.deposit(owner_1, 100)
with pytest.raises(InvalidTxSignatureException):
> test_lang.transfer(deposit_id, 0, owner_2, 100, owner_3)
tests/child_chain/test_child_chain.py:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testlang/testing_language.py:76: in transfer
tx.sign1(key1)
plasma_core/transaction.py:71: in sign1
self.sig1 = sign(self.hash, key)
plasma_core/transaction.py:64: in hash
return utils.sha3(rlp.encode(self, UnsignedTransaction))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/codec.py:53: in encode
item = sedes.serialize(obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x10f6f07f0>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
result = cls.get_sedes().serialize(field_values)
except ListSerializationError as e:
> raise ObjectSerializationError(obj=obj, sedes=cls, list_exception=e)
E rlp.exceptions.ObjectSerializationError: Serialization failed because of field blknum1 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:238: ObjectSerializationError
-------------------------------------- Captured stdout setup ---------------------------------------
Successfully deployed RootChain contract!
____________________________________ test_send_tx_double_spend _____________________________________
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
> result.append(sedes.serialize(element))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, obj = None
def serialize(self, obj):
if not is_integer(obj):
> raise SerializationError('Can only serialize integers', obj)
E rlp.exceptions.SerializationError: Can only serialize integers
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/big_endian_int.py:17: SerializationError
During handling of the above exception, another exception occurred:
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x10f6f00b8>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
> result = cls.get_sedes().serialize(field_values)
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
result.append(sedes.serialize(element))
except SerializationError as e:
> raise ListSerializationError(obj=obj, element_exception=e, index=index)
E rlp.exceptions.ListSerializationError: Serialization failed because of element at index 0 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:61: ListSerializationError
During handling of the above exception, another exception occurred:
test_lang = <testlang.testing_language.TestingLanguage object at 0x10f744780>
def test_send_tx_double_spend(test_lang):
owner_1 = test_lang.get_account()
owner_2 = test_lang.get_account()
deposit_id = test_lang.deposit(owner_1, 100)
> test_lang.transfer(deposit_id, 0, owner_2, 100, owner_1)
tests/child_chain/test_child_chain.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testlang/testing_language.py:76: in transfer
tx.sign1(key1)
plasma_core/transaction.py:71: in sign1
self.sig1 = sign(self.hash, key)
plasma_core/transaction.py:64: in hash
return utils.sha3(rlp.encode(self, UnsignedTransaction))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/codec.py:53: in encode
item = sedes.serialize(obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x10f6f00b8>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
result = cls.get_sedes().serialize(field_values)
except ListSerializationError as e:
> raise ObjectSerializationError(obj=obj, sedes=cls, list_exception=e)
E rlp.exceptions.ObjectSerializationError: Serialization failed because of field blknum1 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:238: ObjectSerializationError
-------------------------------------- Captured stdout setup ---------------------------------------
Successfully deployed RootChain contract!
___________________________________________ test_deposit ___________________________________________
test_lang = <testlang.testing_language.TestingLanguage object at 0x10f7b7780>
def test_deposit(test_lang):
owner_1 = test_lang.get_account()
deposit_id = test_lang.deposit(owner_1, 100)
tx = Transaction(0, 0, 0, 0, 0, 0, NULL_ADDRESS, owner_1['address'], 100, NULL_ADDRESS, 0, 0)
deposit_hash = Web3.soliditySha3(['address', 'address', 'uint256'], [owner_1['address'], NULL_ADDRESS_HEX, 100])
assert test_lang.transactions[deposit_id]['tx'].hash == tx.hash
deposit_blknum = 1
> deposit_block = test_lang.child_chain.blocks[deposit_blknum]
E KeyError: 1
tests/child_chain/test_child_chain_integration.py:17: KeyError
-------------------------------------- Captured stdout setup ---------------------------------------
Successfully deployed RootChain contract!
__________________________________________ test_transfer ___________________________________________
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
> result.append(sedes.serialize(element))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, obj = None
def serialize(self, obj):
if not is_integer(obj):
> raise SerializationError('Can only serialize integers', obj)
E rlp.exceptions.SerializationError: Can only serialize integers
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/big_endian_int.py:17: SerializationError
During handling of the above exception, another exception occurred:
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x113159080>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
> result = cls.get_sedes().serialize(field_values)
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
result.append(sedes.serialize(element))
except SerializationError as e:
> raise ListSerializationError(obj=obj, element_exception=e, index=index)
E rlp.exceptions.ListSerializationError: Serialization failed because of element at index 0 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:61: ListSerializationError
During handling of the above exception, another exception occurred:
test_lang = <testlang.testing_language.TestingLanguage object at 0x10f79d208>
def test_transfer(test_lang):
owner_1 = test_lang.get_account()
owner_2 = test_lang.get_account()
deposit_id = test_lang.deposit(owner_1, 100)
> transfer_id = test_lang.transfer(deposit_id, 0, owner_2, 100, owner_1)
tests/child_chain/test_child_chain_integration.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testlang/testing_language.py:76: in transfer
tx.sign1(key1)
plasma_core/transaction.py:71: in sign1
self.sig1 = sign(self.hash, key)
plasma_core/transaction.py:64: in hash
return utils.sha3(rlp.encode(self, UnsignedTransaction))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/codec.py:53: in encode
item = sedes.serialize(obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x113159080>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
result = cls.get_sedes().serialize(field_values)
except ListSerializationError as e:
> raise ObjectSerializationError(obj=obj, sedes=cls, list_exception=e)
E rlp.exceptions.ObjectSerializationError: Serialization failed because of field blknum1 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:238: ObjectSerializationError
-------------------------------------- Captured stdout setup ---------------------------------------
Successfully deployed RootChain contract!
________________________________________ test_submit_block _________________________________________
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
> result.append(sedes.serialize(element))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, obj = None
def serialize(self, obj):
if not is_integer(obj):
> raise SerializationError('Can only serialize integers', obj)
E rlp.exceptions.SerializationError: Can only serialize integers
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/big_endian_int.py:17: SerializationError
During handling of the above exception, another exception occurred:
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x1131611d0>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
> result = cls.get_sedes().serialize(field_values)
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
result.append(sedes.serialize(element))
except SerializationError as e:
> raise ListSerializationError(obj=obj, element_exception=e, index=index)
E rlp.exceptions.ListSerializationError: Serialization failed because of element at index 0 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:61: ListSerializationError
During handling of the above exception, another exception occurred:
test_lang = <testlang.testing_language.TestingLanguage object at 0x110c10358>
def test_submit_block(test_lang):
owner_1 = test_lang.get_account()
owner_2 = test_lang.get_account()
deposit_id = test_lang.deposit(owner_1, 100)
> test_lang.transfer(deposit_id, 0, owner_2, 100, owner_1)
tests/child_chain/test_child_chain_integration.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testlang/testing_language.py:76: in transfer
tx.sign1(key1)
plasma_core/transaction.py:71: in sign1
self.sig1 = sign(self.hash, key)
plasma_core/transaction.py:64: in hash
return utils.sha3(rlp.encode(self, UnsignedTransaction))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/codec.py:53: in encode
item = sedes.serialize(obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x1131611d0>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
result = cls.get_sedes().serialize(field_values)
except ListSerializationError as e:
> raise ObjectSerializationError(obj=obj, sedes=cls, list_exception=e)
E rlp.exceptions.ObjectSerializationError: Serialization failed because of field blknum1 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:238: ObjectSerializationError
-------------------------------------- Captured stdout setup ---------------------------------------
Successfully deployed RootChain contract!
___________________________________________ test_confirm ___________________________________________
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
> result.append(sedes.serialize(element))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, obj = None
def serialize(self, obj):
if not is_integer(obj):
> raise SerializationError('Can only serialize integers', obj)
E rlp.exceptions.SerializationError: Can only serialize integers
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/big_endian_int.py:17: SerializationError
During handling of the above exception, another exception occurred:
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x110c10748>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
> result = cls.get_sedes().serialize(field_values)
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
result.append(sedes.serialize(element))
except SerializationError as e:
> raise ListSerializationError(obj=obj, element_exception=e, index=index)
E rlp.exceptions.ListSerializationError: Serialization failed because of element at index 0 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:61: ListSerializationError
During handling of the above exception, another exception occurred:
test_lang = <testlang.testing_language.TestingLanguage object at 0x1103291d0>
def test_confirm(test_lang):
owner_1 = test_lang.get_account()
owner_2 = test_lang.get_account()
deposit_id = test_lang.deposit(owner_1, 100)
> transfer_id = test_lang.transfer(deposit_id, 0, owner_2, 100, owner_1)
tests/child_chain/test_child_chain_integration.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testlang/testing_language.py:76: in transfer
tx.sign1(key1)
plasma_core/transaction.py:71: in sign1
self.sig1 = sign(self.hash, key)
plasma_core/transaction.py:64: in hash
return utils.sha3(rlp.encode(self, UnsignedTransaction))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/codec.py:53: in encode
item = sedes.serialize(obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x110c10748>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
result = cls.get_sedes().serialize(field_values)
except ListSerializationError as e:
> raise ObjectSerializationError(obj=obj, sedes=cls, list_exception=e)
E rlp.exceptions.ObjectSerializationError: Serialization failed because of field blknum1 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:238: ObjectSerializationError
-------------------------------------- Captured stdout setup ---------------------------------------
Successfully deployed RootChain contract!
______________________________________ test_withdraw_transfer ______________________________________
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
> result.append(sedes.serialize(element))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, obj = None
def serialize(self, obj):
if not is_integer(obj):
> raise SerializationError('Can only serialize integers', obj)
E rlp.exceptions.SerializationError: Can only serialize integers
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/big_endian_int.py:17: SerializationError
During handling of the above exception, another exception occurred:
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x1111ef160>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
> result = cls.get_sedes().serialize(field_values)
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = [<rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e...c7400>, <rlp.sedes.binary.Binary object at 0x10e5762e8>, <rlp.sedes.big_endian_int.BigEndianInt object at 0x10e5c7400>]
obj = [None, None, 0, 0, 0, 0, ...]
def serialize(self, obj):
if not is_sequence(obj):
raise ListSerializationError('Can only serialize sequences', obj)
if self.strict and len(self) != len(obj) or len(self) < len(obj):
raise ListSerializationError('List has wrong length', obj)
result = []
for index, (element, sedes) in enumerate(zip(obj, self)):
try:
result.append(sedes.serialize(element))
except SerializationError as e:
> raise ListSerializationError(obj=obj, element_exception=e, index=index)
E rlp.exceptions.ListSerializationError: Serialization failed because of element at index 0 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:61: ListSerializationError
During handling of the above exception, another exception occurred:
test_lang = <testlang.testing_language.TestingLanguage object at 0x1119cf240>
def test_withdraw_transfer(test_lang):
owner_1 = test_lang.get_account()
owner_2 = test_lang.get_account()
deposit_id = test_lang.deposit(owner_1, 100)
> transfer_id = test_lang.transfer(deposit_id, 0, owner_2, 100, owner_1)
tests/child_chain/test_child_chain_integration.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testlang/testing_language.py:76: in transfer
tx.sign1(key1)
plasma_core/transaction.py:71: in sign1
self.sig1 = sign(self.hash, key)
plasma_core/transaction.py:64: in hash
return utils.sha3(rlp.encode(self, UnsignedTransaction))
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/codec.py:53: in encode
item = sedes.serialize(obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'rlp.sedes.lists.Serializable.exclude.<locals>.SerializableExcluded'>
obj = <plasma_core.transaction.Transaction object at 0x1111ef160>
@classmethod
def serialize(cls, obj):
try:
field_values = [getattr(obj, field) for field, _ in cls.fields]
except AttributeError:
raise ObjectSerializationError('Cannot serialize this object (missing attribute)', obj)
try:
result = cls.get_sedes().serialize(field_values)
except ListSerializationError as e:
> raise ObjectSerializationError(obj=obj, sedes=cls, list_exception=e)
E rlp.exceptions.ObjectSerializationError: Serialization failed because of field blknum1 ("Can only serialize integers")
env/lib/python3.7/site-packages/rlp-0.6.0-py3.7.egg/rlp/sedes/lists.py:238: ObjectSerializationError
-------------------------------------- Captured stdout setup ---------------------------------------
Successfully deployed RootChain contract!
______________________________________ test_withdraw_deposit _______________________________________
test_lang = <testlang.testing_language.TestingLanguage object at 0x111b6f2b0>
def test_withdraw_deposit(test_lang):
owner_1 = test_lang.get_account()
deposit_id = test_lang.deposit(owner_1, 100)
> test_lang.withdraw(deposit_id, 0, owner_1)
tests/child_chain/test_child_chain_integration.py:84:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <testlang.testing_language.TestingLanguage object at 0x111b6f2b0>, tx_id = 0, oindex = 0
exitor = {'address': '0x4B3eC6c9dC67079E82152d6D55d8dd96a8e6AA26', 'key': b'\xb97\xb2\xc6\xa6\x06\xed\xf1\xa4\xd6qH_\x0f\xa6\x1d\xccQ\x02\xe1\xeb\xca9/Z\x81@\xb2:\x8a\xc0O'}
def withdraw(self, tx_id, oindex, exitor):
transaction = self.transactions[tx_id]
tx = transaction['tx']
encoded_tx = rlp.encode(tx).hex()
tx_bytes = rlp.encode(tx, UnsignedTransaction)
sigs = tx.sig1 + tx.sig2 + transaction['confirm_sigs']
blknum, txindex = self.child_chain.get_tx_pos(encoded_tx)
> utxo_pos = blknum * 1000000000 + txindex * 10000 + oindex * 1
E TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
testlang/testing_language.py:129: TypeError
-------------------------------------- Captured stdout setup ---------------------------------------
Successfully deployed RootChain contract!
============================== 11 failed, 29 passed in 29.61 seconds ===============================
Expected Behavior
I expect all tests to pass.
Steps to Reproduce
- Installed Python 3.7 with Brew.
- Created a VirtualEnv environment.
- Booted up the Virtualenv environment with
activate
- Issued
make
command (successfully) - Ran ganache-cli with plasma_mvp mnemonic.
- Some tests (11) will fail.
Suggested Fix
Motivation for Change
I expect all tests to succeed.
System Specs
- python version: 3.7.0
- pyetherem version: 1.0.0
- environment (output of running
pip freeze
):
atomicwrites==1.1.5
attrdict==2.0.0
attrs==18.1.0
certifi==2018.4.16
chardet==3.0.4
click==6.7
cytoolz==0.9.0.1
eth-abi==1.1.1
eth-account==0.2.3
eth-hash==0.1.4
eth-keyfile==0.5.1
eth-keys==0.2.0b3
eth-rlp==0.1.2
eth-utils==1.0.3
ethereum==2.3.0
flake8==3.5.0
future==0.16.0
hexbytes==0.1.0
idna==2.7
json-rpc==1.10.8
lru-dict==1.1.6
mccabe==0.6.1
more-itertools==4.2.0
parsimonious==0.8.0
pbkdf2==1.3
plasma==0.0.0
pluggy==0.6.0
plyvel==1.0.4
py==1.5.4
py-ecc==1.4.3
py-solc==3.1.0
pycodestyle==2.3.1
pycryptodome==3.6.4
pyethash==0.1.27
pyflakes==1.6.0
pysha3==1.0.2
pytest==3.6.3
PyYAML==4.2b4
repoze.lru==0.7
requests==2.19.1
rlp==0.6.0
scrypt==0.8.6
semantic-version==2.6.0
six==1.11.0
toolz==0.9.0
urllib3==1.23
web3==4.3.0
websockets==4.0.1
Werkzeug==0.13
- operating system: MacOS 10.13.4
Can you try running with py3.6? Seems like there are a lot of compatibility issues with 3.7
Tried 3.6.0, 3.6.5, 3.6.6RC1 using pyenv and I'm getting the same errors.
I was getting the same error and running virtualenv
and 3.6.6 ended up working for me.
What I'm detecting is that the following function makes a bunch of tests to fail due to self.blocks
array being empty (so this returns None,None and in the caller the null type cannot be used with the multiplication operation and everything falls down).
def get_tx_pos(self, transaction):
decoded_tx = rlp.decode(utils.decode_hex(transaction), Transaction)
for blknum in self.blocks:
block = self.blocks[blknum]
for txindex in range(0, len(block.transaction_set)):
tx = block.transaction_set[txindex]
if (decoded_tx.hash == tx.hash):
return blknum, txindex
return None, None
This is I think a manifestation of a general problem.
This array self.blocks
is updated on the childChain.apply_deposit
method , which is a handler for the 'Deposit' event.
This method is never called on my system, as if no events were emitted.
I put breakpoints on the filter_loop
method which scans for the related events, but none of the suscribed ones ever arrive.
Additional info on the behavior described above. Ganache-Cli with verbose output shows eth_newFilter and eth_getFilterLogs called from code, but without results. (Note that I made 0 to latest as block range just to try):
eth_newFilter
> {
> "jsonrpc": "2.0",
> "method": "eth_newFilter",
> "params": [
> {
> "topics": [
> "0xf0537507c0bb9b823a1e4f5522ed9f25512618d4d169c9eb70a5ee2e9fb8bd57"
> ],
> "address": "0x30D399A57Ccaf412C6756d5b379A89f244Be6850",
> "fromBlock": "0x0",
> "toBlock": "latest"
> }
> ],
> "id": 264
> }
< {
< "id": 264,
< "jsonrpc": "2.0",
< "result": "0x1a7"
< }
eth_getFilterLogs
> {
> "jsonrpc": "2.0",
> "method": "eth_getFilterLogs",
> "params": [
> "0x1a7"
> ],
> "id": 265
> }
< {
< "id": 265,
< "jsonrpc": "2.0",
< "result": []
< }
UPDATE
Works on Ganache 1.2.1. 😄
Closing, let's make sure to add a note to use Ganache 1.2.1+
I am not aware how to control which Ganache I am using... It would be very nice if the README had some more accurate installation instructions...
ganache-cli --version
> unknown