user99556: I simply want to unit test that my lock/unlock process works well on an encrypted wallet.
What would be the easiest command I could send (that doesn't involve sending coins) to actually validate if my wallet is locked or unlocked? Can I try to sign a dummy transaction for example?

user48884: You can sign a message using the signmessage command. Note that this only works if you are using legacy addresses (Bitcoin Core currently defaults to p2sh-segwit addresses which cannot be used to sign a message). You an get a legacy address using:
bitcoin-cli getnewaddres "" legacy

If the wallet is locked, you won't be able to sign a message.

99556: <p>I simply want to unit test that my lock/unlock process works well on an encrypted wallet.</p>

<p>What would be the easiest command I could send (that doesn't involve sending coins) to actually validate if my wallet is locked or unlocked? Can I try to sign a dummy transaction for example?</p>
 48884: <p>You can sign a message using the <code>signmessage</code> command. Note that this only works if you are using <code>legacy</code> addresses (Bitcoin Core currently defaults to <code>p2sh-segwit</code> addresses which cannot be used to sign a message). You an get a legacy address using:</p>

<pre><code>bitcoin-cli getnewaddres "" legacy
</code></pre>

<p>If the wallet is locked, you won't be able to sign a message.</p>
