-
Notifications
You must be signed in to change notification settings - Fork 73
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 test contract code for existing abi/wasm and clean up libraries/testing & unittests dependencies #612
Conversation
…ld it from source
…BOL_NAME" This reverts commit bb470fa.
…ed for libraries/testing
…ove dependency of libraries/testing on unittests.
…unitests/contracts
…unitests/contracts
…its protocol feature has not been activated.
…ate contract code for eosio.bios and eosio.token to match as close as possible what matches the existing abi/wasm.
…ea6d926c3d2e9fa37dd513b8a946d8283b1aa233
hm, fixes eosnetworkfoundation/mandel#681 I think |
The libtester created here seems to have a problem building contract unit tests |
This is probably because of these changes: |
I haven't really looked very closely, but is it possible the new static library leap/CMakeModules/EosioTester.cmake.in Lines 55 to 59 in b7e1884
Also that means |
I was assuming it was something like that. I really think the best approach is to go back to |
…ove back into ./unittests/contracts and ./libraries/testing/CMakeLists.txt can go back to eosio_testing_contracts being INTERFACE only.
… the bios contract used in eos-system-contracts avoiding a duplicate trx error on set_code of its bios contract.
Fixed with the latest: https://github.com/eosnetworkfoundation/eos-system-contracts/actions/runs/3913111725 |
I had a hard time finding where this contract source originated from. Especially unittests/contracts/eosio.system doesn't seem to match anything I can find in reference-contracts. How sensitive are the tests to using the latest reference contracts? Is it possible (or silly) to use the reference contracts as a submodule? |
I had a hard time finding the source for these contracts. I dug around in github history, but for some of them the contract code corresponding to the time of the wasm change does not match the wasm. Some of it was trial and error to get to something that works. I think ideally we would not use any reference-contracts in our tests. Something like them are needed to test protocol features and other host functions. We want the contracts to remain static for our tests. This is likely why we didn't before bother including the source code for them in leap. However, I do believe we should be able to recreate the wasms from source if desired, hence this PR. |
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 had a follow up question on whether it made sense (not now in this PR, but in the future) to have a CI job ensure the contracts are still compiling 1:1 with checked in binaries. I feel like you may be indirectly answered that already though..
Ideally it would be nice to have a job that makes sure the contracts still compile with the latest CDT and all tests pass with the latest CDT compiled contracts. |
Updated
unittests/contracts/eosio.msig, unittests/contracts/eosio.system, unittests/contracts/eosio.token, unittests/contracts/eosio.wrap
andlibraries/testing/contracts/eosio.bios
with contract code as close as possible to existing abi/wasm files. Before only the abi/wasm existed in the leap repo.Rebuilt all contracts mentioned above with the latest CDT (3.2.0-dev ea6d926c3d2e9fa37dd513b8a946d8283b1aa233) and replaced the abi/wasm with the newly generated abi/wasm. Now all these contracts can be built using
-DEOSIO_COMPILE_TEST_CONTRACTS=true
.libraries/testing
no longer depends onunittests
.Moved
snapshot_suites.hpp
out oflibraries/testing
and back intounittests
where it belongs.Resolves #54