Explorar o código

uns reward claim with no account found

ignazio %!s(int64=3) %!d(string=hai) anos
pai
achega
b44561c356
Modificáronse 1 ficheiros con 23 adicións e 0 borrados
  1. 23 0
      runtime-modules/content/src/tests/merkle.rs

+ 23 - 0
runtime-modules/content/src/tests/merkle.rs

@@ -288,3 +288,26 @@ fn successful_reward_claim_by_curator() {
             .call_and_assert(Ok(()))
     })
 }
+
+#[test]
+fn unsuccessful_reward_claim_with_no_reward_account_found() {
+    with_default_mock_builder(|| {
+        run_to_block(1);
+
+        create_initial_storage_buckets_helper();
+        increase_account_balance_helper(DEFAULT_MEMBER_ACCOUNT_ID, INITIAL_BALANCE);
+        create_default_member_owned_channel_with_video();
+        let payments = create_some_pull_payments_helper();
+        update_commit_value_with_payments_helper(&payments);
+
+        UpdateChannelFixture::default()
+            .with_sender(DEFAULT_MEMBER_ACCOUNT_ID)
+            .with_actor(ContentActor::Member(DEFAULT_MEMBER_ID))
+            .with_reward_account(Some(None))
+            .call_and_assert(Ok(()));
+
+        ClaimChannelRewardFixture::default()
+            .with_payments(payments)
+            .call_and_assert(Err(Error::<Test>::RewardAccountNotFoundInChannel.into()));
+    })
+}