From bdee0c0491ee6d012e83aecd2f1488e67d15b231 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:45:59 -0700 Subject: [PATCH] feat: sudo remove timed out drs --- src/msgs/data_requests/sudo/mod.rs | 1 + src/msgs/data_requests/sudo_tests.rs | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/msgs/data_requests/sudo/mod.rs b/src/msgs/data_requests/sudo/mod.rs index 1310ec8..86245e1 100644 --- a/src/msgs/data_requests/sudo/mod.rs +++ b/src/msgs/data_requests/sudo/mod.rs @@ -23,6 +23,7 @@ impl From for crate::msgs::SudoMsg { pub enum SudoMsg { PostDataResult(PostResult), PostDataResults(post_results::Sudo), + RemoveTimedOutDataRequests, } impl From for super::SudoMsg { diff --git a/src/msgs/data_requests/sudo_tests.rs b/src/msgs/data_requests/sudo_tests.rs index b6ad463..f376566 100644 --- a/src/msgs/data_requests/sudo_tests.rs +++ b/src/msgs/data_requests/sudo_tests.rs @@ -3,7 +3,7 @@ use serde_json::json; #[cfg(feature = "cosmwasm")] use super::Bytes; -use super::{sudo::*, DataResult, SudoMsg}; +use super::{DataResult, SudoMsg, sudo::*}; use crate::msgs::*; #[test] @@ -63,3 +63,13 @@ fn json_post_result() { #[cfg(feature = "cosmwasm")] assert_json_deser(msg, expected_json); } + +#[test] +fn json_remove_timed_out_data_requests() { + let expected_json = json!("remove_timed_out_data_requests"); + let msg: SudoMsg = data_requests::sudo::SudoMsg::RemoveTimedOutDataRequests.into(); + #[cfg(not(feature = "cosmwasm"))] + assert_json_ser(msg, expected_json); + #[cfg(feature = "cosmwasm")] + assert_json_deser(msg, expected_json); +}