Skip to content

Commit

Permalink
Update counter example to remove mutate_application.
Browse files Browse the repository at this point in the history
  • Loading branch information
Twey committed Feb 6, 2025
1 parent b34a795 commit 8025084
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion examples/counter/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2>Counter</h2>

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

0 comments on commit 8025084

Please sign in to comment.