@nomicfoundation/edr 0.6.4 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/trace.rs CHANGED
@@ -16,20 +16,13 @@ use napi_derive::napi;
16
16
 
17
17
  use crate::result::ExecutionResult;
18
18
 
19
- mod compiler;
20
19
  mod library_utils;
21
- mod model;
22
20
 
23
21
  mod debug;
24
- mod error_inferrer;
25
22
  mod exit;
26
- mod mapped_inlined_internal_functions_heuristics;
27
- mod message_trace;
23
+ mod model;
28
24
  mod return_data;
29
- mod solidity_stack_trace;
30
- mod solidity_tracer;
31
- mod vm_trace_decoder;
32
- mod vm_tracer;
25
+ pub mod solidity_stack_trace;
33
26
 
34
27
  #[napi(object)]
35
28
  pub struct TracingMessage {
@@ -149,7 +142,7 @@ impl TracingStep {
149
142
 
150
143
  Self {
151
144
  depth: step.depth as u8,
152
- pc: BigInt::from(step.pc),
145
+ pc: BigInt::from(u64::from(step.pc)),
153
146
  opcode: OpCode::name_by_op(step.opcode).to_string(),
154
147
  stack,
155
148
  memory,
@@ -157,7 +150,7 @@ impl TracingStep {
157
150
  }
158
151
  }
159
152
 
160
- fn u256_to_bigint(v: &edr_evm::U256) -> BigInt {
153
+ pub(crate) fn u256_to_bigint(v: &edr_evm::U256) -> BigInt {
161
154
  BigInt {
162
155
  sign_bit: false,
163
156
  words: v.into_limbs().to_vec(),
@@ -203,3 +196,10 @@ impl RawTrace {
203
196
  .collect::<napi::Result<_>>()
204
197
  }
205
198
  }
199
+
200
+ #[napi]
201
+ /// Returns the latest version of solc that EDR officially
202
+ /// supports and is tested against.
203
+ pub fn get_latest_supported_solc_version() -> String {
204
+ "0.8.28".to_string()
205
+ }
@@ -1,27 +0,0 @@
1
- use std::rc::Rc;
2
-
3
- use edr_solidity::artifacts::{CompilerInput, CompilerOutput};
4
- use napi::{bindgen_prelude::ClassInstance, Env};
5
- use napi_derive::napi;
6
-
7
- use crate::trace::model::BytecodeWrapper;
8
-
9
- #[napi(catch_unwind)]
10
- pub fn create_models_and_decode_bytecodes(
11
- solc_version: String,
12
- compiler_input: serde_json::Value,
13
- compiler_output: serde_json::Value,
14
- env: Env,
15
- ) -> napi::Result<Vec<ClassInstance<BytecodeWrapper>>> {
16
- let compiler_input: CompilerInput = serde_json::from_value(compiler_input)?;
17
- let compiler_output: CompilerOutput = serde_json::from_value(compiler_output)?;
18
-
19
- edr_solidity::compiler::create_models_and_decode_bytecodes(
20
- solc_version,
21
- &compiler_input,
22
- &compiler_output,
23
- )?
24
- .into_iter()
25
- .map(|bytecode| BytecodeWrapper::new(Rc::new(bytecode)).into_instance(env))
26
- .collect()
27
- }