Skip to content

Commit

Permalink
chore: Add doc comments and use &str in update_admin
Browse files Browse the repository at this point in the history
  • Loading branch information
jawoznia committed Oct 11, 2024
1 parent cfca3c6 commit e847bc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions sylvia/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Module providing utilities to build and use sylvia contracts.
use cosmwasm_std::{Binary, Coin, Deps, DepsMut, Empty, Env, MessageInfo, WasmMsg};
#[cfg(feature = "sv_replies")]
use cosmwasm_std::{Event, MsgResponse};
Expand Down Expand Up @@ -431,17 +432,20 @@ impl<'a, Contract: ?Sized> Remote<'a, Contract> {
}
}

/// Creates a new instance of [ExecutorBuilder] from underlying contract address.
pub fn executor(&self) -> ExecutorBuilder<(EmptyExecutorBuilderState, Contract)> {
ExecutorBuilder::<(EmptyExecutorBuilderState, Contract)>::new(&self.addr)
}

pub fn update_admin(&self, new_admin: String) -> WasmMsg {
/// Creates a new instance of [WasmMsg::UpdateAdmin] from underlying contract address and provided admin address.
pub fn update_admin(&self, new_admin: &str) -> WasmMsg {
WasmMsg::UpdateAdmin {
contract_addr: self.addr.to_string(),
admin: new_admin,
admin: new_admin.to_string(),
}
}

/// Creates a new instance of [WasmMsg::ClearAdmin] from underlying contract address.
pub fn clear_admin(&self) -> WasmMsg {
WasmMsg::ClearAdmin {
contract_addr: self.addr.to_string(),
Expand Down
2 changes: 1 addition & 1 deletion sylvia/tests/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ pub mod manager {
.remote_counter
.load(ctx.deps.storage)?
.interface_remote
.update_admin(new_admin);
.update_admin(&new_admin);
let resp = Response::new().add_message(wasm);
Ok(resp)
}
Expand Down

0 comments on commit e847bc3

Please sign in to comment.