Skip to content

Commit

Permalink
Merge pull request #55 from georgescharlesbrain/patch-19
Browse files Browse the repository at this point in the history
Update 5_deployment_and_testing.md
  • Loading branch information
uvd authored Oct 26, 2023
2 parents 8f9de3c + 4443838 commit 2ed6263
Showing 1 changed file with 3 additions and 5 deletions.
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.

0 comments on commit 2ed6263

Please sign in to comment.