Skip to content

Commit

Permalink
Serialize BanReason as tagged enum.
Browse files Browse the repository at this point in the history
  • Loading branch information
artemii235 committed Apr 13, 2021
1 parent dd24de2 commit 49bd02c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions etomic_build/client/ban_pubkey
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
source userpass
curl --url "http://127.0.0.1:7783" --data '
{
"userpass":"'$userpass'",
"method":"ban_pubkey",
"pubkey":"'$1'",
"reason":"'$2'"
}
'
11 changes: 11 additions & 0 deletions etomic_build/client/best_orders
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
source userpass
curl --url "http://127.0.0.1:7783" --data '
{
"userpass":"'$userpass'",
"method":"best_orders",
"coin":"'$1'",
"action":"'$2'",
"volume":"'$3'"
}
'
8 changes: 8 additions & 0 deletions etomic_build/client/list_banned_pubkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
source userpass
curl --url "http://127.0.0.1:7783" --data '
{
"userpass":"'$userpass'",
"method":"list_banned_pubkeys"
}
'
1 change: 1 addition & 0 deletions mm2src/lp_swap/pubkey_banning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::collections::hash_map::{Entry, HashMap};
use uuid::Uuid;

#[derive(Serialize)]
#[serde(tag = "type")]
#[allow(clippy::large_enum_variant)]
pub enum BanReason {
Manual {
Expand Down

0 comments on commit 49bd02c

Please sign in to comment.