mirror of
https://github.com/fluencelabs/aquavm
synced 2025-06-27 13:41:32 +00:00
Introduce TracePos type for trace positions (#273)
Many internal structures refer to trace positions; this is an important type of values. In the code, it is sometimes `u32`, sometimes `usize`. While such variables usually have "_pos" suffix, having a dedicated type does improve code with type guarantees.
This commit is contained in:
@ -89,8 +89,9 @@ pub fn data_from_result(result: &RawAVMOutcome) -> InterpreterData {
|
||||
serde_json::from_slice(&result.data).expect("default serializer shouldn't fail")
|
||||
}
|
||||
|
||||
pub fn raw_data_from_trace(trace: ExecutionTrace) -> Vec<u8> {
|
||||
let data = InterpreterData::from_execution_result(trace, <_>::default(), <_>::default(), 0);
|
||||
pub fn raw_data_from_trace(trace: impl Into<ExecutionTrace>) -> Vec<u8> {
|
||||
let data =
|
||||
InterpreterData::from_execution_result(trace.into(), <_>::default(), <_>::default(), 0);
|
||||
serde_json::to_vec(&data).expect("default serializer shouldn't fail")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user