You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.
From @ixje "The problem with this is that you should not put mutable objects (e.g. a list) as the default values. because they are created only once and then reused for all instances ever created."
This caused the issue discovered by @lock9. When creating new instances of RawTransaction, the previous attributes were retained and the new ones appended until the max (16) was reached.
Expected behavior
A new transaction class should not retain old attributes.
How to reproduce
Create a new transaction and append an attribute in a loop.
Current behavior
This issue was first discovered by @lock9 and then further investigated by @jseagrave21 and @ixje.
Whenever an instance of a transaction is created the creator defines attributes in this manner:
From @ixje "The problem with this is that you should not put mutable objects (e.g. a list) as the default values. because they are created only once and then reused for all instances ever created."
This caused the issue discovered by @lock9. When creating new instances of
RawTransaction
, the previous attributes were retained and the new ones appended until the max (16) was reached.Expected behavior
A new transaction class should not retain old attributes.
How to reproduce
Create a new transaction and append an attribute in a loop.
Your environment
neo-python v0.8.4
Also references https://github.com/CityOfZion/neo-python/blob/9588aed21a58cf8f9e862679fd8a8cfa778fac5e/neo/Core/TX/RawTransaction.py
The text was updated successfully, but these errors were encountered: