mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-05-24 21:21:35 +00:00
40 lines
813 B
Rust
40 lines
813 B
Rust
|
#![cfg(test)]
|
||
|
|
||
|
#[derive(Deserialize)]
|
||
|
pub struct RuntimeValue {
|
||
|
#[serde(rename = "type")]
|
||
|
value_type: String,
|
||
|
value: String,
|
||
|
}
|
||
|
|
||
|
#[derive(Deserialize)]
|
||
|
#[serde(tag = "type")]
|
||
|
pub enum Action {
|
||
|
#[serde(rename = "invoke")]
|
||
|
Invoke { field: String, args: Vec<RuntimeValue> }
|
||
|
}
|
||
|
|
||
|
#[derive(Deserialize)]
|
||
|
#[serde(tag = "type")]
|
||
|
pub enum Command {
|
||
|
#[serde(rename = "module")]
|
||
|
Module { line: u64, filename: String },
|
||
|
#[serde(rename = "assert_return")]
|
||
|
AssertReturn {
|
||
|
line: u64,
|
||
|
action: Action,
|
||
|
expected: Vec<RuntimeValue>,
|
||
|
},
|
||
|
#[serde(rename = "assert_trap")]
|
||
|
AssertTrap {
|
||
|
line: u64,
|
||
|
action: Action,
|
||
|
text: String,
|
||
|
},
|
||
|
}
|
||
|
|
||
|
#[derive(Deserialize)]
|
||
|
pub struct Commands {
|
||
|
source_filename: String,
|
||
|
commands: Vec<Command>,
|
||
|
}
|