We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
host_get_counter
host
1 parent a3a669f commit 223e128Copy full SHA for 223e128
contracts/host/src/lib.rs
@@ -45,6 +45,12 @@ impl Hoster {
45
false => String::from("PROOF IS INVALID"),
46
}
47
48
+
49
+ /// Call 'get_counter' function available from the host, and return the
50
+ /// result
51
+ pub fn host_get_counter(&self) -> i64 {
52
+ uplink::host_query("get_counter", ())
53
+ }
54
55
56
/// Expose `Hoster::host_hash()` to the host
@@ -60,3 +66,9 @@ unsafe fn host_verify(arg_len: u32) -> u32 {
60
66
STATE.host_verify(proof, public_inputs)
61
67
})
62
68
69
70
+/// Expose `Hoster::host_counter()` to the host
71
+#[no_mangle]
72
+unsafe fn host_get_counter(arg_len: u32) -> u32 {
73
+ uplink::wrap_call(arg_len, |()| STATE.host_get_counter())
74
+}
0 commit comments