From 802508489c23923360c30de2ce2dd6de1f6035b5 Mon Sep 17 00:00:00 2001 From: James Kay Date: Wed, 5 Feb 2025 18:09:21 +0000 Subject: [PATCH] Update counter example to remove `mutate_application`. --- client/src/lib.rs | 11 +++++++---- examples/counter/index.html | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index 2e5f664..b88745d 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -268,13 +268,16 @@ impl Frontend { bytes: query.as_bytes().to_vec(), }) .await? - else { - panic!("system response to user query") - }; + else { + panic!("system response to user query") + }; let _hash = loop { use linera_core::data_types::ClientOutcome::{Committed, WaitForTimeout}; - let timeout = match chain_client.execute_operations(operations.clone(), vec![]).await? { + let timeout = match chain_client + .execute_operations(operations.clone(), vec![]) + .await? + { Committed(certificate) => break certificate.value().hash(), WaitForTimeout(timeout) => timeout, }; diff --git a/examples/counter/index.html b/examples/counter/index.html index ca41e7e..e150048 100644 --- a/examples/counter/index.html +++ b/examples/counter/index.html @@ -31,7 +31,7 @@

Counter

async function incrementCount() { await linera.callClientFunction( - 'mutate_application', + 'query_application', COUNTER_APP_ID, '{ "query": "mutation { increment(value: 1) }" }', );