hyperledger-archives / education-sawtooth-simple-supply

https://wiki.hyperledger.org/display/LMDWG
Apache License 2.0
51 stars 61 forks source link

Transfering ownership of records #39

Open techniqs opened 4 years ago

techniqs commented 4 years ago

Hi I`ve been studying this repo for my bachelor thesis and I´ve encountered a possible bug. When creating 2 different agents and transferring ownership of a record between them, for each transfer of a record made in the past, the record_owners table gets an entry. E.g. At the creation of the record one entry is made. Transferring the same record once will make two new entries in said table, and each successive transfer will increase the amount of entries made in this table by one. Is this behaviour intended? If yes, whats the reason for it?

image The screenshot shows the record_owners table after generating one record for a user and transfering it back and forth 3 times.

Thanks in advance.

danintel commented 4 years ago

I did not write this, but yes, it sounds like a bug. The old record in the database is not deleted. Transactions in the original blockchain cannot be deleted, but can be undone with latter transactions. The record_owners database should be updated to remove and not just add ownership.

Feel free to fix the problem with a pull request.

techniqs commented 4 years ago

I will fix it as soon as I`m done with my thesis.