Skip to content

Commit

Permalink
[wallet] - rename transfer to transfer-coin (#1762)
Browse files Browse the repository at this point in the history
* rename transfer to transfer-coin

* address PR comment

* improve transfer non coin error message

* improve transfer non coin error message
  • Loading branch information
patrickkuo authored May 4, 2022
1 parent 69a7e8f commit 580f8ff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion sui/src/bin/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async fn handle_command(
.collect::<Vec<_>>();
cache.insert(CacheKey::new("object", "--id"), objects.clone());
cache.insert(CacheKey::flag("--gas"), objects.clone());
cache.insert(CacheKey::flag("--object-id"), objects);
cache.insert(CacheKey::flag("--coin-object-id"), objects);
}
_ => {}
}
Expand Down
6 changes: 3 additions & 3 deletions sui/src/unit_tests/cli_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ async fn test_gas_command() -> Result<(), anyhow::Error> {
// Send an object
WalletCommands::Transfer {
to: recipient,
object_id: object_to_send,
coin_object_id: object_to_send,
gas: Some(object_id),
gas_budget: 50000,
}
Expand Down Expand Up @@ -905,7 +905,7 @@ async fn test_native_transfer() -> Result<(), anyhow::Error> {
let resp = WalletCommands::Transfer {
gas: Some(gas_obj_id),
to: recipient,
object_id: obj_id,
coin_object_id: obj_id,
gas_budget: 50000,
}
.execute(&mut context)
Expand Down Expand Up @@ -999,7 +999,7 @@ async fn test_native_transfer() -> Result<(), anyhow::Error> {
let resp = WalletCommands::Transfer {
gas: None,
to: recipient,
object_id: obj_id,
coin_object_id: obj_id,
gas_budget: 50000,
}
.execute(&mut context)
Expand Down
10 changes: 5 additions & 5 deletions sui/src/wallet_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@ pub enum WalletCommands {
gas_budget: u64,
},

/// Transfer an object
#[clap(name = "transfer")]
/// Transfer coin object
#[clap(name = "transfer-coin")]
Transfer {
/// Recipient address
#[clap(long, parse(try_from_str = decode_bytes_hex))]
to: SuiAddress,

/// Object to transfer, in 20 bytes Hex string
/// Coin to transfer, in 20 bytes Hex string
#[clap(long)]
object_id: ObjectID,
coin_object_id: ObjectID,

/// ID of the gas object for gas payment, in 20 bytes Hex string
/// If not provided, a gas object with at least gas_budget value will be selected
Expand Down Expand Up @@ -304,7 +304,7 @@ impl WalletCommands {

WalletCommands::Transfer {
to,
object_id,
coin_object_id: object_id,
gas,
gas_budget,
} => {
Expand Down
4 changes: 2 additions & 2 deletions sui_types/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub enum SuiError {
LockErrors { errors: Vec<SuiError> },
#[error("Attempt to transfer an object that's not owned.")]
TransferUnownedError,
#[error("Attempt to transfer an object that's not a coin.")]
#[error("Attempt to transfer an object that's not a coin. Object transfer must be done using a distinct Move function call.")]
TransferNonCoinError,
#[error("A move package is expected, instead a move object is passed: {object_id}")]
MoveObjectAsPackage { object_id: ObjectID },
Expand All @@ -62,7 +62,7 @@ pub enum SuiError {
UnsupportedSharedObjectError,
#[error("Object used as shared is not shared.")]
NotSharedObjectError,
#[error("An object that's owned by another object cannot be deleted or wrapped. It must be transerred to an account address first before deletion")]
#[error("An object that's owned by another object cannot be deleted or wrapped. It must be transferred to an account address first before deletion")]
DeleteObjectOwnedObject,
#[error("The shared locks for this transaction have not yet been set.")]
SharedObjectLockNotSetObject,
Expand Down

1 comment on commit 580f8ff

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bench results

�[0m�[0m�[1m�[32m Finished�[0m release [optimized] target(s) in 0.41s
�[0m�[0m�[1m�[32m Running�[0m target/release/bench microbench throughput
�[2m2022-05-04T19:50:51.680389Z�[0m �[32m INFO�[0m �[2msui::benchmark�[0m�[2m:�[0m benchmark : Benchmark { committee_size: 1, send_timeout_us: 400000000, recv_timeout_us: 400000000, buffer_size: 65000, tcp_connections: 0, db_cpus: 1, use_native: false, batch_size: 2000, running_mode: SingleValidatorThread, working_dir: None, bench_type: MicroBenchmark { host: "127.0.0.1", port: 9555, type_: Throughput { num_transactions: 100000 } } }
�[2m2022-05-04T19:50:51.681241Z�[0m �[32m INFO�[0m �[2msui::benchmark::validator_preparer�[0m�[2m:�[0m authority address hex: B9C80164C724176B47596975BB7CD75BB9FEE8F7
�[2m2022-05-04T19:50:51.681337Z�[0m �[32m INFO�[0m �[2msui::benchmark::validator_preparer�[0m�[2m:�[0m Open database on path: "/tmp/DB_D12FF08DCFDA972466BAD58B206C54AF7748764F"
�[2m2022-05-04T19:50:52.922916Z�[0m �[32m INFO�[0m �[2msui::benchmark::validator_preparer�[0m�[2m:�[0m Spawning a validator thread...
�[2m2022-05-04T19:50:52.923783Z�[0m �[32m INFO�[0m �[2msui_core::authority_server�[0m�[2m:�[0m Listening to TCP traffic on 127.0.0.1:9555
Throughout: 35049.632031438116 tps

Please sign in to comment.