diff --git a/examples/src/spooning.rs b/examples/src/spooning.rs index ce2e5ae8..9bf71135 100644 --- a/examples/src/spooning.rs +++ b/examples/src/spooning.rs @@ -99,7 +99,7 @@ async fn main() -> anyhow::Result<()> { worker .patch_state( sandbox_contract.id(), - "STATE".to_string(), + "STATE".into(), status_msg.try_to_vec()?, ) .await?; diff --git a/workspaces/src/network/mod.rs b/workspaces/src/network/mod.rs index e59708ff..985ec0f0 100644 --- a/workspaces/src/network/mod.rs +++ b/workspaces/src/network/mod.rs @@ -101,7 +101,7 @@ pub trait StatePatcher { async fn patch_state( &self, contract_id: &AccountId, - key: String, + key: Vec, value: Vec, ) -> anyhow::Result<()>; @@ -120,12 +120,12 @@ where async fn patch_state( &self, contract_id: &AccountId, - key: String, + key: Vec, value: Vec, ) -> anyhow::Result<()> { let state = StateRecord::Data { account_id: contract_id.to_owned(), - data_key: key.into(), + data_key: key, value, }; let records = vec![state]; diff --git a/workspaces/src/worker/impls.rs b/workspaces/src/worker/impls.rs index 41b65e50..50167bd8 100644 --- a/workspaces/src/worker/impls.rs +++ b/workspaces/src/worker/impls.rs @@ -64,7 +64,7 @@ where async fn patch_state( &self, contract_id: &AccountId, - key: String, + key: Vec, value: Vec, ) -> anyhow::Result<()> { self.workspace.patch_state(contract_id, key, value).await diff --git a/workspaces/tests/patch_state.rs b/workspaces/tests/patch_state.rs index ab58a136..c4376289 100644 --- a/workspaces/tests/patch_state.rs +++ b/workspaces/tests/patch_state.rs @@ -71,7 +71,7 @@ async fn test_patch_state() -> anyhow::Result<()> { }); worker - .patch_state(&contract_id, "STATE".to_string(), status_msg.try_to_vec()?) + .patch_state(&contract_id, "STATE".into(), status_msg.try_to_vec()?) .await?; let status: String = worker