Skip to content

Commit

Permalink
fix panic when executing "account show"
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjiao committed Nov 20, 2024
1 parent 96690f2 commit 248b90f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/starcoin/src/account/show_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ impl CommandAction for ShowCommand {

let chain_state_reader = rpc_client.state_reader(opt.state_root.unwrap_or_default())?;
let sequence_number = chain_state_reader
.get_account_resource(*account.address())?
.sequence_number();
.get_account_resource(*account.address())
.map(|r| r.sequence_number())
.ok();

let resources = rpc_client.state_list_resource(
*account.address(),
Expand Down Expand Up @@ -89,7 +90,7 @@ impl CommandAction for ShowCommand {
Ok(AccountWithStateView {
auth_key: auth_key.to_encoded_string()?,
account,
sequence_number: Some(sequence_number),
sequence_number,
balances,
})
}
Expand Down

0 comments on commit 248b90f

Please sign in to comment.