Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Initial implementation of wasmbinary to wat #207

Open
wants to merge 10 commits into
base: stylus
Choose a base branch
from
Open
7 changes: 7 additions & 0 deletions arbitrator/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions arbitrator/jit/src/arbcompress.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2022-2024, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE

#![allow(clippy::too_many_arguments)]

use crate::caller_env::{JitEnv, JitExecEnv};
use crate::machine::Escape;
use crate::machine::WasmEnvMut;
Expand Down
3 changes: 3 additions & 0 deletions arbitrator/prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ wasmparser.workspace = true
num-derive = "0.4.1"
num-traits = "0.2.17"

[dev-dependencies]
glob = "0.3.1"

[lib]
name = "prover"
crate-type = ["staticlib", "lib"]
Expand Down
5 changes: 5 additions & 0 deletions arbitrator/prover/src/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,4 +673,9 @@ impl<'a> WasmBinary<'a> {
}
Ok(func)
}

/// The name of the module.
pub fn name(&self) -> &str {
&self.names.module
}
}
2 changes: 1 addition & 1 deletion arbitrator/prover/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ lazy_static! {
&[ty.clone()], // only type needed is the func itself
0, // -----------------------------------
0, // impls don't use other internals
&bin.names.module,
bin.name(),
),
ty.clone(),
&[] // impls don't make calls
Expand Down
2 changes: 1 addition & 1 deletion arbitrator/prover/src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ impl Module {
let mut memory = Memory::default();
let mut tables = Vec::new();
let mut host_call_hooks = Vec::new();
let bin_name = &bin.names.module;
let bin_name = bin.name();
for import in &bin.imports {
let module = import.module;
let have_ty = &bin.types[import.offset as usize];
Expand Down
Loading
Loading