mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
refactor out validation hosts to pool struct (#972)
* refactor out validation hosts to pool struct * make web-wasm compatible * typo * remove now-unused static hosts
This commit is contained in:
committed by
GitHub
parent
a2a4f4c755
commit
15a83079ba
@@ -70,6 +70,8 @@ pub fn execute_good_on_parent() {
|
||||
add: 512,
|
||||
};
|
||||
|
||||
let pool = parachain::wasm_executor::ValidationPool::new();
|
||||
|
||||
let ret = parachain::wasm_executor::validate_candidate(
|
||||
TEST_CODE,
|
||||
ValidationParams {
|
||||
@@ -77,7 +79,7 @@ pub fn execute_good_on_parent() {
|
||||
block_data: block_data.encode(),
|
||||
},
|
||||
DummyExt,
|
||||
parachain::wasm_executor::ExecutionMode::RemoteTest,
|
||||
parachain::wasm_executor::ExecutionMode::RemoteTest(&pool),
|
||||
).unwrap();
|
||||
|
||||
let new_head = HeadData::decode(&mut &ret.head_data[..]).unwrap();
|
||||
@@ -92,6 +94,7 @@ fn execute_good_chain_on_parent() {
|
||||
let mut number = 0;
|
||||
let mut parent_hash = [0; 32];
|
||||
let mut last_state = 0;
|
||||
let pool = parachain::wasm_executor::ValidationPool::new();
|
||||
|
||||
for add in 0..10 {
|
||||
let parent_head = HeadData {
|
||||
@@ -112,7 +115,7 @@ fn execute_good_chain_on_parent() {
|
||||
block_data: block_data.encode(),
|
||||
},
|
||||
DummyExt,
|
||||
parachain::wasm_executor::ExecutionMode::RemoteTest,
|
||||
parachain::wasm_executor::ExecutionMode::RemoteTest(&pool),
|
||||
).unwrap();
|
||||
|
||||
let new_head = HeadData::decode(&mut &ret.head_data[..]).unwrap();
|
||||
@@ -129,6 +132,8 @@ fn execute_good_chain_on_parent() {
|
||||
|
||||
#[test]
|
||||
fn execute_bad_on_parent() {
|
||||
let pool = parachain::wasm_executor::ValidationPool::new();
|
||||
|
||||
let parent_head = HeadData {
|
||||
number: 0,
|
||||
parent_hash: [0; 32],
|
||||
@@ -147,6 +152,6 @@ fn execute_bad_on_parent() {
|
||||
block_data: block_data.encode(),
|
||||
},
|
||||
DummyExt,
|
||||
parachain::wasm_executor::ExecutionMode::RemoteTest,
|
||||
parachain::wasm_executor::ExecutionMode::RemoteTest(&pool),
|
||||
).unwrap_err();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user