Skip to content

Commit

Permalink
feat: add pay amount field to tx_execute (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangush authored Nov 2, 2024
1 parent 40fa326 commit d12343a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/cli/src/handler/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async fn handshake(args: HandshakeRequest, config: Config) -> Result<String> {
2000000,
&config.tx_sender,
json!(res),
"11000untrn",
"0untrn"
)
.await
.map_err(|err| eyre!(Box::new(err)))?// TODO: change
Expand Down Expand Up @@ -106,7 +106,7 @@ async fn handshake(args: HandshakeRequest, config: Config) -> Result<String> {
2000000,
&config.tx_sender,
json!(res),
"11000untrn",
"0untrn"
)
.await
.map_err(|err| eyre!(Box::new(err)))? // todo change
Expand Down
13 changes: 10 additions & 3 deletions crates/utils/cw-client/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,23 @@ impl CwClient for CliClient {
gas: u64,
sender: &str,
msg: M,
fees: &str,
pay_amount: &str,
) -> Result<String, Self::Error> {
let gas_amount = match gas {
0 => "auto",
_ => &gas.to_string(),
};

let mut command = self.new_command()?;
let command = command
.args(["--node", self.url.as_str()])
.args(["--chain-id", chain_id.as_ref()])
.args(["tx", "wasm"])
.args(["execute", contract.as_ref(), &msg.to_string()])
.args(["--gas", &gas.to_string()])
.args(["--fees", fees])
.args(["--amount", pay_amount])
.args(["--gas", gas_amount])
.args(["--gas-adjustment", "1.3"])
.args(["--gas-prices", "0.025untrn"])
.args(["--from", sender])
.args(["--output", "json"])
.arg("-y");
Expand Down
4 changes: 2 additions & 2 deletions crates/utils/cw-client/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl CwClient for GrpcClient {
gas: u64,
_sender: &str,
msg: M,
_fees: &str,
_pay_amount: &str,
) -> Result<String, Self::Error> {
let tm_pubkey = self.sk.public_key();
let sender = tm_pubkey
Expand Down Expand Up @@ -257,7 +257,7 @@ mod tests {
2000000,
"/* unused since we're getting the account from the sk */",
json!([]),
"11000untrn",
"0untrn",
)
.await?;
println!("{}", tx_hash);
Expand Down
2 changes: 1 addition & 1 deletion crates/utils/cw-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub trait CwClient {
gas: u64,
sender: &str,
msg: M,
fees: &str,
pay_amount: &str,
) -> Result<String, Self::Error>;

fn deploy<M: ToString>(
Expand Down

0 comments on commit d12343a

Please sign in to comment.