Skip to content

Commit

Permalink
exclude ibc_channel if param is ""
Browse files Browse the repository at this point in the history
  • Loading branch information
smk762 committed Nov 27, 2024
1 parent 6312c5d commit 69e4c06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/core/atomicdex/api/kdf/rpc_v2/rpc2.withdraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ namespace atomic_dex::kdf
obj["params"]["amount"] = cfg.amount;
obj["params"]["to"] = cfg.to;
obj["params"]["max"] = cfg.max;
if (cfg.memo.has_value())
if (cfg.ibc_source_channel.has_value())
{
obj["params"]["ibc_source_channel"] = cfg.ibc_source_channel.value();
if (cfg.ibc_source_channel.value() != "")
{
obj["params"]["ibc_source_channel"] = cfg.ibc_source_channel.value();
}
}
if (cfg.memo.has_value())
{
Expand Down
10 changes: 5 additions & 5 deletions src/core/atomicdex/api/kdf/rpc_v2/rpc2.withdraw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ namespace atomic_dex::kdf
struct withdraw_request
{
std::string coin;
std::string to; ///< coins will be withdraw to this address
std::string amount; ///< ignored if max is true
std::optional<withdraw_fees> fees{std::nullopt}; ///< ignored if std::nullopt
std::optional<std::string> memo; ///< memo for tendermint
std::optional<std::string> ibc_source_channel; ///< ibc_source_channel for tendermint
std::string to; ///< coins will be withdraw to this address
std::string amount; ///< ignored if max is true
std::optional<withdraw_fees> fees{std::nullopt}; ///< ignored if std::nullopt
std::optional<std::string> memo{""}; ///< memo for tendermint
std::optional<std::string> ibc_source_channel{""}; ///< ibc_source_channel for tendermint
bool max{false};
};

Expand Down

0 comments on commit 69e4c06

Please sign in to comment.