-
Notifications
You must be signed in to change notification settings - Fork 418
Update "Debugging a smart contract" guide #1112
Conversation
This is branched off of #1106 so until that is merged, this branch will include those changes as well. Set it to blocked for now. |
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.
Had a couple of minor suggestions, and I also noticed some remnants from a merge conflict that I noted. Looks good otherwise, just request my re-review when changes are addressed. Thanks! 🎉
}) | ||
.then(function (value) { | ||
return value.toNumber(); | ||
}); | ||
``` | ||
|
||
This command looks at the SimpleStorage contract, and then calls the `get()` function as defined inside it. It then returns the output, which is usually rendered as a string, and converts it to a number: | ||
|
||
```javascript |
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.
```javascript |
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.
Did you mean to delete only the open tag here? I believe commiting this while leaving the closing ``` would turn the rest of the document into a code block.
}) | ||
.then(function (value) { | ||
return value.toNumber(); | ||
}); | ||
``` | ||
|
||
The output should look like this: | ||
|
||
```javascript |
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.
```javascript |
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.
Did you mean to delete only the open tag here? I believe commiting this while leaving the closing ``` would turn the rest of the document into a code block.
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.
Whoops! I meant to just delete the javascript tag. :)
``` | ||
|
||
**It is this last event that is triggering the error.** You can see that it is the `assert()` that is to blame. | ||
|
||
<<<<<<< HEAD:src/guides/debugging-an-example-smart-contract.md |
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.
I think this is leftover from a merge conflict. I may have missed other parts of this so its probably worth going over it again to see!
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.
Ohhh thank you!
|
||
### Issue #3: A function isn't operating as desired | ||
|
||
> > > > > > > origin/update-debugging-your-contracts:src/guides/debugging-an-example-smart-contract/index.md |
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 part too, I assume!
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.
oh wow, where did these merge conflicts come from? Was it from the transition from old to new website?
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.
Ah, perhaps. I'm wondering if I forgot to pull. When I started this, the guides were individual files with no sub-directories, ex: "src/guides/debugging-a-smart-contract.md"
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.
Hrm, would you mind doing a rebase instead? Would be happy to help out
``` | ||
|
||
**The problem is revealed.** The conditional is leading to the wrong event. | ||
|
||
|
||
## Conclusion | ||
|
||
With the ability to debug your contracts directly within Truffle, you have even more power at your hands to make your smart contracts rock-solid and ready to deploy. Make sure to read more about Truffle Develop console and the debugger in the docs. If you have any questions, please join our [community Gitter channel](https://gitter.im/ConsenSys/truffle) where hundreds of fellow Trufflers congregate to answer your questions! |
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.
I'm thinking we could remove the part about heading over to our Gitter and recommend people open an issue on Github if they have any questions. Thoughts?
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.
Yeah, I like this point, agreed!
@@ -144,13 +135,11 @@ If you want an interactive console but want to use an existing blockchain, use ` | |||
|
|||
See the [Using the console](/docs/getting_started/console) section for more details. |
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.
Not sure if this link works. May just be that I can't find it but when I try going to it I get a 404.
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.
Oh, good catch, I'm going to replace it with this one: https://trufflesuite.com/docs/truffle/getting-started/using-truffle-develop-and-the-console.html
Option: | ||
|
||
* `--log`: Start/Connect to a Truffle develop session and log all RPC activity. | ||
See the [Log RPC Activity](docs/getting_started/console#log-rpc-activity) |
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.
Same as above.
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.
going to replace it with this one: https://trufflesuite.com/docs/truffle/getting-started/using-truffle-develop-and-the-console.html#log-rpc-activity
* `<package_name>`: Name of the package as listed in the Ethereum Package Registry. (required) | ||
* `@<version>`: When specified, will install a specific version of the package, otherwise will install the latest version. | ||
- `<package_name>`: Name of the package as listed in the Ethereum Package Registry. (required) | ||
- `@<version>`: When specified, will install a specific version of the package, otherwise will install the latest version. | ||
|
||
See the [Package Management with EthPM](/docs/getting_started/packages-ethpm) section for more details. |
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.
Same as above.
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.
Thanks! Going to replace with: https://trufflesuite.com/docs/truffle/getting-started/package-management-via-ethpm.html
Co-authored-by: Faina Shalts <[email protected]> Update capitalization Co-authored-by: Faina Shalts <[email protected]> Update capitalization Co-authored-by: Faina Shalts <[email protected]> update broken links Remove space Pointed to github instead of gitter
956bc9b
to
ecec85c
Compare
Problem
The Debugging a smart contract guide is outdated: #1077
Solution