Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Karim H. <98668332+khadni@users.noreply.github.com>
  • Loading branch information
aelmanaa and khadni authored Mar 25, 2024
1 parent 173542f commit 70c1a9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/content/ccip/tutorials/ccipreceive-gaslimit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ Now that you've locally estimated the gas usage of the `ccipReceive` function us

To estimate the gas usage of the `ccipReceive` function within your own Foundry project, follow these steps:

1. Create a testing file in the `test` directory of your project and import the `MockCCIPRouter` contract:
1. Create a testing file in the `test` directory of your project and import the [`MockCCIPRouter`](https://github.com/smartcontractkit/ccip/blob/ccip-develop/contracts/src/v0.8/ccip/test/mocks/MockRouter.sol) contract:

```solidity
import "@chainlink/contracts/src/v0.8/ccip/test/mocks/MockRouter.sol";
```

**_Note_:** The `MockCCIPRouter` receives the CCIP message from your CCIP Sender, calls the `ccipReceive` function on your CCIP Receiver, and emits the `MsgExecuted` event with the gas used.

1. Inside the `setUp` function, deploy the `MockCCIPRouter` contract, and use its address to deploy your CCIP Sender, and CCIP Receiver contracts. For more details, check this [example](https://github.com/smartcontractkit/smart-contract-examples/blob/main/ccip/estimate-gas/foundry/test/SendReceive.t.sol#L23).
1. Inside the `setUp` function, deploy the `MockCCIPRouter` contract, and use its address to deploy your CCIP Sender and CCIP Receiver contracts. For more details, check this [example](https://github.com/smartcontractkit/smart-contract-examples/blob/main/ccip/estimate-gas/foundry/test/SendReceive.t.sol#L23).

1. In your test cases:

Expand All @@ -289,7 +289,7 @@ To estimate the gas usage of the `ccipReceive` function within your own Hardhat
1. Create a Solidity file in the `contracts` directory of your project and import the [`MockCCIPRouter`](https://github.com/smartcontractkit/ccip/blob/ccip-develop/contracts/src/v0.8/ccip/test/mocks/MockRouter.sol) contract:

```solidity
import "@chainlink/contracts/src/v0.8/ccip/test/mocks/MockRouter.sol";
import {MockCCIPRouter} from "@chainlink/contracts-ccip/src/v0.8/ccip/test/mocks/MockRouter.sol";
```

**_Note_:** The `MockCCIPRouter` receives the CCIP message from your CCIP Sender, calls the `ccipReceive` function on your CCIP Receiver, and emits the `MsgExecuted` event with the gas used.
Expand Down

0 comments on commit 70c1a9f

Please sign in to comment.