mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-23 09:41:07 +00:00
Use wasm-builder from git (#3354)
* Use wasm-builder from git This brings new features like compressed runtimes out of the box. * chore: update wasm builder dep. from 3.0.0 to master * Fix tests * Update node/core/pvf/tests/it/main.rs Co-authored-by: Sergei Shulepov <sergei@parity.io> Co-authored-by: chevdor <chevdor@gmail.com> Co-authored-by: Sergei Shulepov <sergei@parity.io>
This commit is contained in:
@@ -30,6 +30,7 @@ sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "
|
||||
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-wasm-interface = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-maybe-compressed-blob = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
[dev-dependencies]
|
||||
adder = { package = "test-parachain-adder", path = "../../../parachain/test-parachains/adder" }
|
||||
|
||||
@@ -31,7 +31,9 @@ pub fn validate_candidate(
|
||||
) -> Result<Vec<u8>, Box<dyn std::error::Error>> {
|
||||
use crate::executor_intf::{prevalidate, prepare, execute, TaskExecutor};
|
||||
|
||||
let blob = prevalidate(code)?;
|
||||
let code = sp_maybe_compressed_blob::decompress(code, 10 * 1024 * 1024).expect("Decompressing code failed");
|
||||
|
||||
let blob = prevalidate(&*code)?;
|
||||
let artifact = prepare(blob)?;
|
||||
let executor = TaskExecutor::new()?;
|
||||
let result = unsafe {
|
||||
|
||||
@@ -15,9 +15,7 @@
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use polkadot_node_core_pvf::{Pvf, ValidationHost, start, Config, InvalidCandidate, ValidationError};
|
||||
use polkadot_parachain::{
|
||||
primitives::{BlockData, ValidationParams, ValidationResult},
|
||||
};
|
||||
use polkadot_parachain::primitives::{BlockData, ValidationParams, ValidationResult};
|
||||
use parity_scale_codec::Encode as _;
|
||||
use async_std::sync::Mutex;
|
||||
|
||||
@@ -58,11 +56,14 @@ impl TestHost {
|
||||
params: ValidationParams,
|
||||
) -> Result<ValidationResult, ValidationError> {
|
||||
let (result_tx, result_rx) = futures::channel::oneshot::channel();
|
||||
|
||||
let code = sp_maybe_compressed_blob::decompress(code, 16 * 1024 * 1024).expect("Compression works");
|
||||
|
||||
self.host
|
||||
.lock()
|
||||
.await
|
||||
.execute_pvf(
|
||||
Pvf::from_code(code.to_vec()),
|
||||
Pvf::from_code(code.into()),
|
||||
params.encode(),
|
||||
polkadot_node_core_pvf::Priority::Normal,
|
||||
result_tx,
|
||||
|
||||
Reference in New Issue
Block a user