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: root call mod with new CallError #535

Merged
merged 10 commits into from
Dec 11, 2024
Merged

Conversation

lwshang
Copy link
Contributor

@lwshang lwshang commented Dec 10, 2024

Description

The Call struct API was added to the existing src/api/call.rs module.
This PR moves the new API to src/call.rs module.
The src/api/call.rs is consistent with the main branch with some minor adjustment for the new ic0 crate.

The src/call.rs module also got some refreshment.

pub type CallResult<R> = Result<R, CallError>;

pub enum CallError {
    #[error("Failed to encode the arguments: {0}")]
    CandidEncodeFailed(String),

    #[error("The IC was not able to enqueue the call with code {0:?}")]
    CallPerformFailed(CallPerformErrorCode),

    #[error("The call was rejected with code {0:?} and message: {1}")]
    CallRejected(RejectCode, String),

    #[error("Failed to decode the response as {0}")]
    CandidDecodeFailed(String),
}

How Has This Been Tested?

e2e tests

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@lwshang lwshang marked this pull request as ready for review December 11, 2024 18:22
@lwshang lwshang requested a review from a team as a code owner December 11, 2024 18:22
@lwshang lwshang merged commit 9f9c0f7 into next Dec 11, 2024
8 checks passed
@lwshang lwshang deleted the lwshang/separate_call_mod branch December 11, 2024 18:22
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.

1 participant