mirror of
https://github.com/fluencelabs/marine.git
synced 2025-03-15 14:00:50 +00:00
add raw-aquamarine-api feature for AquamarineVM
This commit is contained in:
parent
bfc69c8104
commit
4ccce8f5c5
@ -16,3 +16,7 @@ fluence-faas = { path = "../fluence-faas", version = "0.1.10" }
|
|||||||
maplit = "1.0.2"
|
maplit = "1.0.2"
|
||||||
serde_json = "1.0.57"
|
serde_json = "1.0.57"
|
||||||
serde = "1.0.116"
|
serde = "1.0.116"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
# enable raw AquamarineVM API intended for testing
|
||||||
|
raw-aquamarine-api = []
|
||||||
|
@ -208,3 +208,32 @@ impl AquamarineVM {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This API is intended for testing purposes
|
||||||
|
#[cfg(feature = "raw-aquamarine-api")]
|
||||||
|
impl AppService {
|
||||||
|
pub fn call(
|
||||||
|
&mut self,
|
||||||
|
init_user_id: impl Into<String>,
|
||||||
|
aqua: impl Into<String>,
|
||||||
|
prev_data: impl Into<String>,
|
||||||
|
data: impl Into<String>,
|
||||||
|
) -> Result<StepperOutcome> {
|
||||||
|
let args = vec![
|
||||||
|
IValue::String(init_user_id.into()),
|
||||||
|
IValue::String(aqua.into()),
|
||||||
|
IValue::String(prev_data.into()),
|
||||||
|
IValue::String(data.into()),
|
||||||
|
];
|
||||||
|
|
||||||
|
let result = self.faas.call_with_ivalues(
|
||||||
|
AQUAMARINE_WASM_FILE_NAME,
|
||||||
|
"invoke",
|
||||||
|
&args,
|
||||||
|
<_>::default(),
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let raw_outcome = Self::make_raw_outcome(result)?;
|
||||||
|
raw_outcome.try_into()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user