diff --git a/crates/context/config/src/client/env/config/mutate.rs b/crates/context/config/src/client/env/config/mutate.rs index 693803150..3a672c020 100644 --- a/crates/context/config/src/client/env/config/mutate.rs +++ b/crates/context/config/src/client/env/config/mutate.rs @@ -140,7 +140,7 @@ impl<'a> Method for Mutate<'a> { let request = ICPRequest::new(signer_sk.verifying_key().rt()?, self.kind.into()); let signed = ICPSigned::new(request, |b| signer_sk.sign(b))?; - + let encoded = candid::encode_one(&signed)?; Ok(encoded) diff --git a/crates/context/config/src/client/protocol/icp.rs b/crates/context/config/src/client/protocol/icp.rs index 78cd8fceb..54c5fa95e 100644 --- a/crates/context/config/src/client/protocol/icp.rs +++ b/crates/context/config/src/client/protocol/icp.rs @@ -234,16 +234,16 @@ impl Network { match candid::decode_one::>(&data) { Ok(decoded) => { match decoded { - Ok(()) => Ok(vec![]), // Return empty vec for success - Err(err_msg) => Ok(err_msg.into_bytes()) // Return error message as bytes + Ok(()) => Ok(vec![]), // Return empty vec for success + Err(err_msg) => Ok(err_msg.into_bytes()), // Return error message as bytes } - }, + } Err(e) => { println!("Failed to decode: {}", e); Ok(e.to_string().into_bytes()) // Return decode error as bytes } } - }, + } Ok(CallResponse::Poll(_)) => Ok("Unexpected polling response".as_bytes().to_vec()), Err(err) => Ok(err.to_string().into_bytes()), }