Hello guys, here are the slides from the workshop on Blockchain Tests that I gave earlier this week, as well as some responses to the issues that were addressed during the session. I can say as my first presential workshop after pandemic, it was a great experience with a full room 😃
Unfortunately, there is no recording of it, but you may clone the repo and follow the coding instructions to build the test class and methods, then compare to version 2 of the project, which has the most recent version.
What is the Required() function in Solidity?
The require Solidity function guarantees validity of conditions that cannot be detected before execution. It checks inputs, contract state variables and return values from calls to external contracts.
Where the Address type comes from ?
The address type comes in two flavours, which are largely identical:
address: Holds a 20 byte value (size of an Ethereum address).
address payable: Same as
address, but with the additional members
The idea behind this distinction is that
address payable is an address you can send Ether to, while a plain
address cannot be sent Ether.
Implicit conversions from
address payable to
address are allowed, whereas conversions from
address payable must be explicit via
Explicit conversions to and from
address are allowed for
uint160, integer literals,
bytes20 and contract types.
Other tools that you can use to test Blockchain applications
- Ethereum Tester,
- Hyperledger Composer
- Exonum test kit