mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-13 05:01:00 +00:00
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"Baseline": 3944,
|
||||
"Computation": 7444,
|
||||
"DivisionArithmetics": 42784,
|
||||
"ERC20": 56199,
|
||||
"Events": 4784,
|
||||
"FibonacciIterative": 6019,
|
||||
"Flipper": 4392,
|
||||
"SHA1": 36107
|
||||
"Baseline": 2824,
|
||||
"Computation": 6253,
|
||||
"DivisionArithmetics": 41341,
|
||||
"ERC20": 54329,
|
||||
"Events": 3642,
|
||||
"FibonacciIterative": 4866,
|
||||
"Flipper": 3270,
|
||||
"SHA1": 34605
|
||||
}
|
||||
@@ -619,7 +619,7 @@ pub fn recompile_code(code: &[u8], engine: &Engine) -> Module {
|
||||
let mut module_config = ModuleConfig::new();
|
||||
module_config.set_gas_metering(Some(GasMeteringKind::Sync));
|
||||
|
||||
Module::new(engine, &module_config, code).unwrap()
|
||||
Module::new(engine, &module_config, code.into()).unwrap()
|
||||
}
|
||||
|
||||
pub fn instantiate_module(
|
||||
@@ -634,14 +634,14 @@ pub fn instantiate_module(
|
||||
}
|
||||
|
||||
pub fn prepare(code: &[u8], config: Option<Config>) -> (Instance<Transaction>, ExportIndex) {
|
||||
let blob = ProgramBlob::parse(code).unwrap();
|
||||
let blob = ProgramBlob::parse(code.into()).unwrap();
|
||||
|
||||
let engine = Engine::new(&config.unwrap_or_default()).unwrap();
|
||||
|
||||
let mut module_config = ModuleConfig::new();
|
||||
module_config.set_gas_metering(Some(GasMeteringKind::Sync));
|
||||
|
||||
let module = Module::from_blob(&engine, &module_config, &blob).unwrap();
|
||||
let module = Module::from_blob(&engine, &module_config, blob).unwrap();
|
||||
let export = module.lookup_export(runtime_api::CALL).unwrap();
|
||||
let func = link_host_functions(&engine)
|
||||
.instantiate_pre(&module)
|
||||
|
||||
@@ -24,7 +24,6 @@ fn polkavm_linker<T: AsRef<[u8]>>(code: T) -> anyhow::Result<Vec<u8>> {
|
||||
config.set_strip(true);
|
||||
|
||||
polkavm_linker::program_from_elf(config, code.as_ref())
|
||||
.map(|blob| blob.as_bytes().to_vec())
|
||||
.map_err(|reason| anyhow::anyhow!("polkavm linker failed: {}", reason))
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ pub fn build_assembly_text(
|
||||
metadata_hash: Option<[u8; revive_common::BYTE_LENGTH_WORD]>,
|
||||
debug_config: Option<&DebugConfig>,
|
||||
) -> anyhow::Result<Build> {
|
||||
let program_blob = ProgramBlob::parse(bytecode)
|
||||
let program_blob = ProgramBlob::parse(bytecode.into())
|
||||
.map_err(anyhow::Error::msg)
|
||||
.with_context(|| format!("Failed to parse program blob for contract: {contract_path}"))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user