Skip to content

Commit

Permalink
fix: compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Oct 28, 2024
1 parent 65f34ce commit 19e6e3e
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/rs-dapi-client/src/dapi_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use crate::connection_pool::ConnectionPool;
use crate::transport::TransportError;
use crate::{
transport::{TransportClient, TransportRequest},
Address, AddressList, CanRetry, DapiRequestExecutor, ExecutionError, ExecutionResponse,
ExecutionResult, RequestSettings,
AddressList, CanRetry, DapiRequestExecutor, ExecutionError, ExecutionResponse, ExecutionResult,
RequestSettings,
};

/// General DAPI request error type.
Expand Down
7 changes: 3 additions & 4 deletions packages/rs-dapi-client/src/executor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::transport::{TransportClient, TransportRequest};
use crate::transport::TransportRequest;
use crate::{Address, CanRetry, DapiClientError, RequestSettings};
use dapi_grpc::mock::Mockable;
use dapi_grpc::tonic::async_trait;
Expand All @@ -12,11 +12,10 @@ pub trait DapiRequestExecutor {
&self,
request: R,
settings: RequestSettings,
) -> ExecutionResult<R::Response, DapiClientError<<R::Client as TransportClient>::Error>>
) -> ExecutionResult<R::Response, DapiClientError>
where
R: TransportRequest + Mockable,
R::Response: Mockable,
<R::Client as TransportClient>::Error: Mockable;
R::Response: Mockable;
}

/// Unwrap wrapped types
Expand Down
8 changes: 5 additions & 3 deletions packages/rs-dapi-client/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
//!
//! See `tests/mock_dapi_client.rs` for an example.

use crate::{transport::TransportRequest, DapiClientError, DapiRequestExecutor, ExecutionError, ExecutionResponse, ExecutionResult,
RequestSettings};
use crate::{
transport::TransportRequest, DapiClientError, DapiRequestExecutor, ExecutionError,
ExecutionResponse, ExecutionResult, RequestSettings,
};
use dapi_grpc::mock::Mockable;
use dapi_grpc::tonic::async_trait;
use hex::ToHex;
Expand All @@ -33,7 +35,7 @@ pub struct MockDapiClient {
expectations: Expectations,
}
/// Result of executing a mock request
pub type MockResult<T> = Result<<T as TransportRequest>::Response, DapiClientError>;
pub type MockResult<T> = ExecutionResult<<T as TransportRequest>::Response, DapiClientError>;

impl MockDapiClient {
/// Create a new mock client
Expand Down
2 changes: 1 addition & 1 deletion packages/rs-sdk/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use dpp::version::PlatformVersionError;
use dpp::ProtocolError;
pub use drive_proof_verifier::error::ContextProviderError;
use rs_dapi_client::transport::TransportError;
use rs_dapi_client::{CanRetry, DapiClientError};
use rs_dapi_client::{CanRetry, DapiClientError, ExecutionError};
use std::fmt::Debug;
use std::time::Duration;

Expand Down
2 changes: 0 additions & 2 deletions packages/rs-sdk/src/platform/delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
//! Each of these enums has a variant for each request/response pair. Name of variant in request enum is the same as
//! the name of variant in response.

use rs_dapi_client::transport::TransportError;

/// Delegate the execution of a transport request to the appropriate variant of an enum wrapper.
///
/// Given two enums, request and response, that wrap multiple requests/responses for one object type, this macro
Expand Down
2 changes: 1 addition & 1 deletion packages/rs-sdk/src/platform/document_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use dpp::{
use drive::query::{DriveDocumentQuery, InternalClauses, OrderClause, WhereClause, WhereOperator};
use drive_proof_verifier::{types::Documents, ContextProvider, FromProof};
use rs_dapi_client::transport::{
AppliedRequestSettings, BoxFuture, TransportClient, TransportError, TransportRequest,
AppliedRequestSettings, BoxFuture, TransportError, TransportRequest,
};

use super::fetch::Fetch;
Expand Down
2 changes: 1 addition & 1 deletion packages/rs-sdk/src/platform/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use dpp::{
prelude::Identity,
};
use drive_proof_verifier::FromProof;
use rs_dapi_client::{transport::TransportRequest, DapiClientError, DapiRequest, RequestSettings};
use rs_dapi_client::{transport::TransportRequest, DapiRequest, RequestSettings};
use rs_dapi_client::{ExecutionError, ExecutionResponse, InnerInto, IntoInner};
use std::fmt::Debug;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use dapi_grpc::platform::v0::get_identities_contract_keys_request::Version::V0;
use dapi_grpc::platform::v0::GetIdentitiesContractKeysRequest;
use dpp::identity::Purpose;
use rs_dapi_client::transport::{
AppliedRequestSettings, BoxFuture, TransportClient, TransportError, TransportRequest,
AppliedRequestSettings, BoxFuture, TransportError, TransportRequest,
};

use crate::platform::Identifier;
Expand Down
3 changes: 1 addition & 2 deletions packages/rs-sdk/src/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ use rs_dapi_client::mock::MockDapiClient;
pub use rs_dapi_client::AddressList;
pub use rs_dapi_client::RequestSettings;
use rs_dapi_client::{
transport::{TransportClient, TransportRequest},
DapiClient, DapiClientError, DapiRequestExecutor, ExecutionResult,
transport::TransportRequest, DapiClient, DapiClientError, DapiRequestExecutor, ExecutionResult,
};
use std::collections::btree_map::Entry;
use std::fmt::Debug;
Expand Down

0 comments on commit 19e6e3e

Please sign in to comment.