Skip to content

Commit

Permalink
Added public key accessor on wallet (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayanski authored Sep 30, 2024
1 parent 776a34a commit 957cfb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Adds an `upload_wasm` function to CosmosSender to upload wasm code associated to no Contract structure
- Update syn to 2.0
- Added cw-plus orchestrator interface to the repo. Pacing the way for more integrations inside this repository in the future
- Add easier way to get PublicKey for `cw_orch_daemon::Wallet`

### Breaking

Expand Down
6 changes: 5 additions & 1 deletion cw-orch-daemon/src/senders/cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use cosmrs::{
crypto::secp256k1::SigningKey,
proto::{cosmos::authz::v1beta1::MsgExec, traits::Message},
tendermint::chain::Id,
tx::{self, ModeInfo, Msg, Raw, SignDoc, SignMode, SignerInfo},
tx::{self, ModeInfo, Msg, Raw, SignDoc, SignMode, SignerInfo, SignerPublicKey},
AccountId, Any,
};
use cosmwasm_std::{coin, Addr, Coin};
Expand Down Expand Up @@ -124,6 +124,10 @@ impl Wallet {
self.options.clone()
}

pub fn public_key(&self) -> Option<SignerPublicKey> {
self.private_key.get_signer_public_key(&self.secp)
}

/// Replaces the private key that the [CosmosSender] is using with key derived from the provided 24-word mnemonic.
/// If you want more control over the derived private key, use [Self::set_private_key]
pub fn set_mnemonic(&mut self, mnemonic: impl Into<String>) -> Result<(), DaemonError> {
Expand Down

0 comments on commit 957cfb7

Please sign in to comment.