Skip to content

Commit

Permalink
review revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
lavindir committed Nov 2, 2023
1 parent 904ffb5 commit 05b0e58
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
15 changes: 10 additions & 5 deletions crates/sui-json-rpc-types/src/sui_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,15 +684,20 @@ impl TryFrom<TransactionEffects> for SuiTransactionBlockEffects {

fn owned_objref_string(obj: &OwnedObjectRef) -> String {
format!(
" ┌──\n │ ID: {} \n │ Owner: {} \n │ Version: {:?} \n │ Digest: {}\n └──",
obj.reference.object_id, obj.owner, obj.reference.version, obj.reference.digest
" ┌──\n │ ID: {} \n │ Owner: {} \n │ Version: {} \n │ Digest: {}\n └──",
obj.reference.object_id,
obj.owner,
u64::from(obj.reference.version),
obj.reference.digest
)
}

fn objref_string(obj: &SuiObjectRef) -> String {
format!(
" ┌──\n │ ID: {} \n │ Version: {:?} \n │ Digest: {}\n └──",
obj.object_id, obj.version, obj.digest
" ┌──\n │ ID: {} \n │ Version: {} \n │ Digest: {}\n └──",
obj.object_id,
u64::from(obj.version),
obj.digest
)
}

Expand Down Expand Up @@ -771,7 +776,7 @@ impl Display for SuiTransactionBlockEffects {
if !dependencies.is_empty() {
builder.push_record(vec![format!("\nTransaction Dependencies:")]);
for dependency in dependencies {
builder.push_record(vec![format!(" {}\n", dependency)]);
builder.push_record(vec![format!(" {}", dependency)]);
}
}

Expand Down
28 changes: 7 additions & 21 deletions crates/sui/src/client_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,10 +616,6 @@ pub enum SuiClientCommands {
/// The digest of the transaction to replay
#[arg(long, short)]
tx_digest: String,

/// (Optional) The rpc url for a fullnode to use for fetching the transaction dependencies
#[arg(long = "rpc")]
rpc_url: Option<String>,
},

/// Replay transactions listed in a file.
Expand All @@ -632,10 +628,6 @@ pub enum SuiClientCommands {
/// If an error is encountered during a transaction, this specifies whether to terminate or continue
#[arg(long, short)]
terminate_early: bool,

/// (Optional) The rpc url for a fullnode to use for fetching the transaction dependencies
#[arg(long = "rpc")]
rpc_url: Option<String>,
},

/// Replay all transactions in a range of checkpoints.
Expand All @@ -652,10 +644,6 @@ pub enum SuiClientCommands {
/// If an error is encountered during a transaction, this specifies whether to terminate or continue
#[arg(long, short)]
terminate_early: bool,

/// (Optional) The rpc url for a fullnode to use for fetching the transaction dependencies
#[arg(long = "rpc")]
rpc_url: Option<String>,
},
}

Expand All @@ -665,21 +653,20 @@ impl SuiClientCommands {
context: &mut WalletContext,
) -> Result<SuiClientCommandResult, anyhow::Error> {
let ret = Ok(match self {
SuiClientCommands::ReplayTransaction { rpc_url, tx_digest } => {
SuiClientCommands::ReplayTransaction { tx_digest } => {
let cmd = ReplayToolCommand::ReplayTransaction {
tx_digest,
show_effects: true,
diag: false,
executor_version_override: None,
protocol_version_override: None,
};
let rpc = rpc_url.unwrap_or(context.config.get_active_env()?.rpc.clone());
let rpc = context.config.get_active_env()?.rpc.clone();
let _command_result =
sui_replay::execute_replay_command(Some(rpc), false, false, None, cmd).await;
sui_replay::execute_replay_command(Some(rpc), false, false, None, cmd).await?;
SuiClientCommandResult::ReplayTransaction
}
SuiClientCommands::ReplayBatch {
rpc_url,
path,
terminate_early,
} => {
Expand All @@ -688,13 +675,12 @@ impl SuiClientCommands {
terminate_early,
batch_size: 16,
};
let rpc = rpc_url.unwrap_or(context.config.get_active_env()?.rpc.clone());
let rpc = context.config.get_active_env()?.rpc.clone();
let _command_result =
sui_replay::execute_replay_command(Some(rpc), false, false, None, cmd).await;
sui_replay::execute_replay_command(Some(rpc), false, false, None, cmd).await?;
SuiClientCommandResult::ReplayBatch
}
SuiClientCommands::ReplayCheckpoints {
rpc_url,
start,
end,
terminate_early,
Expand All @@ -705,9 +691,9 @@ impl SuiClientCommands {
terminate_early,
max_tasks: 16,
};
let rpc = rpc_url.unwrap_or(context.config.get_active_env()?.rpc.clone());
let rpc = context.config.get_active_env()?.rpc.clone();
let _command_result =
sui_replay::execute_replay_command(Some(rpc), false, false, None, cmd).await;
sui_replay::execute_replay_command(Some(rpc), false, false, None, cmd).await?;
SuiClientCommandResult::ReplayCheckpoints
}
SuiClientCommands::Addresses => {
Expand Down

0 comments on commit 05b0e58

Please sign in to comment.