Skip to content

[Object Ownership #2] Add trasfer_to_object API in Transfer.move - #293

Merged
lxfind merged 1 commit into
mainfrom
allow-transfer-to-object
Jan 31, 2022
Merged

lxfind merged 1 commit into
mainfrom
allow-transfer-to-object

Conversation

@lxfind

@lxfind lxfind commented Jan 28, 2022

Copy link
Copy Markdown
Contributor

This is the second step towards #99.
It allows us to transfer an object to another object in Move.
To do so we added a transfer_to_object API in the Transfer module, which then invokes a native function to emit the corresponding event.
Latter in the adapter we process the event and change the owner accordingly.

@oxade

oxade commented Jan 28, 2022

Copy link
Copy Markdown
Contributor

This is interesting. I was not aware objects could own other objects.
This changes my design for client object storage because we might now have to walk the tree of descendant objects and store them.

@oxade

oxade commented Jan 28, 2022

Copy link
Copy Markdown
Contributor

@lxfind @sblackshear
If my object owns X another object Y, and X gets frozen, does Y get frozen too from my POV?

@lxfind

lxfind commented Jan 28, 2022

Copy link
Copy Markdown
Contributor Author

Yeah there will be some work needed in the client to support this, but don't worry about it at the moment.
I would wait till our client refactoring finishes before getting this into the client.

@lxfind

lxfind commented Jan 28, 2022

Copy link
Copy Markdown
Contributor Author

@lxfind @sblackshear If my object owns X another object Y, and X gets frozen, does Y get frozen too from my POV?

Based on the current design, yes. If X owns Y, and we freeze X, Y is also frozen (all objects owned by X will be frozen).

@lxfind lxfind changed the title Add trasfer_to_object API in Transfer.move [Object Ownership #2] Add trasfer_to_object API in Transfer.move Jan 28, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to make this a friend function if we're only planning to expose it in certain collection published in genesis. But let's see how it shakes out.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a caution--if you try to test this, I think it will crash due to #309.

@gdanezis gdanezis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am far from expert when it comes to framework, but looks good. A couple of tests on transfer and freeze to addresses and objects would make me sleep better.

@lxfind
lxfind force-pushed the add-authenticator branch from 7f779f7 to b8f6ea7 Compare January 31, 2022 18:13
Base automatically changed from add-authenticator to main January 31, 2022 18:31
@lxfind
lxfind force-pushed the allow-transfer-to-object branch from d44066e to 9501a69 Compare January 31, 2022 18:56
@lxfind
lxfind force-pushed the allow-transfer-to-object branch from 9501a69 to 35fa4d3 Compare January 31, 2022 18:59
@lxfind
lxfind merged commit fa042de into main Jan 31, 2022
@lxfind
lxfind deleted the allow-transfer-to-object branch January 31, 2022 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants