Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Implement the PartialEq trait of Transaction #38

Open
musitdev opened this issue Jan 15, 2024 · 0 comments
Open

Implement the PartialEq trait of Transaction #38

musitdev opened this issue Jan 15, 2024 · 0 comments

Comments

@musitdev
Copy link
Contributor

PartialEq of the Transaction struct should be implemented by hand using the Hash and/or signature.
All other fields are not needed for the equality.
Even the propagated field can generate some strange behavior because 2 tx can be equals with this field different.
Tx should only be identifier by its Hash and the Hash and signature field should be private.

We should add a new method to create the Tx with its Hash and signature so It should never be modified. Currently, a Tx can be created and not signed.

The payload shouldn't implement PartialEq. It's not useful and even can lead to some issue when you need to add a payload when equality doesn't really exist.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant