Skip to content

Commit

Permalink
Removed unused message
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Sep 20, 2024
1 parent 2d48212 commit 7486a33
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 28 deletions.
8 changes: 0 additions & 8 deletions core/model/src/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ pub mod local {
Invoice(InvoicePayment),
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct CollectPayments {}
impl RpcMessage for CollectPayments {
const ID: &'static str = "CollectPayments";
type Item = ();
type Error = GenericError;
}

#[derive(Clone, Debug, Serialize, Deserialize, thiserror::Error)]
#[error("{inner}")]
pub struct GenericError {
Expand Down
14 changes: 5 additions & 9 deletions core/payment/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ use ya_core_model::driver::{
ValidateAllocationResult,
};
use ya_core_model::payment::local::{
CollectPayments, GenericError, GetAccountsError, GetDriversError, NotifyPayment,
ProcessBatchCycleError, ProcessBatchCycleInfo, ProcessBatchCycleResponse, ProcessBatchCycleSet,
ProcessPaymentsError, ProcessPaymentsNow, ProcessPaymentsNowResponse, RegisterAccount,
RegisterAccountError, RegisterDriver, RegisterDriverError, UnregisterAccount,
UnregisterAccountError, UnregisterDriver, UnregisterDriverError,
GenericError, GetAccountsError, GetDriversError, NotifyPayment, ProcessBatchCycleError,
ProcessBatchCycleInfo, ProcessBatchCycleResponse, ProcessBatchCycleSet, ProcessPaymentsError,
ProcessPaymentsNow, ProcessPaymentsNowResponse, RegisterAccount, RegisterAccountError,
RegisterDriver, RegisterDriverError, UnregisterAccount, UnregisterAccountError,
UnregisterDriver, UnregisterDriverError,
};
use ya_core_model::payment::public::{SendPayment, SendSignedPayment, BUS_ID};
use ya_core_model::{identity, NodeId};
Expand Down Expand Up @@ -1015,10 +1015,6 @@ impl PaymentProcessor {
.await
}

pub async fn collect_payments(&self, msg: CollectPayments) -> Result<(), GenericError> {
Ok(())
}

pub async fn verify_payment(
&self,
payment: Payment,
Expand Down
11 changes: 0 additions & 11 deletions core/payment/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ mod local {
log::debug!("Binding payment local service to service bus");

ServiceBinder::new(BUS_ID, db, processor)
.bind_with_processor(collect_payments)
.bind_with_processor(register_driver)
.bind_with_processor(unregister_driver)
.bind_with_processor(register_account)
Expand Down Expand Up @@ -114,16 +113,6 @@ mod local {
log::debug!("Successfully bound payment local service to service bus");
}

async fn collect_payments(
db: DbExecutor,
processor: Arc<PaymentProcessor>,
sender: String,
msg: CollectPayments,
) -> Result<(), GenericError> {
processor.collect_payments(msg).await?;
Ok(())
}

async fn register_driver(
db: DbExecutor,
processor: Arc<PaymentProcessor>,
Expand Down

0 comments on commit 7486a33

Please sign in to comment.