From a712604871837a1deed45e5fd789fcbb1c8e372b Mon Sep 17 00:00:00 2001 From: betterclever Date: Wed, 7 Feb 2024 19:20:58 +0530 Subject: [PATCH] add a test for reward schedule repeated refund claim --- contracts/governance_admin/tests/reward-schedule.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/contracts/governance_admin/tests/reward-schedule.rs b/contracts/governance_admin/tests/reward-schedule.rs index 678f2e9..79c4150 100644 --- a/contracts/governance_admin/tests/reward-schedule.rs +++ b/contracts/governance_admin/tests/reward-schedule.rs @@ -584,6 +584,17 @@ impl<'a> RewardScheduleTestSuite<'a> { refund_block_height: self.persistence.get_block_height() as u64, } ); + + // try claiming refund again, it should fail + let res = self.claim_refund(reward_schedule_request_id); + assert!(res.is_err()); + let error = res.unwrap_err(); + let expected_err = format!( + "execute error: failed to execute message; message index: 0: Funds already claimed for this request at block height: {}: execute wasm contract failed", + self.persistence.get_block_height() - 1, + ); + + assert_eq!(error.to_string(), expected_err); } fn allow_lp_token(&self) {