> For the complete documentation index, see [llms.txt](https://doc.cess.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/file_bank/replace_idle_space.md).

# Replace Idle Space

The `replace_idle_space` submits a transactions to replace idle space. After the miner stores the service data, there will be a part of the idle space to be replaced, and the miner completes the update of the relevant data of the idle space through this transaction.

```rust
/// Submits a transaction to replace idle space. This is used after a miner stores service data and needs to update the relevant data for the idle space.
///
/// # Parameters
///
/// - `idle_sig_info`: Information about the idle space signature that needs to be updated.
/// - `tee_sig_need_verify`: Signature that needs verification from the Trusted Execution Environment (TEE).
/// - `tee_sig`: The TEE signature used for validation and integrity checks.
/// - `tee_puk`: The public key of the TEE used for verifying the signature.
///
/// # Returns
///
/// Returns a `Result` that, on success, contains a tuple with:
/// - `TxHash`: The transaction hash associated with the replacement of idle space.
/// - `ReplaceIdleSpace`: A structure representing the result of the idle space replacement.
///
pub async fn replace_idle_space(
    &self,
    idle_sig_info: IdleSigInfo,
    tee_sig_need_verify: TeeSigNeedVerify,
    tee_sig: TeeSig,
    tee_puk: TeePuk,
) -> Result<(TxHash, ReplaceIdleSpace), Box<dyn std::error::Error>>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/file_bank/replace_idle_space.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
