Commit Graph

6 Commits

Author SHA1 Message Date
Alexander Theißen 4ae7398818 contracts: Remove wat support from test fixtures (#3588)
In order to prepare for PolkaVM support I removed the wat support from
our test fixture crate.

- Removed redundant tests (invalid module checks are already inside the
prepare module where they belong
- Converted the gas_sync tests to Rust
- Moved the start function test to the `wasm` module
2024-03-07 01:05:04 +00:00
Bastian Köcher 1c2db1747e Some random fixes (#2936)
- Do not disable `std` feature in the integration tests
- `contracts-fixtures` test should only check for `riscv` build when the
feature is enabled
2024-01-16 00:19:17 +00:00
PG Herveou bd80dcf685 Contracts: Translate .wat fixtures to rust (#2654)
- Translate all pallet-contracts fixtures from `wat` to Rust files.
- Fix read_sandbox_memory_as to not use MaxEncodedLen as this could
break if used with types with a non-fixed encoded len.

---------

Co-authored-by: alvicsam <alvicsam@gmail.com>
Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: command-bot <>
2024-01-12 20:10:54 +00:00
PG Herveou 2135fa872b Contracts: use compiled rust tests (#2347)
see #2189

This PR does the following:
- Bring the user api functions into a new pallet-contracts-uapi (They
are currently defined in ink!
[here])(https://github.com/paritytech/ink/blob/master/crates/env/src/engine/on_chain/ext.rs)
- Add older api versions and unstable to the user api trait.
- Remove pallet-contracts-primitives and bring the types it defined in
uapi / pallet-contracts
- Add the infrastructure to build fixtures from Rust files and test it
works by replacing `dummy.wat` and `call.wat`
- Move all the doc from wasm/runtime.rs to pallet-contracts-uapi.

This will be done in a follow up:
- convert the rest of the test from .wat to rust
- bring risc-v uapi up to date with wasm
- finalize the uapi host fns, making sure everything is codegen from the
source host fns in pallet-contracts

---------

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
2023-11-29 22:12:19 +01:00
PG Herveou f517900a48 Contracts expose pallet-xcm (#1248)
This PR introduces:
- XCM  host functions `xcm_send`, `xcm_execute`
- An Xcm trait into the config. that proxy these functions to to
`pallet_xcm`, or disable their usage by using `()`.
- A mock_network and xcm_test files to test the newly added xcm-related
functions.

---------

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>
Co-authored-by: command-bot <>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
2023-11-14 22:32:14 +02:00
PG Herveou 64effd0e6f Contracts move fixtures to new crate (#2246)
Small PR that introduce a new crate that will host RISC-V & wasm
fixtures for testing pallet-contracts
2023-11-10 13:22:47 +02:00