-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add tests for malformed init code #92
Conversation
ed10c23
to
142fe9d
Compare
src/GeneralStateTestsFiller/stEWASMTests/initMalformedBytecodeHasStartFromTxFiller.yml
Outdated
Show resolved
Hide resolved
balance: '99916113919' | ||
# newly-created contract | ||
# expect code to be empty since create should fail | ||
# 6295ee1b4f6dd65047762f924ecd367c17eabf8f: |
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.
you could uncomment this and add "shouldnotexist": "1"
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. Do you know if there's a way to make sure that no new contracts get created?
@axic take a look at tests/src/GeneralStateTestsFiller/stEWASMTests/initMalformedBytecodeInvalidMainFiller.yml Line 27 in c01e1bb
Error in parsing WASM binary: 'Section extends beyond end of input'
|
This is done, it contains all of the missing tests that @axic marked "testnet critical" here. Note that a couple of these tests don't pass against the hera branch I've been using for testing (https://github.com/ewasm/hera/tree/verifycontract):
These tests are failing (with binaryen) due to ewasm/hera#442 (and with wabt due to ewasm/hera#441). |
src/GeneralStateTestsFiller/stEWASMTests/storedMalformedBytecodeHasStartFromTxFiller.yml
Show resolved
Hide resolved
src/GeneralStateTestsFiller/stEWASMTests/initMalformedBytecodeInvalidMainFiller.yml
Outdated
Show resolved
Hide resolved
src/GeneralStateTestsFiller/stEWASMTests/initMalformedBytecodeInvalidMainFromTxFiller.yml
Outdated
Show resolved
Hide resolved
src/GeneralStateTestsFiller/stEWASMTests/storedMalformedBytecodeHasStartFiller.yml
Show resolved
Hide resolved
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.
It looks good to me, still pending to take a decision about the current tests which are failing due to pending issues in binaryen/wabt
Thanks @hugo-dc!. Agree, @axic any thoughts? This is waiting on ewasm/hera#441 and ewasm/hera#442. |
fb15649
to
c5cc4a1
Compare
CREATE should fail if the init code contains a 'start' section. Checks 1. that CREATE returns 1 (failure), 2. that result (created contract address) is empty
Tests that a contract is not created from a tx when the bytecode contains a (start) section.
Try to create a contract from a transaction where the init code is missing a main section
CREATE with init code that contains no main
Tests init code with missing memory export on create
Same as last test, but from tx rather than from create
Test for malformed bytecode (has start section) in code returned from init code, rather than in init code itself
Same as previous test, but tests bytecode returned from tx
c5cc4a1
to
b96ed5a
Compare
Rebased onto Hugo's latest changes. It looks like Hugo renamed a test to @hugo-dc @axic this is ready for one final review and then merging. |
Checks 1. that CREATE returns 1 (failure), 2. that result (created
contract address) is empty
Test for ewasm/hera#436