mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Many renames.
- Everything polkadot becomes polkadot-. - Wasm (substrate) executor tests split from Wasm (Polkadot) runtime and built independently.
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
extern crate native_runtime;
|
||||
extern crate polkadot_runtime;
|
||||
extern crate substrate_executor;
|
||||
extern crate substrate_codec as codec;
|
||||
extern crate substrate_state_machine as state_machine;
|
||||
@@ -26,7 +26,7 @@ extern crate triehash;
|
||||
#[macro_use]
|
||||
extern crate hex_literal;
|
||||
|
||||
use native_runtime as runtime;
|
||||
use polkadot_runtime as runtime;
|
||||
use substrate_executor::{NativeExecutionDispatch, NativeExecutor};
|
||||
|
||||
pub struct LocalNativeExecutionDispatch;
|
||||
@@ -35,7 +35,7 @@ impl NativeExecutionDispatch for LocalNativeExecutionDispatch {
|
||||
fn native_equivalent() -> &'static [u8] {
|
||||
// WARNING!!! This assumes that the runtime was built *before* the main project. Until we
|
||||
// get a proper build script, this must be strictly adhered to or things will go wrong.
|
||||
include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm")
|
||||
include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm")
|
||||
}
|
||||
|
||||
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
|
||||
@@ -54,16 +54,16 @@ mod tests {
|
||||
use super::*;
|
||||
use substrate_executor::WasmExecutor;
|
||||
use codec::{KeyedVec, Slicable, Joiner};
|
||||
use native_runtime::support::{one, two, Hashable};
|
||||
use native_runtime::runtime::staking::balance;
|
||||
use polkadot_runtime::support::{one, two, Hashable};
|
||||
use polkadot_runtime::runtime::staking::balance;
|
||||
use state_machine::{CodeExecutor, TestExternalities};
|
||||
use primitives::twox_128;
|
||||
use polkadot_primitives::{Hash, Header, BlockNumber, Block, Digest, Transaction,
|
||||
UncheckedTransaction, Function, AccountId};
|
||||
use ed25519::Pair;
|
||||
|
||||
const BLOATY_CODE: &[u8] = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm");
|
||||
const COMPACT_CODE: &[u8] = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm");
|
||||
const BLOATY_CODE: &[u8] = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm");
|
||||
const COMPACT_CODE: &[u8] = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm");
|
||||
|
||||
// TODO: move into own crate.
|
||||
macro_rules! map {
|
||||
@@ -284,7 +284,7 @@ mod tests {
|
||||
twox_128(&one.to_keyed_vec(b"sta:bal:")).to_vec() => vec![68u8, 0, 0, 0, 0, 0, 0, 0]
|
||||
], };
|
||||
|
||||
let foreign_code = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm");
|
||||
let foreign_code = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm");
|
||||
let r = WasmExecutor.call(&mut t, &foreign_code[..], "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx()));
|
||||
assert!(r.is_err());
|
||||
}
|
||||
@@ -298,7 +298,7 @@ mod tests {
|
||||
twox_128(&one.to_keyed_vec(b"sta:bal:")).to_vec() => vec![111u8, 0, 0, 0, 0, 0, 0, 0]
|
||||
], };
|
||||
|
||||
let foreign_code = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm");
|
||||
let foreign_code = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm");
|
||||
let r = WasmExecutor.call(&mut t, &foreign_code[..], "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx()));
|
||||
assert!(r.is_ok());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user