forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fastx adapter] change entrypoint type signature rules to accept `&mu…
…t TxContext` Previously, the adapter expected the last argument of an entrypoint to be an owned `TxContext`. When playing with some example Move code, I realized that this makes entrypoint composition inconvenient. For example, say you have the following entrypoints: ``` public fun main1(ctx: TxContext) { ... } public fun main2(ctx: TxContext) { ... } ``` If you want to create a third entrypoint that composes `main1` and `main2` like so ``` public fun main_compose(ctx: TxContext) { main1(ctx); main2(ctx) // error: ctx moved on previously line } ``` , this will not work. Switching the entrypoint signature to use `&mut TxContext` instead solves this problem without otherwise changing the programming experience.
- Loading branch information
1 parent
1af0d37
commit 1f37fc1
Showing
4 changed files
with
31 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters