-
Notifications
You must be signed in to change notification settings - Fork 432
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
Implement MVP for new off-chain testing engine #712
Conversation
df8e55c
to
def45c2
Compare
eeb68c3
to
bc131ca
Compare
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.
All in all looks good but there is a fundamental problem with ink_engine
trying to expose its API as a singleton through free standing methods that require their engine but instead if should expose its API as a single type (the engine) with methods on the engine so that the ink_env
can do what it always did and properly turn it into a thread_local
and dispatch between engines.
fn hash(input: &[u8], output: &mut <Self as HashOutput>::Type) { | ||
type OutputType = [u8; 16]; | ||
static_assertions::assert_type_eq_all!( | ||
<Blake2x128 as HashOutput>::Type, |
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.
<Blake2x128 as HashOutput>::Type, | |
<Self as HashOutput>::Type, |
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.
Unfortunately results in this error:
error[E0401]: can't use generic parameters from outer function
--> crates/env/src/engine/experimental_off_chain/impls.rs:56:14
|
52 | impl CryptoHash for Blake2x128 {
| ---- `Self` type implicitly declared here, by this `impl`
...
56 | <Self as HashOutput>::Type,
| ^^^^
| |
| use of generic parameter from outer function
| use a type here instead
Codecov Report
@@ Coverage Diff @@
## master #712 +/- ##
===========================================
- Coverage 83.33% 68.36% -14.97%
===========================================
Files 163 174 +11
Lines 7502 7888 +386
===========================================
- Hits 6252 5393 -859
- Misses 1250 2495 +1245
Continue to review full report at Codecov.
|
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.
Let's ship it!
MVP for #565.
ToDo
seal_deposit_event
seal_set_storage
seal_get_storage
seal_clear_storage
seal_caller
seal_address
seal_balance
seal_value_transferred
seal_println
seal_terminate
seal_transfer