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 5_deployment_and_testing.md #55

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions unit-four/lessons/5_deployment_and_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Next we can deploy and test our marketplace contract through the SUI CLI.

We create a simple `marketplace::widget` module so we can mint some items for us to list to help with test.
We create a simple `marketplace::widget` module so we can mint some items for us to list to help with testing.

```rust
module marketplace::widget {
Expand All @@ -28,7 +28,7 @@ This is basically the Hello World project from Unit One, but made even simpler.

## Deployment

First we publish both the package with:
Publish the package using:

```bash
sui client publish --gas-budget 10000000
Expand Down Expand Up @@ -100,8 +100,6 @@ Export the object ID of the newly split `SUI` coin with balance `1`:
export PAYMENT_ID=<object ID of the split 1 balance SUI coin>
```

_Quiz: As an exercise, modify the marketplace contract to accept any payment that has enough balance to pay for the asking price, instead of requiring the exact amount._

Now, let's buy back the item that we just listed:

```bash
Expand All @@ -118,4 +116,4 @@ Finally, we can claim our earnings by calling the `take_profits_and_keep` method
sui client call --function take_profits_and_keep --module marketplace --package $PACKAGE_ID --args $MARKET_ID --type-args 0x2::sui::SUI --gas-budget 10000000
```

This will reap the balance from the `payments` `Table` object and return its size to `0`. Verify this on the explorer.
This will reap the balance from the `payments` `Table` object and return its size to `0`. Verify this on the explorer.
Loading