fix context error

This commit is contained in:
Peter Zhang 2025-10-02 08:42:33 +08:00
parent 88287333b5
commit 5b071e535a

View File

@ -139,6 +139,12 @@ impl MineContextWatcher {
} }
let miner_id = self.miner_id.0; let miner_id = self.miner_id.0;
// Use eth_call with specific caller address for read-only access
let compute_caller: Address = "0x000000000000000000000000000000000000000A"
.parse()
.map_err(|e| format!("Invalid compute caller address: {:?}", e))?;
let WorkerContext { let WorkerContext {
context, context,
pora_target, pora_target,
@ -147,6 +153,7 @@ impl MineContextWatcher {
} = self } = self
.mine_contract .mine_contract
.compute_worker_context(miner_id) .compute_worker_context(miner_id)
.from(compute_caller)
.call() .call()
.await .await
.map_err(|e| format!("Failed to query mining context: {:?}", e))?; .map_err(|e| format!("Failed to query mining context: {:?}", e))?;