Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianmarco Fraccaroli committed Feb 7, 2023
1 parent 44b3170 commit aeca53c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,7 @@ pub mod args {
const DECRYPT: ArgFlag = flag("decrypt");
const DONT_ARCHIVE: ArgFlag = flag("dont-archive");
const DRY_RUN_TX: ArgFlag = flag("dry-run");
const DUMP_TX: ArgFlag = flag("dump-tx");
const OFFLINE_TX: ArgFlag = flag("offline-tx");
const EPOCH: ArgOpt<Epoch> = arg_opt("epoch");
const FORCE: ArgFlag = flag("force");
const DONT_PREFETCH_WASM: ArgFlag = flag("dont-prefetch-wasm");
Expand Down Expand Up @@ -2858,7 +2858,7 @@ pub mod args {
/// The max amount of gas used to process tx
pub gas_limit: GasLimit,
/// Dump the signing tx to file
pub dump_tx: bool,
pub offline_tx: bool,
/// Sign the tx with the key for the given alias from your wallet
pub signing_keys: Vec<WalletKeypair>,
/// Sign the tx with the keypair of the public key of the given address
Expand All @@ -2880,7 +2880,7 @@ pub mod args {
fee_amount: self.fee_amount,
fee_token: ctx.get(&self.fee_token),
gas_limit: self.gas_limit.clone(),
dump_tx: self.dump_tx,
offline_tx: self.offline_tx,
signing_keys: self
.signing_keys
.iter()
Expand Down Expand Up @@ -2926,7 +2926,7 @@ pub mod args {
"The maximum amount of gas needed to run transaction",
),
)
.arg(DUMP_TX.def().about("Dump tx to file."))
.arg(OFFLINE_TX.def().about("Dump tx to file."))
.arg(
SIGNING_KEYS
.def()
Expand Down Expand Up @@ -2958,7 +2958,7 @@ pub mod args {
let fee_amount = GAS_AMOUNT.parse(matches);
let fee_token = GAS_TOKEN.parse(matches);
let gas_limit = GAS_LIMIT.parse(matches).into();
let dump_tx = DUMP_TX.parse(matches);
let offline_tx = OFFLINE_TX.parse(matches);
let signing_keys = SIGNING_KEYS.parse(matches);
let signers = SIGNERS.parse(matches);
let signatures = SIGNATURES.parse(matches);
Expand All @@ -2973,7 +2973,7 @@ pub mod args {
gas_limit,
signing_keys,
signers,
dump_tx,
offline_tx,
signatures,
}
}
Expand Down
4 changes: 2 additions & 2 deletions apps/src/lib/client/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,7 @@ pub async fn submit_transfer(mut ctx: Context, args: args::TxTransfer) {
// signer. Also, if the transaction is shielded, redact the amount and token
// types by setting the transparent value to 0 and token type to a constant.
// This has no side-effect because transaction is to self.
let (default_signer, amount, token) = if args.tx.dump_tx {
let (default_signer, amount, token) = if args.tx.offline_tx {
(TxSigningKey::None, args.amount, parsed_args.token.clone())
} else if source == masp_addr && target == masp_addr {
// TODO Refactor me, we shouldn't rely on any specific token here.
Expand Down Expand Up @@ -2747,7 +2747,7 @@ async fn process_tx(
default_signers: Vec<TxSigningKey>,
#[cfg(not(feature = "mainnet"))] requires_pow: bool,
) -> (Context, Vec<Address>) {
if args.dump_tx {
if args.offline_tx {
// TODO: use async version of fs
tokio::fs::write("code.tx", tx.clone().code)
.await
Expand Down
2 changes: 1 addition & 1 deletion apps/src/lib/client/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct ParsedTxArgs {
/// The max amount of gas used to process tx
pub gas_limit: GasLimit,
/// Dump the signing tx to file
pub dump_tx: bool,
pub offline_tx: bool,
/// Sign the tx with the key for the given alias from your wallet
pub signing_keys: Vec<key::common::SecretKey>,
/// Sign the tx with the keypair of the public key of the given address
Expand Down

0 comments on commit aeca53c

Please sign in to comment.