Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit d0e6536

Browse files
committed
🐛 Get contract state on indexer
1 parent 7b22efb commit d0e6536

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

crates/server/src/contract.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use anyhow::{bail, Error, Result};
22
use borsh::to_vec;
33
use hyle::{
44
model::{BlobTransaction, ProofData, ProofTransaction},
5+
node_state::model::Contract,
56
rest::client::ApiHttpClient,
67
};
78
use sdk::{Blob, ContractInput, ContractName, Digestable, HyleOutput, Identity, TxHash};
@@ -66,7 +67,11 @@ pub async fn fetch_current_state<State>(
6667
where
6768
State: TryFrom<sdk::StateDigest, Error = Error>,
6869
{
69-
let resp = client.get_contract(contract_name).await?;
70+
let resp = client
71+
.get_indexer_contract(contract_name)
72+
.await?
73+
.json::<Contract>()
74+
.await?;
7075

7176
resp.state.try_into()
7277
}

crates/ui/src/contracts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn spawn_fetch_state(state_cb: Callback<HyllarToken>) {
2424
spawn_local(async move {
2525
loop {
2626
let url = get_node_url();
27-
let resp = match reqwest::get(format!("{}/v1/contract/hyllar", url)).await {
27+
let resp = match reqwest::get(format!("{}/v1/indexer/contract/hyllar", url)).await {
2828
Ok(it) => it,
2929
Err(_) => {
3030
sleep(TEN_SECS).await;

0 commit comments

Comments
 (0)