From c3882e9c0f5069184be680770d5cc49148763911 Mon Sep 17 00:00:00 2001 From: hylcore-V Date: Sat, 2 Oct 2021 12:45:00 +0400 Subject: [PATCH] debug tests --- src/lib.rs | 6 ++++-- tests/test.rs | 4 ---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 248c4d1..abb19d1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -850,9 +850,11 @@ pub mod subscrypt { let linked_list: &mut LinkedList = &mut self.providers.get_mut(&caller).unwrap().payment_manager; - linked_list.head = t.current_linked_list_head; + linked_list.length -= t.reduced_length; - t.withdrawing_amount + linked_list.head = t.current_linked_list_head; + + return t.withdrawing_amount; } /// `users` can use this function to easily refund their subscription as the policy of that diff --git a/tests/test.rs b/tests/test.rs index ab6b801..b4120e7 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -598,10 +598,6 @@ pub mod tests { subscrypt.withdraw(), expected ); - assert_eq!( - subscrypt.withdraw(), - expected - ); } /// Simple scenario that `alice` register as a provider and `bob` will subscribe to her second plan /// and then `eve` tries to withdraw locked money but she can't.