Skip to content

Commit d12343a

Browse files
authored
feat: add pay amount field to tx_execute (#275)
1 parent 40fa326 commit d12343a

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

crates/cli/src/handler/handshake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async fn handshake(args: HandshakeRequest, config: Config) -> Result<String> {
5656
2000000,
5757
&config.tx_sender,
5858
json!(res),
59-
"11000untrn",
59+
"0untrn"
6060
)
6161
.await
6262
.map_err(|err| eyre!(Box::new(err)))?// TODO: change
@@ -106,7 +106,7 @@ async fn handshake(args: HandshakeRequest, config: Config) -> Result<String> {
106106
2000000,
107107
&config.tx_sender,
108108
json!(res),
109-
"11000untrn",
109+
"0untrn"
110110
)
111111
.await
112112
.map_err(|err| eyre!(Box::new(err)))? // todo change

crates/utils/cw-client/src/cli.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,23 @@ impl CwClient for CliClient {
152152
gas: u64,
153153
sender: &str,
154154
msg: M,
155-
fees: &str,
155+
pay_amount: &str,
156156
) -> Result<String, Self::Error> {
157+
let gas_amount = match gas {
158+
0 => "auto",
159+
_ => &gas.to_string(),
160+
};
161+
157162
let mut command = self.new_command()?;
158163
let command = command
159164
.args(["--node", self.url.as_str()])
160165
.args(["--chain-id", chain_id.as_ref()])
161166
.args(["tx", "wasm"])
162167
.args(["execute", contract.as_ref(), &msg.to_string()])
163-
.args(["--gas", &gas.to_string()])
164-
.args(["--fees", fees])
168+
.args(["--amount", pay_amount])
169+
.args(["--gas", gas_amount])
170+
.args(["--gas-adjustment", "1.3"])
171+
.args(["--gas-prices", "0.025untrn"])
165172
.args(["--from", sender])
166173
.args(["--output", "json"])
167174
.arg("-y");

crates/utils/cw-client/src/grpc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl CwClient for GrpcClient {
8888
gas: u64,
8989
_sender: &str,
9090
msg: M,
91-
_fees: &str,
91+
_pay_amount: &str,
9292
) -> Result<String, Self::Error> {
9393
let tm_pubkey = self.sk.public_key();
9494
let sender = tm_pubkey
@@ -257,7 +257,7 @@ mod tests {
257257
2000000,
258258
"/* unused since we're getting the account from the sk */",
259259
json!([]),
260-
"11000untrn",
260+
"0untrn",
261261
)
262262
.await?;
263263
println!("{}", tx_hash);

crates/utils/cw-client/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub trait CwClient {
3737
gas: u64,
3838
sender: &str,
3939
msg: M,
40-
fees: &str,
40+
pay_amount: &str,
4141
) -> Result<String, Self::Error>;
4242

4343
fn deploy<M: ToString>(

0 commit comments

Comments
 (0)