Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added public key accessor on wallet #499

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 @@
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 @@
self.options.clone()
}

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

Check warning on line 129 in cw-orch-daemon/src/senders/cosmos.rs

View check run for this annotation

Codecov / codecov/patch

cw-orch-daemon/src/senders/cosmos.rs#L127-L129

Added lines #L127 - L129 were not covered by tests

/// 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
Loading