diff --git a/crates/aptos/src/common/init.rs b/crates/aptos/src/common/init.rs index fc5f10b0f9639..e9459b5f49207 100644 --- a/crates/aptos/src/common/init.rs +++ b/crates/aptos/src/common/init.rs @@ -114,7 +114,7 @@ impl CliCommand<()> for InitTool { network } else { eprintln!( - "Choose network from [devnet, testnet, local, custom | defaults to devnet]" + "Choose network from [devnet, testnet, local, custom | defaults to devnet]. For testnet, start over and run movement init --skip-faucet" ); let input = read_line("network")?; let input = input.trim(); @@ -126,6 +126,12 @@ impl CliCommand<()> for InitTool { } }; + if network == Network::Testnet && !self.skip_faucet { + return Err(CliError::CommandArgumentError(format!( + "For testnet, start over and run movement init --skip-faucet" + ))); + } + // Ensure the config contains the network used profile_config.network = Some(network); @@ -349,7 +355,9 @@ impl CliCommand<()> for InitTool { .profile_name() .unwrap_or(DEFAULT_PROFILE); eprintln!( - "\n---\nMovement CLI is now set up for account {} as profile {}!\n See the account here: {}\n Run `movement --help` for more information about commands", + "\n---\nMovement CLI is now set up for account {} as profile {}!\n See the account here: {}\n + Run `movement --help` for more information about commands. \n + Visit https://faucet.movementlabs.xyz to use the testnet faucet.", address, profile_name, explorer_account_link(address, Some(network)) diff --git a/ecosystem/indexer-grpc/indexer-grpc-fullnode/src/convert.rs b/ecosystem/indexer-grpc/indexer-grpc-fullnode/src/convert.rs index 696b81014c66a..57e7bc9f73030 100644 --- a/ecosystem/indexer-grpc/indexer-grpc-fullnode/src/convert.rs +++ b/ecosystem/indexer-grpc/indexer-grpc-fullnode/src/convert.rs @@ -337,29 +337,32 @@ pub fn convert_write_set_change(change: &WriteSetChange) -> transaction::WriteSe )), }, WriteSetChange::DeleteTableItem(delete_table_item) => { - let data = delete_table_item.data.as_ref().unwrap_or_else(|| { - panic!( - "Could not extract data from DeletedTableItem '{:?}' with handle '{:?}'", - delete_table_item, - delete_table_item.handle.to_string() - ) - }); + let data = delete_table_item.data.as_ref(); + // .unwrap_or_else(|| { + // panic!( + // "Could not extract data from DeletedTableItem '{:?}' with handle '{:?}'", + // delete_table_item, + // delete_table_item.handle.to_string() + // ) + // }); transaction::WriteSetChange { r#type: transaction::write_set_change::Type::DeleteTableItem as i32, - change: Some(transaction::write_set_change::Change::DeleteTableItem( - transaction::DeleteTableItem { - state_key_hash: convert_hex_string_to_bytes( - &delete_table_item.state_key_hash, - ), - handle: delete_table_item.handle.to_string(), - key: delete_table_item.key.to_string(), - data: Some(transaction::DeleteTableData { - key: data.key.to_string(), - key_type: data.key_type.clone(), - }), - }, - )), + change: data.map(|data| { + transaction::write_set_change::Change::DeleteTableItem( + transaction::DeleteTableItem { + state_key_hash: convert_hex_string_to_bytes( + &delete_table_item.state_key_hash, + ), + handle: delete_table_item.handle.to_string(), + key: delete_table_item.key.to_string(), + data: Some(transaction::DeleteTableData { + key: data.key.to_string(), + key_type: data.key_type.clone(), + }), + }, + ) + }), } }, WriteSetChange::WriteModule(write_module) => transaction::WriteSetChange { @@ -381,10 +384,11 @@ pub fn convert_write_set_change(change: &WriteSetChange) -> transaction::WriteSe r#type: Some(convert_move_struct_tag(&write_resource.data.typ)), type_str: write_resource.data.typ.to_string(), data: serde_json::to_string(&write_resource.data.data).unwrap_or_else(|_| { - panic!( - "Could not convert move_resource data to json '{:?}'", - write_resource.data - ) + "{}".to_string() + // panic!( + // "Could not convert move_resource data to json '{:?}'", + // write_resource.data + // ) }), }, )),