Module unc_jsonrpc_client::methods::sandbox_patch_state
source · Expand description
Patch account, access keys, contract code, or contract state.
Only additions and mutations are supported. No deletions.
Account, access keys, contract code, and contract states have different formats. See the example and docs for details about their format.
§Examples
use unc_jsonrpc_client::{methods, JsonRpcClient};
use unc_primitives::{state_record::StateRecord, account, types::AccountId, hash::CryptoHash};
let client = JsonRpcClient::connect("http://localhost:3030");
let request = methods::sandbox_patch_state::RpcSandboxPatchStateRequest {
records: vec![
StateRecord::Account {
account_id: "fido.testnet".parse::<AccountId>()?,
account: account::Account::new(179, 0, CryptoHash::default(), 264)
}
],
};
let response = client.call(request).await?;
assert!(matches!(
response,
methods::sandbox_patch_state::RpcSandboxPatchStateResponse { .. }
));