data Call
One recorded call of a mocked rpc (S.calls(.m), §18.3).
Example:
service Ledger {
@public rpc note(n: i64) -> i64
}
impl Ledger {
rpc note(n) => n
}
fn record(n: i64) -> i64 | NetError net {
Ledger.note(n)
}
test "calls are recorded" {
mock Ledger {
note(n) => n + 1
}
let r = record(4)!
assert_eq(r, 5)
let calls = Ledger.calls(.note)
assert_eq(calls.count, 1)
assert_eq(calls[0].method, "note")
}pub(api) data CallС версии. 1.0.0-beta
Поля
pub(api) method: str | The rpc name. |
pub(api) args: str | The arguments as text: |
pub(api) ctx: Ctx | The |
pub(api) time: Time | When the call arrived (wall clock). |
Определено в: std/core/testing.oxl:169