mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 09:21:05 +00:00
Fix runtime error.
This commit is contained in:
@@ -8,8 +8,6 @@ build = "build.rs"
|
||||
rustc_version = "0.2"
|
||||
|
||||
[dependencies]
|
||||
pwasm-alloc = { path = "../pwasm-alloc" }
|
||||
pwasm-libc = { path = "../pwasm-libc" }
|
||||
substrate-runtime-std = { path = "../runtime-std", default_features = false }
|
||||
environmental = { path = "../environmental", optional = true }
|
||||
substrate-state-machine = { path = "../state-machine", optional = true }
|
||||
|
||||
@@ -22,13 +22,6 @@ extern crate substrate_primitives as primitives;
|
||||
extern crate triehash;
|
||||
extern crate ed25519;
|
||||
|
||||
pub use std::vec;
|
||||
pub use std::rc;
|
||||
pub use std::cell;
|
||||
pub use std::boxed;
|
||||
pub use std::slice;
|
||||
pub use std::mem;
|
||||
|
||||
// re-export hashing functions.
|
||||
pub use primitives::{blake2_256, twox_128, twox_256};
|
||||
|
||||
|
||||
@@ -14,24 +14,12 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#[cfg(feature = "nightly")]
|
||||
extern crate alloc;
|
||||
|
||||
#[cfg(feature = "nightly")]
|
||||
extern crate pwasm_libc;
|
||||
#[cfg(feature = "nightly")]
|
||||
extern crate pwasm_alloc;
|
||||
|
||||
extern crate substrate_runtime_std as rstd;
|
||||
extern crate substrate_primitives as primitives;
|
||||
|
||||
pub use alloc::vec;
|
||||
pub use alloc::boxed;
|
||||
pub use alloc::rc;
|
||||
pub use core::mem;
|
||||
pub use core::slice;
|
||||
pub use core::cell;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use rstd::intrinsics;
|
||||
use rstd::vec::Vec;
|
||||
pub use rstd::{mem, slice};
|
||||
|
||||
#[lang = "panic_fmt"]
|
||||
#[no_mangle]
|
||||
@@ -40,7 +28,7 @@ pub extern fn panic_fmt(_fmt: ::core::fmt::Arguments, _file: &'static str, _line
|
||||
ext_print_utf8(_file.as_ptr() as *const u8, _file.len() as u32);
|
||||
ext_print_num(_line as u64);
|
||||
ext_print_num(_col as u64);
|
||||
::core::intrinsics::abort()
|
||||
intrinsics::abort()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +71,11 @@ pub fn set_storage(key: &[u8], value: &[u8]) {
|
||||
/// the number of bytes that the key in storage was.
|
||||
pub fn read_storage(key: &[u8], value_out: &mut [u8], value_offset: usize) -> usize {
|
||||
unsafe {
|
||||
ext_get_storage_into(key.as_ptr(), key.len() as u32, value_out.as_mut_ptr(), value_out.len() as u32, value_offset as u32) as usize
|
||||
ext_get_storage_into(
|
||||
key.as_ptr(), key.len() as u32,
|
||||
value_out.as_mut_ptr(), value_out.len() as u32,
|
||||
value_offset as u32
|
||||
) as usize
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +192,9 @@ macro_rules! impl_stubs {
|
||||
};
|
||||
|
||||
let output = super::$name(input);
|
||||
output.as_ptr() as u64 + ((output.len() as u64) << 32)
|
||||
let r = output.as_ptr() as u64 + ((output.len() as u64) << 32);
|
||||
$crate::mem::forget(output);
|
||||
r
|
||||
}
|
||||
)*
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user