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

fixed some typos #355

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions lessons/inter-contract-calling/05/05.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ editor:


@sp.entry_point
def recieve_powerup(self, params):
def receive_powerup(self, params):
# will implement this in the next chapter
pass

Expand Down Expand Up @@ -146,7 +146,7 @@ editor:


@sp.entry_point
def recieve_powerup(self, params):
def receive_powerup(self, params):
# will implement this in the next chapter
pass

Expand Down Expand Up @@ -216,7 +216,7 @@ Don't worry if it looks overwhelming at first glance, we're going to break it do
`sp.contract` takes three arguments -

1. `t` - it's the **type** of data that the contract is accepting. `t` has to match the type of `data_to_be_sent` in the `sp.transfer`.
2. `address` - this specifies the adress of the contract inside which you'll be calling an entry point. Needs to be of the type `sp.TAdress`.
2. `address` - this specifies the adress of the contract inside which you'll be calling an entry point. Needs to be of the type `sp.TAddress`.
3. `entry_point` - this is an optional parameter which specifies which entry point do you want to call. The catch is, you don't need to specify the entry point if the contract only has 1 entry point (like our `Market` contract).

The result of `sp.contract` is passed to `destination_contract` in `sp.transfer`.
Expand All @@ -234,7 +234,7 @@ def send(self):
target_contract)
```

- This entry point calls the `recieve` entry point in the `target` contract with the data `"This message should be sent!"` as the parameter to `recieve`.
- This entry point calls the `receive` entry point in the `target` contract with the data `"This message should be sent!"` as the parameter to `receive`.
- `.open_some` chained to `sp.contract` simply checks if the specified entry point in the `target` contract is accepting a string(the specified data type which is the first argument to `sp.contract`) or not.
- Look how the type of `data_to_be_sent` matches the type specified in `sp.contract`, this is mandatory.

Expand All @@ -260,7 +260,7 @@ class Target(sp.Contract):
self.init(msg = "")

@sp.entry_point
def recieve(self, params):
def receive(self, params):
self.data.msg = params.payload

@sp.add_test(name = "Test")
Expand All @@ -279,7 +279,7 @@ This is a bare-bones example, we covered the `send` function in the section abov

1. In the `test` we pass in the address of the target to the `Sender`.
2. Inside the `Sender` contract, we're calling the `receive` entry point present inside the `Target` contract.
3. `recieve` entry point simply assigns `msg` the value it's being sent as the `payload`.
3. `receive` entry point simply assigns `msg` the value it's being sent as the `payload`.

> Note: If the `Target` contract had more than one entry point. We would also need to specify the entry point in `sp.contract`

Expand All @@ -305,7 +305,7 @@ Let's give our `Cryptobot` the ability to buy a `powerup`.

<br />

> In the coming chapters we'll implement `send_powerup` in `Market` and `recieve_powerup` in `Cryptobot`.
> In the coming chapters we'll implement `send_powerup` in `Market` and `receive_powerup` in `Cryptobot`.

### Testing our code

Expand Down