Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c5ccb30
refactor sign_message and enable sign message for specific address fo…
borngraced Apr 29, 2025
7c61845
implement support for utxo
borngraced Apr 29, 2025
529f2a6
add unit test for eth
borngraced Apr 30, 2025
8a42b0e
minor changes to eth test
borngraced Apr 30, 2025
b23b8fc
implement utxo unit test
borngraced Apr 30, 2025
d323812
apply onur's patch
borngraced Apr 30, 2025
ad7e0b5
fix review notes and validate coin type
borngraced May 1, 2025
032faff
Merge branch 'dev' into hd-multi-addr-msg-sign
borngraced May 1, 2025
6d4332e
impl Display for Bip32Deri..
borngraced May 1, 2025
9e9081e
nits
borngraced May 2, 2025
187284d
validate comps that makes up path_to_coin
borngraced May 3, 2025
b10fd57
impl path_to_coin method and use for rpc derivation_path validation
borngraced May 5, 2025
5fcef99
Merge branch 'dev' into hd-multi-addr-msg-sign
borngraced May 7, 2025
791c64b
rename WithdrawFrom and reuse in SignatureRequest -< message signing
borngraced May 8, 2025
8489bb0
fmt
borngraced May 8, 2025
67266b1
rename HdAccountIdentifier to AddressIdentifier
borngraced May 8, 2025
ca176d8
fmt
borngraced May 8, 2025
38eb5dd
Merge branch 'dev' into hd-multi-addr-msg-sign
borngraced May 20, 2025
b453126
fix review notes
borngraced May 22, 2025
e7add30
Merge branch 'dev' into hd-multi-addr-msg-sign
borngraced May 22, 2025
ecc6eb7
post merge fix
borngraced May 22, 2025
98a5b6c
Merge branch 'dev' into hd-multi-addr-msg-sign
borngraced May 26, 2025
df2bbed
rename AddressIdentifier to HDAddressSelector and update doc comments
borngraced May 27, 2025
935409d
apply segwit sign-verify patch by Omar
borngraced May 27, 2025
9f0bde4
cargo fmt
borngraced May 27, 2025
8180da3
impl unit test for address conflict caused by derivation_paths
borngraced May 27, 2025
4d91373
clippy
borngraced May 27, 2025
860c208
fix naming and minor changes
borngraced May 28, 2025
3ade61b
update lp_coins sign_message
borngraced May 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions mm2src/coins/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2328,10 +2328,26 @@ impl MarketCoinOps for EthCoin {
Some(keccak256(&stream.out()).take())
}

