Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: sign request_status for update call #1676

Merged
merged 12 commits into from
May 25, 2021
Merged

Conversation

lwshang
Copy link
Contributor

@lwshang lwshang commented May 20, 2021

close dfinity/dx-triage#156

Current implementation for sign/send segregation is a hack which "hijacks" the transport of the agent. Because in agent-rs, we only publish the top layer interface which make it hard to get intermediate stages of a update/query call.

In consequence, the response from sign/send cannot be handled as well as in canister call. We have to print the CBOR response naively and let users to investigate using cbor.me.

To make sign/send user friendly, we need a refactor in agent-rs.

@lwshang lwshang requested review from hansl and p-shahi May 20, 2021 10:14
src/dfx/src/commands/canister/send.rs Show resolved Hide resolved
e2e/tests-dfx/sign_send.bash Show resolved Hide resolved
@lwshang lwshang requested a review from p-shahi May 20, 2021 23:14
@lwshang lwshang enabled auto-merge (squash) May 20, 2021 23:18
@lwshang lwshang disabled auto-merge May 20, 2021 23:40
@lwshang lwshang marked this pull request as draft May 20, 2021 23:44
@lwshang lwshang marked this pull request as ready for review May 22, 2021 01:51
@lwshang
Copy link
Contributor Author

lwshang commented May 22, 2021

Block by dfinity/agent-rs#182

let envelope = hex::decode(&message.signed_request_status.unwrap())?;
let response = transport.read_state(canister_id.clone(), envelope).await?;
let read_state_response: ReadStateResponse = serde_cbor::from_slice(&response)?;
let certificate: Certificate = serde_cbor::from_slice(&read_state_response.certificate)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hansl Here is the usage of Certificate. It does a deserialization from CBOR response.

@lwshang lwshang self-assigned this May 25, 2021
@lwshang lwshang merged commit 551a3ee into master May 25, 2021
@lwshang lwshang deleted the lwshang/sign_request_status branch May 25, 2021 23:27
dfinity-bot added a commit that referenced this pull request Apr 9, 2023
mergify bot pushed a commit that referenced this pull request Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants