Skip to content
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

Update build-test.md #7235

Merged
merged 1 commit into from
Jan 10, 2023
Merged

Conversation

georgescharlesbrain
Copy link
Contributor

@georgescharlesbrain georgescharlesbrain commented Jan 8, 2023

correct test with filter
no change is required to the imports

bug running code --> simplify code

sword_create(&mut forge, 42, 7, initial_owner, test_scenario::ctx(scenario));
    │             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    │             │           │
    │             │           Found 5 argument(s) here
    │             Invalid call of '(my_first_package=0x0)::my_module::sword_create'. The call expected 4 argument(s) but got 5

Why is the forge object required? This can't be passed to sword_create...
Already got my answer by continuing with the tutorial.
Code simplification is desired here though. So the code actually runs at this stage in the tutorial.

correct test with filter
no change is required to the imports

bug running code --> simplify code
sword_create(&mut forge, 42, 7, initial_owner, test_scenario::ctx(scenario));
    │             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    │             │           │
    │             │           Found 5 argument(s) here
    │             Invalid call of '(my_first_package=0x0)::my_module::sword_create'. The call expected 4 argument(s) but got 5
@vercel
Copy link

vercel bot commented Jan 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated
explorer-storybook ⬜️ Ignored (Inspect) Jan 8, 2023 at 8:46PM (UTC)
wallet-adapter ⬜️ Ignored (Inspect) Jan 8, 2023 at 8:46PM (UTC)

@github-actions github-actions bot added the Type: Documentation Improvements or additions to documentation label Jan 8, 2023
@randall-Mysten randall-Mysten requested a review from amnn January 9, 2023 17:28
@randall-Mysten
Copy link
Contributor

thanks @georgescharlesbrain Adding another reviewer

Copy link
Contributor

@amnn amnn left a comment

Choose a reason for hiding this comment

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

A small comment/question about a section that was removed, but otherwise, LGTM. Thanks for contributing @georgescharlesbrain !

@@ -247,19 +250,9 @@ The code of the new functions is self-explanatory and uses struct
creation and Sui-internal modules (`TxContext` and `Transfer`) in a
way similar to what we have seen in the previous sections. The
important part is for the entry functions to have correct signatures
as described [earlier](index.md#entry-functions). In order for this code to
Copy link
Contributor

Choose a reason for hiding this comment

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

I couldn't figure out why this exposition wasn't necessary anymore -- the entry functions do introduce a reference to TxContext. Having said that, one clean-up you can now make is to remove the unreferenced _ctx: &mut TxContext parameter from sword_transfer as entry functions are now allowed to omit that parameter if it goes unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I was not required to do this part.
Earlier in the tutorial at defining the package I had already imported TxContext. Mentioning that you first need to import a struct before using it was already clear at this stage in the tutorials.
I'll leave the _ctx: &mut TxContext parameter in for now.

@georgescharlesbrain georgescharlesbrain requested review from amnn and removed request for randall-Mysten and ronny-mysten January 10, 2023 11:45
Copy link
Contributor

@amnn amnn left a comment

Choose a reason for hiding this comment

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

Thanks for answering my query @georgescharlesbrain. We still need @randall-Mysten or @ronny-mysten to review the copy, so adding them back -- the PR is all good from my side.

Copy link
Contributor

@randall-Mysten randall-Mysten left a comment

Choose a reason for hiding this comment

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

Thanks for confirming Ashok!

@randall-Mysten randall-Mysten merged commit 52d2454 into MystenLabs:main Jan 10, 2023
@georgescharlesbrain georgescharlesbrain deleted the patch-6 branch January 11, 2023 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants