-
Notifications
You must be signed in to change notification settings - Fork 249
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
base: master
Are you sure you want to change the base?
Added the README's for cross-contract-calls & factory-contract. #1232
Conversation
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.
There was a problem hiding this 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)
…oss-contract-examples
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
examples/factory-contract/README.md
Outdated
3. Deploy the factory contract: | ||
|
||
```bash | ||
cargo near deploy --wasmFile path/to/factory-contract.wasm --accountId your-account.testnet |
There was a problem hiding this comment.
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
cargo near deploy --wasmFile path/to/factory-contract.wasm --accountId your-account.testnet | |
cargo near deploy |
examples/factory-contract/README.md
Outdated
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 |
There was a problem hiding this comment.
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):
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. | ||
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
…oss-contract-examples
…with the changes requested.
I just updated the README's @frol, please review them, thanks |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
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.