Implement utility methods for experimental off-chain testing env#1143
Implement utility methods for experimental off-chain testing env#1143
Conversation
|
The waterfall CI failure is expected because of the bug in nightly Rust which causes |
🦑 📈 ink! Example Contracts ‒ Changes Report 📉 🦑
These are the results when building the
Link to the run | Last update: Wed Feb 23 06:44:09 CET 2022 |
Codecov Report
@@ Coverage Diff @@
## master #1143 +/- ##
===========================================
- Coverage 78.67% 63.04% -15.63%
===========================================
Files 252 252
Lines 9386 9411 +25
===========================================
- Hits 7384 5933 -1451
- Misses 2002 3478 +1476
Continue to review full report at Codecov.
|
HCastano
left a comment
There was a problem hiding this comment.
Small things to clean up
crates/engine/src/types.rs
Outdated
| //! In the long-term all types in this module should be `Vec<u8>`, as to not | ||
| //! be dependent on any specific off-chain environment type. Then the `engine` | ||
| //! crate could be used with an arbitrary `Environment` configuration. | ||
| //! | ||
| //! Right now the issue is that if e.g. some test calls an `engine` API function | ||
| //! to transfer some balance, then there has to be some `+` operation to the | ||
| //! existing balance. And we can't just add a `Vec<u8>` onto another one, we | ||
| //! need to know the type. |
There was a problem hiding this comment.
This seems like an internal comment (and something that should be part of the Github issue), not something that should be in the module level comments
There was a problem hiding this comment.
Removed the comment, will create a follow-up once merged.
Co-authored-by: Hernando Castano <[email protected]> Co-authored-by: Alexander Theißen <[email protected]>
Co-authored-by: Alexander Theißen <[email protected]>
Closes #787.
Well, except an implementation for
gas_left, because I'm uncertain what a sensible logic for that would be.Yes, the experimental off-chain env is currently limited in that it only supports
ink_env::DefaultEnvironment, but IMHO the situation of us currently having two off-chain testing engines in every examples is worse.So I would like to get the experimental engine into a stage where we can throw the old one out and just use this new one by default everywhere. From my pov this PR is the last prerequisite before we can do that.