-
Notifications
You must be signed in to change notification settings - Fork 143
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
Comparison of Transaction objects #311
Comments
Thanks for reporting this! I agree that this could be a problem and have replicated it on my machine. I think there could be a problem where someone might try to compare the |
Yes, I agree What do you think about comparing transaction ids in |
I am leaning towards changing the Let me know your thoughts and whether this makes sense. Also feel free to open a PR and I can take a look at the changes as well. |
I see, It may make sense when you think that these are two python objects. I think txid is the unique representation of these python objects on the network. If txid calculation is correct, we can simply make sure that these objects represent the same transaction on the blockchain. Possibly this bug can happen again because of another field in the future. I wanted to remove this possibility. |
Comparison (
__eq__
) of transaction objects (Ex.ApplicationCallTxn
)Because of
on_complete
(apan
) attribute of theApplicationCallTxn
, the comparison of two transactions gives the wrong output.The reason is
OnComplete.NoOpOC
(0) is not equal toNone
.I think the possible and clear solution is to use transaction id for comparison. If you think this is the right approach, I can open a PR.
Your environment
py-algorand-sdk==1.11.0
Steps to reproduce
Expected behaviour
txn_a == txn_b
should returnTrue
Actual behaviour
txn_a == txn_b
returnsFalse
The text was updated successfully, but these errors were encountered: