From 70272b72f538f749efd1588a1dc02bcbb5473529 Mon Sep 17 00:00:00 2001 From: 0o-de-lally <1364012+0o-de-lally@users.noreply.github.com> Date: Wed, 27 Oct 2021 21:21:08 +0000 Subject: [PATCH] change create from auth api --- ol/txs/src/commands/create_account_cmd.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ol/txs/src/commands/create_account_cmd.rs b/ol/txs/src/commands/create_account_cmd.rs index e1abe66be8..247ad49424 100644 --- a/ol/txs/src/commands/create_account_cmd.rs +++ b/ol/txs/src/commands/create_account_cmd.rs @@ -2,10 +2,7 @@ #![allow(clippy::never_loop)] -use crate::{ - entrypoint, - submit_tx::{maybe_submit, tx_params_wrapper}, -}; +use crate::{entrypoint, submit_tx::{TxParams, maybe_submit, tx_params_wrapper}}; use abscissa_core::{Command, Options, Runnable}; use anyhow::Error; use diem_transaction_builder::stdlib as transaction_builder; @@ -31,8 +28,10 @@ impl Runnable for CreateAccountCmd { exit(1); }, }; - - match create_from_auth_and_coin(authkey, self.coins, entry_args.no_send, entry_args.save_path) { + let tx_params = tx_params_wrapper(TxType::Mgmt).unwrap(); + + + match create_from_auth_and_coin(authkey, self.coins, tx_params, entry_args.no_send, entry_args.save_path) { Ok(_) => println!("Success: Account created for authkey: {}", authkey), Err(e) => { println!("ERROR: could not create account, message: {}", &e.to_string()); @@ -43,8 +42,7 @@ impl Runnable for CreateAccountCmd { } /// create an account by sending coin to it -pub fn create_from_auth_and_coin(authkey: AuthenticationKey, coins: u64, no_send: bool, save_path: Option) -> Result{ - let tx_params = tx_params_wrapper(TxType::Mgmt).unwrap(); +pub fn create_from_auth_and_coin(authkey: AuthenticationKey, coins: u64, tx_params: TxParams, no_send: bool, save_path: Option) -> Result{ let account = authkey.derived_address(); let prefix = authkey.prefix(); @@ -56,4 +54,5 @@ pub fn create_from_auth_and_coin(authkey: AuthenticationKey, coins: u64, no_send ); maybe_submit(script, &tx_params, no_send, save_path) -} \ No newline at end of file +} +