Skip to content

Commit

Permalink
feat: show warning when GRPC method is disallowed (#6246)
Browse files Browse the repository at this point in the history
Description
---
Cherry picks this pr for dev:
#6244

---------

Co-authored-by: Stan Bondi <sdbondi@users.noreply.github.com>
  • Loading branch information
SWvheerden and sdbondi authored Apr 11, 2024
1 parent 492e00e commit 0019c11
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 127 deletions.
9 changes: 8 additions & 1 deletion applications/minotari_node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use std::{
fmt,
path::{Path, PathBuf},
time::Duration,
};
Expand Down Expand Up @@ -219,7 +220,7 @@ pub enum DatabaseType {
}

/// A list of all the GRPC methods that can be enabled/disabled
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
#[derive(Debug, Clone, Copy, Serialize, Deserialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum GrpcMethod {
ListHeaders,
Expand Down Expand Up @@ -260,6 +261,12 @@ pub enum GrpcMethod {
GetSideChainUtxos,
}

impl fmt::Display for GrpcMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", self)
}
}

#[cfg(test)]
mod tests {
use serde::{Deserialize, Serialize};
Expand Down
Loading

0 comments on commit 0019c11

Please sign in to comment.