fn sign_message(&self, message: &str) -> SignatureResult<String> {
fn sign_message(&self, message: &str, derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
let message_hash = self.sign_message_hash(message).ok_or(SignatureError::PrefixNotFound)?;
let privkey = &self.priv_key_policy.activated_key_or_err()?.secret();
let signature = sign(privkey, &H256::from(message_hash))?;

let signature = match derivation_path {
Some(derivation_path) => {
let privkey = self
.priv_key_policy
.hd_wallet_derived_priv_key_or_err(&derivation_path)
.mm_err(|err| SignatureError::InvalidRequest(err.to_string()))?;
let eth_secret = ethkey::Secret::from_slice(privkey.as_slice()).ok_or(MmError::new(
SignatureError::InvalidRequest("failed to derive ethkey::Secret".to_string()),
))?;
sign(&eth_secret, &H256::from(message_hash))?
},
None => {
let privkey = &self.priv_key_policy.activated_key_or_err()?.secret();
sign(privkey, &H256::from(message_hash))?
},
};
Comment thread
onur-ozkan marked this conversation as resolved.
Outdated

Ok(format!("0x{}", signature))
}

Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/eth/eth_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ fn test_sign_verify_message() {
);

let message = "test";
let signature = coin.sign_message(message).unwrap();
let signature = coin.sign_message(message, None).unwrap();
assert_eq!(signature, "0xcdf11a9c4591fb7334daa4b21494a2590d3f7de41c7d2b333a5b61ca59da9b311b492374cc0ba4fbae53933260fa4b1c18f15d95b694629a7b0620eec77a938600");

let is_valid = coin
Expand Down
8 changes: 7 additions & 1 deletion mm2src/coins/lightning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::{BalanceFut, CheckIfMyPaymentSentArgs, CoinBalance, ConfirmPaymentInp
ValidatePaymentInput, VerificationError, VerificationResult, WaitForHTLCTxSpendArgs, WatcherOps,
WeakSpawner, WithdrawError, WithdrawFut, WithdrawRequest};
use async_trait::async_trait;
use bip32::DerivationPath;
use bitcoin::bech32::ToBase32;
use bitcoin::hashes::Hash;
use bitcoin_hashes::sha256::Hash as Sha256;
Expand Down Expand Up @@ -950,7 +951,12 @@ impl MarketCoinOps for LightningCoin {
Some(dhash256(prefixed_message.as_bytes()).take())
}

fn sign_message(&self, message: &str) -> SignatureResult<String> {
fn sign_message(&self, message: &str, derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
if derivation_path.is_some() {
return MmError::err(SignatureError::InvalidRequest(
"functionality not supported for Lightning yet.".into(),
));
}
let message_hash = self.sign_message_hash(message).ok_or(SignatureError::PrefixNotFound)?;
let secret_key = self
.keys_manager
Expand Down
29 changes: 23 additions & 6 deletions mm2src/coins/lp_coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2084,7 +2084,7 @@ pub trait MarketCoinOps {

fn sign_message_hash(&self, _message: &str) -> Option<[u8; 32]>;

fn sign_message(&self, _message: &str) -> SignatureResult<String>;
fn sign_message(&self, _message: &str, _derivation_path: Option<DerivationPath>) -> SignatureResult<String>;

fn verify_message(&self, _signature: &str, _message: &str, _address: &str) -> VerificationResult<bool>;

Expand Down Expand Up @@ -2296,9 +2296,17 @@ pub enum ValidatorsInfoDetails {
}

#[derive(Serialize, Deserialize)]
pub struct SignatureRequest {
coin: String,
message: String,
#[serde(tag = "derivation_method", rename_all = "snake_case")]
pub enum SignatureRequest {
Iguana {
coin: String,
message: String,
},
HdWallet {
coin: String,
message: String,
derivation_path: RpcDerivationPath,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is part of the derivation path which should be static per coin (and defined in the coins file).
we might wanna get the derivation path this way: https://github.com/KomodoPlatform/komodo-defi-framework/blob/d323812a5100b3a96f152bfcbc7ac38e86b828bc/mm2src/coins/rpc_command/account_balance.rs#L19-L20

@borngraced borngraced May 1, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might disagree with this. KDF already returns full derivation path for every addresses which GUI can just pass to this param. Moreover, if I go with your suggestion, I will also need to make sign_message into an asynchronous function(no big deal tho) and make the fn do more work.

If I see a better reason not to require the full derivation_path I will rework it ofc.

#2406 (comment)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we wanna keep it like this, we at least wanna perform a check (e.g.) to make sure we are not signing from a private key that isn't standard to this coin. people make mistakes.

@borngraced borngraced May 1, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 032faff

},
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it make sense to tell the caller to state whether they want the signing with iguana or HD wallet given that KDF was initialized exclusively with either iguana or HD wallet?

i mean, if i initialized KDF with enable_hd: true, signing requests should implicitly be HD based (as signing with iguana should error anyway and vice versa), or let's say, signing should depend on the activated coin (assuming we can have one coin activated in HD mode while another activated in another mode (e.g. pubkey-only)).

what im saying is, the derivation_method field shouldn't exist.

@borngraced borngraced Apr 30, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valid point 👍🏾

done 032faff


#[derive(Serialize, Deserialize)]
Expand Down Expand Up @@ -5112,8 +5120,17 @@ pub async fn get_raw_transaction(ctx: MmArc, req: RawTransactionRequest) -> RawT
}

pub async fn sign_message(ctx: MmArc, req: SignatureRequest) -> SignatureResult<SignatureResponse> {
let coin = lp_coinfind_or_err(&ctx, &req.coin).await?;
let signature = coin.sign_message(&req.message)?;
let (coin, message, derivation_path) = match &req {
SignatureRequest::Iguana { coin, message } => (coin, message, None),
SignatureRequest::HdWallet {
coin,
message,
derivation_path,
} => (coin, message, Some(derivation_path.0.clone())),
};
let coin = lp_coinfind_or_err(&ctx, coin).await?;
let signature = coin.sign_message(message, derivation_path)?;

Ok(SignatureResponse { signature })
}

Expand Down
5 changes: 3 additions & 2 deletions mm2src/coins/qrc20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::{BalanceError, BalanceFut, CheckIfMyPaymentSentArgs, CoinBalance, Con
ValidatePaymentInput, VerificationResult, WaitForHTLCTxSpendArgs, WatcherOps, WeakSpawner, WithdrawError,
WithdrawFee, WithdrawFut, WithdrawRequest, WithdrawResult};
use async_trait::async_trait;
use bip32::DerivationPath;
use bitcrypto::{dhash160, sha256};
use chain::TransactionOutput;
use common::executor::{AbortableSystem, AbortedError, Timer};
Expand Down Expand Up @@ -1039,8 +1040,8 @@ impl MarketCoinOps for Qrc20Coin {
utxo_common::sign_message_hash(self.as_ref(), message)
}

fn sign_message(&self, message: &str) -> SignatureResult<String> {
utxo_common::sign_message(self.as_ref(), message)
fn sign_message(&self, message: &str, derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
utxo_common::sign_message(self.as_ref(), message, derivation_path)
}

fn verify_message(&self, signature_base64: &str, message: &str, address: &str) -> VerificationResult<bool> {
Expand Down
5 changes: 4 additions & 1 deletion mm2src/coins/siacoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::{coin_errors::MyAddressError, BalanceFut, CanRefundHtlc, CheckIfMyPay
ValidateFeeArgs, ValidateOtherPubKeyErr, ValidatePaymentInput, ValidatePaymentResult, VerificationResult,
WaitForHTLCTxSpendArgs, WatcherOps, WeakSpawner, WithdrawFut, WithdrawRequest};
use async_trait::async_trait;
use bip32::DerivationPath;
use common::executor::AbortedError;
pub use ed25519_dalek::{Keypair, PublicKey, SecretKey, Signature};
use futures::{FutureExt, TryFutureExt};
Expand Down Expand Up @@ -316,7 +317,9 @@ impl MarketCoinOps for SiaCoin {

fn sign_message_hash(&self, _message: &str) -> Option<[u8; 32]> { unimplemented!() }

fn sign_message(&self, _message: &str) -> SignatureResult<String> { unimplemented!() }
fn sign_message(&self, _message: &str, _derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
unimplemented!()
Comment thread
onur-ozkan marked this conversation as resolved.
Outdated
}

fn verify_message(&self, _signature: &str, _message: &str, _address: &str) -> VerificationResult<bool> {
unimplemented!()
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/tendermint/tendermint_coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3336,7 +3336,7 @@ impl MarketCoinOps for TendermintCoin {
None
}

fn sign_message(&self, _message: &str) -> SignatureResult<String> {
fn sign_message(&self, _message: &str, _derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
// TODO
MmError::err(SignatureError::InternalError("Not implemented".into()))
}
Expand Down
5 changes: 4 additions & 1 deletion mm2src/coins/tendermint/tendermint_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use crate::{big_decimal_from_sat_unsigned, utxo::sat_from_big_decimal, BalanceFu
ValidatePaymentInput, VerificationResult, WaitForHTLCTxSpendArgs, WatcherOps, WeakSpawner, WithdrawError,
WithdrawFut, WithdrawRequest};
use async_trait::async_trait;
use bip32::DerivationPath;
use bitcrypto::sha256;
use common::executor::abortable_queue::AbortableQueue;
use common::executor::{AbortableSystem, AbortedError};
Expand Down Expand Up @@ -275,7 +276,9 @@ impl MarketCoinOps for TendermintToken {

fn sign_message_hash(&self, message: &str) -> Option<[u8; 32]> { self.platform_coin.sign_message_hash(message) }

fn sign_message(&self, message: &str) -> SignatureResult<String> { self.platform_coin.sign_message(message) }
fn sign_message(&self, message: &str, derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
self.platform_coin.sign_message(message, derivation_path)
}

fn verify_message(&self, signature: &str, message: &str, address: &str) -> VerificationResult<bool> {
self.platform_coin.verify_message(signature, message, address)
Expand Down
5 changes: 4 additions & 1 deletion mm2src/coins/test_coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::{coin_errors::MyAddressError, BalanceFut, CanRefundHtlc, CheckIfMyPay
WatcherValidatePaymentInput, WatcherValidateTakerFeeInput, WeakSpawner, WithdrawFut, WithdrawRequest};
use crate::{DexFee, ToBytes, ValidateWatcherSpendInput};
use async_trait::async_trait;
use bip32::DerivationPath;
use common::executor::AbortedError;
use futures01::Future;
use keys::KeyPair;
Expand Down Expand Up @@ -69,7 +70,9 @@ impl MarketCoinOps for TestCoin {

fn sign_message_hash(&self, _message: &str) -> Option<[u8; 32]> { unimplemented!() }

fn sign_message(&self, _message: &str) -> SignatureResult<String> { unimplemented!() }
fn sign_message(&self, _message: &str, _derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
unimplemented!()
}

fn verify_message(&self, _signature: &str, _message: &str, _address: &str) -> VerificationResult<bool> {
unimplemented!()
Expand Down
6 changes: 3 additions & 3 deletions mm2src/coins/utxo/bch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1147,8 +1147,8 @@ impl MarketCoinOps for BchCoin {
utxo_common::sign_message_hash(self.as_ref(), message)
}

fn sign_message(&self, message: &str) -> SignatureResult<String> {
utxo_common::sign_message(self.as_ref(), message)
fn sign_message(&self, message: &str, derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
utxo_common::sign_message(self.as_ref(), message, derivation_path)
}

fn verify_message(&self, signature_base64: &str, message: &str, address: &str) -> VerificationResult<bool> {
Expand Down Expand Up @@ -1703,7 +1703,7 @@ mod bch_tests {
#[test]
fn test_sign_message() {
let (_ctx, coin) = tbch_coin_for_test();
let signature = coin.sign_message("test").unwrap();
let signature = coin.sign_message("test", None).unwrap();
assert_eq!(
signature,
"ILuePKMsycXwJiNDOT7Zb7TfIlUW7Iq+5ylKd15AK72vGVYXbnf7Gj9Lk9MFV+6Ub955j7MiAkp0wQjvuIoRPPA="
Expand Down
4 changes: 2 additions & 2 deletions mm2src/coins/utxo/qtum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,8 +770,8 @@ impl MarketCoinOps for QtumCoin {
utxo_common::sign_message_hash(self.as_ref(), message)
}

fn sign_message(&self, message: &str) -> SignatureResult<String> {
utxo_common::sign_message(self.as_ref(), message)
fn sign_message(&self, message: &str, _derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
utxo_common::sign_message(self.as_ref(), message, None)
}

fn verify_message(&self, signature_base64: &str, message: &str, address: &str) -> VerificationResult<bool> {
Expand Down
7 changes: 4 additions & 3 deletions mm2src/coins/utxo/slp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use crate::{BalanceFut, CheckIfMyPaymentSentArgs, CoinBalance, ConfirmPaymentInp
use async_trait::async_trait;
use base64::engine::general_purpose::STANDARD;
use base64::Engine;
use bip32::DerivationPath;
use bitcrypto::dhash160;
use chain::constants::SEQUENCE_FINAL;
use chain::{OutPoint, TransactionOutput};
Expand Down Expand Up @@ -1117,8 +1118,8 @@ impl MarketCoinOps for SlpToken {
utxo_common::sign_message_hash(self.as_ref(), message)
}

fn sign_message(&self, message: &str) -> SignatureResult<String> {
utxo_common::sign_message(self.as_ref(), message)
fn sign_message(&self, message: &str, derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
utxo_common::sign_message(self.as_ref(), message, derivation_path)
}

fn verify_message(&self, signature: &str, message: &str, address: &str) -> VerificationResult<bool> {
Expand Down Expand Up @@ -2167,7 +2168,7 @@ mod slp_tests {
let (_ctx, bch) = tbch_coin_for_test();
let token_id = H256::from("bb309e48930671582bea508f9a1d9b491e49b69be3d6f372dc08da2ac6e90eb7");
let fusd = SlpToken::new(4, "FUSD".into(), token_id, bch, 0).unwrap();
let signature = fusd.sign_message("test").unwrap();
let signature = fusd.sign_message("test", None).unwrap();
assert_eq!(
signature,
"ILuePKMsycXwJiNDOT7Zb7TfIlUW7Iq+5ylKd15AK72vGVYXbnf7Gj9Lk9MFV+6Ub955j7MiAkp0wQjvuIoRPPA="
Expand Down
28 changes: 25 additions & 3 deletions mm2src/coins/utxo/utxo_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2755,10 +2755,32 @@ pub fn sign_message_hash(coin: &UtxoCoinFields, message: &str) -> Option<[u8; 32
Some(dhash256(&stream.out()).take())
}

pub fn sign_message(coin: &UtxoCoinFields, message: &str) -> SignatureResult<String> {
pub fn sign_message(
coin: &UtxoCoinFields,
message: &str,
derivation_path: Option<DerivationPath>,
) -> SignatureResult<String> {
let message_hash = sign_message_hash(coin, message).ok_or(SignatureError::PrefixNotFound)?;
let private_key = coin.priv_key_policy.activated_key_or_err()?.private();
let signature = private_key.sign_compact(&H256::from(message_hash))?;
let signature = match derivation_path {
Some(derivation_path) => {
let privkey = coin
.priv_key_policy
.hd_wallet_derived_priv_key_or_err(&derivation_path)
.mm_err(|err| SignatureError::InvalidRequest(err.to_string()))?;
let private_key = Private {
prefix: coin.conf.wif_prefix,
secret: privkey,
compressed: true,
checksum_type: coin.conf.checksum_type,
};
private_key.sign_compact(&H256::from(message_hash))?
},
None => {
let private_key = coin.priv_key_policy.activated_key_or_err()?.private();
private_key.sign_compact(&H256::from(message_hash))?
Comment thread
onur-ozkan marked this conversation as resolved.
Outdated
},
};

Ok(STANDARD.encode(&*signature))
}

Expand Down
4 changes: 2 additions & 2 deletions mm2src/coins/utxo/utxo_standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,8 @@ impl MarketCoinOps for UtxoStandardCoin {
utxo_common::sign_message_hash(self.as_ref(), message)
}

fn sign_message(&self, message: &str) -> SignatureResult<String> {
utxo_common::sign_message(self.as_ref(), message)
fn sign_message(&self, message: &str, derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
utxo_common::sign_message(self.as_ref(), message, derivation_path)
}

fn verify_message(&self, signature_base64: &str, message: &str, address: &str) -> VerificationResult<bool> {
Expand Down
4 changes: 2 additions & 2 deletions mm2src/coins/utxo/utxo_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4539,7 +4539,7 @@ fn test_sign_verify_message() {
);

let message = "test";
let signature = coin.sign_message(message).unwrap();
let signature = coin.sign_message(message, None).unwrap();
assert_eq!(
signature,
"HzetbqVj9gnUOznon9bvE61qRlmjH5R+rNgkxu8uyce3UBbOu+2aGh7r/GGSVFGZjRnaYC60hdwtdirTKLb7bE4="
Expand All @@ -4560,7 +4560,7 @@ fn test_sign_verify_message_segwit() {
);

let message = "test";
let signature = coin.sign_message(message).unwrap();
let signature = coin.sign_message(message, None).unwrap();
assert_eq!(
signature,
"HzetbqVj9gnUOznon9bvE61qRlmjH5R+rNgkxu8uyce3UBbOu+2aGh7r/GGSVFGZjRnaYC60hdwtdirTKLb7bE4="
Expand Down
3 changes: 2 additions & 1 deletion mm2src/coins/z_coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use crate::{BalanceError, BalanceFut, CheckIfMyPaymentSentArgs, CoinBalance, Con
WatcherOps, WeakSpawner, WithdrawError, WithdrawFut, WithdrawRequest};

use async_trait::async_trait;
use bip32::DerivationPath;
use bitcrypto::dhash256;
use chain::constants::SEQUENCE_FINAL;
use chain::{Transaction as UtxoTx, TransactionOutput};
Expand Down Expand Up @@ -1143,7 +1144,7 @@ impl MarketCoinOps for ZCoin {

fn sign_message_hash(&self, _message: &str) -> Option<[u8; 32]> { None }

fn sign_message(&self, _message: &str) -> SignatureResult<String> {
fn sign_message(&self, _message: &str, _derivation_path: Option<DerivationPath>) -> SignatureResult<String> {
MmError::err(SignatureError::InvalidRequest(
"Message signing is not supported by the given coin type".to_string(),
))
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enable-sia = ["coins/enable-sia", "coins_activation/enable-sia"]
sepolia-maker-swap-v2-tests = []
sepolia-taker-swap-v2-tests = []
test-ext-api = ["trading_api/test-ext-api"]
new-db-arch = [] # A temporary feature to integrate the new db architecture incrementally
new-db-arch = ["mm2_core/new-db-arch"] # A temporary feature to integrate the new db architecture incrementally

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this change is up #2398. you could omit it here if u want (to avoid conflicts)


[dependencies]
async-std = { version = "1.5", features = ["unstable"] }
Expand Down
4 changes: 2 additions & 2 deletions mm2src/mm2_main/tests/mm2_tests/bch_and_slp_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ fn test_sign_verify_message_bch() {
let electrum: Json = json::from_str(&electrum.1).unwrap();
log!("{:?}", electrum);

let response = block_on(sign_message(&mm, "BCH"));
let response = block_on(sign_message(&mm, "BCH", None));
let response: RpcV2Response<SignatureResponse> = json::from_value(response).unwrap();
let response = response.result;

Expand Down Expand Up @@ -586,7 +586,7 @@ fn test_sign_verify_message_slp() {
let enable_usdf = block_on(enable_slp(&mm, "USDF"));
log!("enable_usdf: {:?}", enable_usdf);

let response = block_on(sign_message(&mm, "USDF"));
let response = block_on(sign_message(&mm, "USDF", None));
let response: RpcV2Response<SignatureResponse> = json::from_value(response).unwrap();
let response = response.result;

Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/tests/mm2_tests/lightning_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ fn test_sign_verify_message_lightning() {
block_on(enable_electrum(&mm, "tBTC-TEST-segwit", false, T_BTC_ELECTRUMS));
block_on(enable_lightning(&mm, "tBTC-TEST-lightning", 600));

let response = block_on(sign_message(&mm, "tBTC-TEST-lightning"));
let response = block_on(sign_message(&mm, "tBTC-TEST-lightning", None));
let response: RpcV2Response<SignatureResponse> = json::from_value(response).unwrap();
let response = response.result;

Expand Down
Loading