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

Added the README's for cross-contract-calls & factory-contract. #1232

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MattCS2006
Copy link

This pull request is for the issue #152.

I made the README's for both folders, cross-contract-calls and factory-contract following the standard used on the other folders that had a README within the folder of examples.

I made the README's for both folders following the standard used on the other folders that had a README within the folder of examples.
Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

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

Please, address my review comments (and apply them to both READMEs)

examples/cross-contract-calls/README.md Outdated Show resolved Hide resolved
examples/cross-contract-calls/README.md Outdated Show resolved Hide resolved
Just made the changes for the usage part and gave it more details on how to do it, like an step-by-step, and also got rid of unnecessary markdown
@MattCS2006 MattCS2006 requested a review from frol August 12, 2024 14:52
3. Deploy the factory contract:

```bash
cargo near deploy --wasmFile path/to/factory-contract.wasm --accountId your-account.testnet
Copy link
Collaborator

Choose a reason for hiding this comment

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

This command is invalid. Please, test all the commands

Suggested change
cargo near deploy --wasmFile path/to/factory-contract.wasm --accountId your-account.testnet
cargo near deploy

4. Use the factory contract to create instances of the target contract:

```bash
near call your-factory-contract-account.testnet create_instance '{"args": "value"}' --accountId your-account.testnet
Copy link
Collaborator

Choose a reason for hiding this comment

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

This command is outdated, please, use the new syntax (it is suggested to you in the output):

Suggested change
near call your-factory-contract-account.testnet create_instance '{"args": "value"}' --accountId your-account.testnet
near contract call-function as-transaction your-factory-contract-account.testnet deploy_status_message json-args '{"account_id": "sub.your-factory-contract-account.testnet"}' prepaid-gas '100 Tgas' attached-deposit '0 NEAR'

```

NOTE: Replace `path/to/factory-contract.wasm` with the actual path to your compiled WebAssembly file, and `your-account.testnet` with your actual NEAR testnet account ID.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Demonstrate calls to simple_call and complex_call functions.

- Call the high-level contract to initiate a cross-contract call to the low-level contract:

```bash
near call your-high-level-contract-account.testnet call-function '{"args": "value"}' --accountId your-account.testnet
Copy link
Collaborator

Choose a reason for hiding this comment

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

This does not demonstrate the actual function defined in the contract (factorial). Please, write the example to the specific contract at hand, not just some placeholder

@MattCS2006
Copy link
Author

I just updated the README's @frol, please review them, thanks

Copy link

codecov bot commented Sep 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.02%. Comparing base (f179a28) to head (7f96c35).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1232      +/-   ##
==========================================
- Coverage   80.09%   80.02%   -0.08%     
==========================================
  Files         102      102              
  Lines       14597    14597              
==========================================
- Hits        11692    11681      -11     
- Misses       2905     2916      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: NEW❗
Development

Successfully merging this pull request may close these issues.

2 participants