Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate move repo #4188

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f69b7f4
using aptos-core thirdparty move
simonjiao Aug 14, 2024
d19ffe3
fix compiling starcoin-gas-algebra-ext
simonjiao Aug 14, 2024
99dcd00
rename type_params to type_args
simonjiao Aug 14, 2024
1a25a52
fix starcoin-vm-types
simonjiao Aug 14, 2024
2a0a7d3
update starcoin-gas-algebra-ext/starcoin-vm-types
simonjiao Aug 14, 2024
3624adc
fix starcoin-gas
simonjiao Aug 14, 2024
930a2e5
fix starcoin-abi-types
simonjiao Aug 14, 2024
5837af8
fix starcoin-resource-viewer
simonjiao Aug 14, 2024
ae2d660
fix starcoin-vm-compiler
simonjiao Aug 14, 2024
a6ef37d
fix stdlib
simonjiao Aug 14, 2024
81faf37
fix account
simonjiao Aug 14, 2024
cbd9868
fix starcoin-gas
simonjiao Aug 14, 2024
a1933b6
fix starcoin-abi-resolver
simonjiao Aug 14, 2024
34a5a0d
fix move-explain
simonjiao Aug 14, 2024
c618e50
update starcoin-vm-runtime
simonjiao Aug 15, 2024
c9a1bd5
fix MoveResolverExt
simonjiao Aug 19, 2024
4af2ff2
remove generic parameter from SessionAdapter
simonjiao Aug 19, 2024
dcfccbb
fix vm-runtime verifier
simonjiao Aug 19, 2024
86305cd
fix deserialize_args in vm-runtime
simonjiao Aug 22, 2024
963e971
fix more building errors
simonjiao Aug 22, 2024
5a54e66
fix starcoin-cmd
simonjiao Aug 22, 2024
6dbb71d
wrapping AccountAddressParseError
simonjiao Aug 23, 2024
cc6ccc9
use 16-bytes AccountAddress
simonjiao Aug 26, 2024
3e39736
upgrade to clap4 and fix transactional-test-harness
simonjiao Aug 26, 2024
d32cd3e
fix mpm binary
simonjiao Aug 28, 2024
65050e0
fix stdlib
simonjiao Aug 29, 2024
3b8abaf
update move dependencies
simonjiao Aug 29, 2024
e448eaa
introduce aptos-vm
simonjiao Sep 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,741 changes: 4,132 additions & 1,609 deletions Cargo.lock

Large diffs are not rendered by default.

69 changes: 40 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ bs58 = "0.3.1"
byteorder = "1.3.4"
bytes = "1"
chrono = { version = "0.4.19", default-features = false, features = ["clock"] }
clap = { version = "3", features = ["derive"] }
clap = { version = "4.5", features = ["derive"] }
cli-table = "0.3.2"
coarsetime = "0.1.22"
codespan = { version = "0.8.0", features = ["serialization"] }
Expand All @@ -292,7 +292,7 @@ difference = "2.0.0"
dirs-next = "2.0.0"
dyn-clone = "1.0.8"
either = "~1"
elasticsearch = "8.5.0-alpha.1"
elasticsearch = "8.15.0-alpha.1"
ethereum-types = "0.9"
starcoin-executor-benchmark = { path = "executor/benchmark" }
fnv = "1.0.6"
Expand Down Expand Up @@ -343,31 +343,37 @@ log4rs = { version = "1.2.0", features = ["background_rotation", "gzip"] }
lru = "0.7.8"
merkletree = { version = "0.22.1" }
mirai-annotations = "1.10.1"
move-binary-format = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-bytecode-source-map = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-bytecode-verifier = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-cli = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-command-line-common = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-compiler = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-core-types = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-coverage = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-disassembler = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-docgen = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-errmapgen = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-ir-compiler = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-ir-types = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-model = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-package = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-prover = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-prover-test-utils = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-resource-viewer = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-stdlib = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-transactional-test-runner = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-unit-test = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25", features = ["table-extension"] }
move-vm-runtime = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-vm-types = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-table-extension = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25" }
move-vm-test-utils = { git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25", features = ["table-extension"] }

# Aptos VM dependencies
aptos-vm = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }

# Move dependencies
move-binary-format = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-bytecode-source-map = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-bytecode-verifier = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-bytecode-utils = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-cli = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-command-line-common = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-compiler = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-core-types = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6", features = ["address16"] }
move-coverage = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-disassembler = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-docgen = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-errmapgen = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-ir-compiler = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-ir-types = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-model = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-package = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-prover = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-prover-test-utils = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-resource-viewer = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-stdlib = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-transactional-test-runner = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-unit-test = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6", features = ["table-extension"] }
move-vm-runtime = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-vm-types = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-table-extension = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6" }
move-vm-test-utils = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6", features = ["table-extension"] }

names = { version = "0.14.0", default-features = false }
network-api = { path = "network/api", package = "network-api" }
Expand Down Expand Up @@ -454,7 +460,7 @@ starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev
starcoin-decrypt = { path = "commons/decrypt" }
starcoin-dev = { path = "vm/dev" }
starcoin-executor = { path = "executor" }
starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "94bcd77e80232b169cf95754ef4e87775645afcd" }
starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "e804cfaead592b5318a5b75fc1239c192926b7fa" }
starcoin-genesis = { path = "genesis" }
starcoin-logger = { path = "commons/logger" }
starcoin-metrics = { path = "commons/metrics" }
Expand Down Expand Up @@ -535,7 +541,7 @@ unsigned-varint = { version = "0.6.0", features = [
"futures",
"asynchronous_codec",
] }
vm = { package = "move-binary-format", git = "https://github.com/starcoinorg/move", rev = "905484b15b2a2218013fdb2c034f1d7898d29a25", features = ["fuzzing"] }
vm = { git = "https://github.com/starcoinorg/aptos-core", rev = "561a0f9f93680b59abc5c5f900fb30d5294b6ad6", package = "move-binary-format", features = ["fuzzing"] }
vm-status-translator = { path = "vm/vm-status-translator" }
void = "1.0.2"
walkdir = "2.3.1"
Expand Down Expand Up @@ -564,3 +570,8 @@ debug = false

#[profile.release.package.cryptonight-rs]
#opt-level = 2

[patch.crates-io]
x25519-dalek = { git = "https://github.com/aptos-labs/x25519-dalek", branch = "zeroize_v1" }
libp2p = { git = "https://github.com/starcoinorg/rust-libp2p", rev = "892a10116633ad6dd0c2550ce512fba98a525dc7" }
merlin = { git = "https://github.com/aptos-labs/merlin" }
15 changes: 8 additions & 7 deletions abi/resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ use starcoin_resource_viewer::module_cache::ModuleCache;
use starcoin_resource_viewer::resolver::Resolver;
use starcoin_vm_types::access::ModuleAccess;
use starcoin_vm_types::file_format::{
CompiledModule, CompiledScript, FunctionDefinitionIndex, StructDefinitionIndex, Visibility,
self_module_name, CompiledModule, CompiledScript, FunctionDefinitionIndex,
StructDefinitionIndex, Visibility,
};
use starcoin_vm_types::identifier::{IdentStr, Identifier};
use starcoin_vm_types::language_storage::{ModuleId, StructTag, TypeTag};
Expand Down Expand Up @@ -53,7 +54,7 @@ impl<'a> ABIResolver<'a> {
}

fn resolve_compiled_module(&self, module: &CompiledModule) -> Result<ModuleABI> {
let m = Module::new(module);
let m = Module::new(module)?;
let module_id = m.module_id();
let structs = m
.structs
Expand All @@ -72,9 +73,9 @@ impl<'a> ABIResolver<'a> {

pub fn resolve_script(&self, script_code: Vec<u8>) -> Result<TransactionScriptABI> {
let script = CompiledScript::deserialize(&script_code)?;
let script_mod = script_into_module(script);
let script_mod = script_into_module(script, self_module_name().as_str());

let m = Module::new(&script_mod);
let m = Module::new(&script_mod)?;
anyhow::ensure!(
m.exposed_functions.len() == 1,
"script should only contain one function"
Expand All @@ -98,7 +99,7 @@ impl<'a> ABIResolver<'a> {
let struct_abi =
self.resolve_struct(&struct_tag.module_id(), struct_tag.name.as_ident_str())?;
let ty_args = struct_tag
.type_params
.type_args
.iter()
.map(|ty| self.resolve_type_tag(ty))
.collect::<Result<Vec<_>>>()?;
Expand Down Expand Up @@ -132,7 +133,7 @@ impl<'a> ABIResolver<'a> {
.resolver
.get_module(module_id.address(), module_id.name())?;
let struct_def = find_struct_def_in_module(module.as_ref(), name)?;
let (name, s) = Struct::new(&module, module.struct_def_at(struct_def));
let (name, s) = Struct::new(&module, module.struct_def_at(struct_def))?;
self.struct_to_abi(module_id, &name, &s)
}
pub fn resolve_type(&self, ty: &Type) -> Result<TypeInstantiation> {
Expand Down Expand Up @@ -422,7 +423,7 @@ mod tests {
let st = parse_struct_tag(
"0x1::Dao::Proposal<0x1::STC::STC, 0x1::MintDaoProposal::MintToken>",
)
.unwrap();
.unwrap();
r.resolve_struct_tag(&st).unwrap();
}
// test struct def
Expand Down
2 changes: 1 addition & 1 deletion abi/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ impl StructInstantiation {
address: *self.module_name.address(),
module: self.module_name.name().to_owned(),
name: Identifier::new(self.name.as_str())?,
type_params: self
type_args: self
.ty_args
.iter()
.map(|t| t.ty.type_tag())
Expand Down
1 change: 1 addition & 0 deletions account/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ serde_json = { workspace = true }
starcoin-crypto = { workspace = true }
starcoin-service-registry = { workspace = true }
starcoin-types = { workspace = true }
starcoin-vm-types = { workspace = true }
thiserror = { workspace = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion account/api/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use starcoin_crypto::keygen::KeyGen;
use starcoin_types::account::Account;
use starcoin_types::account_address::AccountAddress;
pub use starcoin_types::transaction::authenticator::{AccountPrivateKey, AccountPublicKey};
use starcoin_types::{
account_address::{self},
transaction::authenticator::AuthenticationKey,
};
use starcoin_vm_types::account_address::{AccountAddress, Bech32AccountAddress};

#[derive(Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
pub struct AccountInfo {
Expand Down
5 changes: 3 additions & 2 deletions cmd/starcoin/src/account/derive_account_address_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ use serde::Deserialize;
use serde::Serialize;
use starcoin_crypto::ed25519::Ed25519PublicKey;
use starcoin_crypto::ValidCryptoMaterialStringExt;
use starcoin_types::account_address::AccountAddress;
use starcoin_types::transaction::authenticator::AuthenticationKey;
use starcoin_vm_types::account_address::{AccountAddress, Bech32AccountAddress};
use starcoin_vm_types::transaction::authenticator::AccountPublicKey;

/// Derive an address by public key.
#[derive(Debug, Parser)]
#[clap(name = "derive-address")]
pub struct DeriveAddressOpt {
#[clap(short = 'p', long = "pubkey", required=true, min_values=1, max_values=32, parse(try_from_str=Ed25519PublicKey::from_encoded_string))]
#[arg(short = 'p', long = "pubkey", required = true, num_args(1..=32), value_parser = Ed25519PublicKey::from_encoded_string
)]
/// public key used to derive address.If multi public keys is provided, a multi-sig account address is derived.
public_key: Vec<Ed25519PublicKey>,

Expand Down
13 changes: 7 additions & 6 deletions cmd/starcoin/src/account/execute_script_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::path::PathBuf;

use anyhow::{bail, Result};
use clap::Parser;
use clap::{value_parser, Parser};

use scmd::{CommandAction, ExecContext};
use starcoin_move_compiler::load_bytecode_file;
Expand All @@ -22,22 +22,23 @@ use crate::StarcoinOpt;
#[derive(Debug, Parser)]
#[clap(name = "execute-script")]
pub struct ExecuteScriptOpt {
#[clap(
#[arg(
short = 't',
long = "type_tag",
name = "type-tag",
help = "can specify multi type_tag",
parse(try_from_str = parse_type_tag)
value_parser = parse_type_tag
)]
type_tags: Option<Vec<TypeTag>>,

#[clap(long = "arg", name = "transaction-args", help = "can specify multi arg", parse(try_from_str = parse_transaction_argument_advance))]
#[arg(long = "arg", name = "transaction-args", help = "can specify multi arg", value_parser = parse_transaction_argument_advance
)]
args: Option<Vec<TransactionArgument>>,

#[clap(flatten)]
#[command(flatten)]
transaction_opts: TransactionOptions,

#[clap(name = "mv_file", parse(from_os_str))]
#[arg(name = "mv_file", value_parser = value_parser!(std::ffi::OsString))]
/// bytecode file of the script to execute.
mv_file: PathBuf,
}
Expand Down
7 changes: 4 additions & 3 deletions cmd/starcoin/src/account/execute_script_function_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ use starcoin_vm_types::{language_storage::TypeTag, parser::parse_type_tag};
#[derive(Debug, Parser)]
#[clap(name = "execute-function")]
pub struct ExecuteScriptFunctionOpt {
#[clap(
#[arg(
short = 't',
long = "type_tag",
name = "type-tag",
parse(try_from_str = parse_type_tag)
value_parser = parse_type_tag
)]
/// type tags for the script
type_tags: Option<Vec<TypeTag>>,

#[clap(long = "arg", name = "transaction-args", parse(try_from_str = parse_transaction_argument_advance))]
#[arg(long = "arg", name = "transaction-args", value_parser = parse_transaction_argument_advance
)]
/// args for the script.
args: Option<Vec<TransactionArgument>>,

Expand Down
4 changes: 2 additions & 2 deletions cmd/starcoin/src/account/export_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::cli_state::CliState;
use crate::StarcoinOpt;
use anyhow::{bail, Result};
use clap::Parser;
use clap::{value_parser, Parser};
use scmd::{CommandAction, ExecContext};
use serde::{Deserialize, Serialize};
use starcoin_crypto::ValidCryptoMaterialStringExt;
Expand All @@ -21,7 +21,7 @@ pub struct ExportOpt {
account_address: AccountAddress,
#[clap(short = 'p', default_value = "")]
password: String,
#[clap(short = 'o', parse(from_os_str))]
#[arg(short = 'o', value_parser = value_parser!(std::ffi::OsString))]
output_file: Option<PathBuf>,
}

Expand Down
1 change: 1 addition & 0 deletions cmd/starcoin/src/account/generate_keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use starcoin_crypto::keygen::KeyGen;
use starcoin_crypto::ValidCryptoMaterialStringExt;
use starcoin_types::account_address::AccountAddress;
use starcoin_types::transaction::authenticator::AuthenticationKey;
use starcoin_vm_types::account_address::Bech32AccountAddress;
use starcoin_vm_types::transaction::authenticator::{AccountPrivateKey, AccountPublicKey};
use std::convert::TryInto;

Expand Down
6 changes: 3 additions & 3 deletions cmd/starcoin/src/account/import_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::cli_state::CliState;
use crate::StarcoinOpt;
use anyhow::{bail, Result};
use clap::Parser;
use clap::{value_parser, Parser};
use scmd::{CommandAction, ExecContext};
use starcoin_account_api::{AccountInfo, AccountPrivateKey};
use starcoin_crypto::{ValidCryptoMaterial, ValidCryptoMaterialStringExt};
Expand All @@ -21,10 +21,10 @@ pub struct ImportOpt {
#[clap(name = "input", short = 'i', help = "input of private key")]
from_input: Option<String>,

#[clap(
#[arg(
short = 'f',
help = "file path of private key",
parse(from_os_str),
value_parser = value_parser!(std::ffi::OsString),
conflicts_with("input")
)]
from_file: Option<PathBuf>,
Expand Down
7 changes: 4 additions & 3 deletions cmd/starcoin/src/account/import_multisig_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ pub struct ImportMultisigOpt {
/// if account_address is absent, generate address by public_key.
account_address: Option<AccountAddress>,

#[clap(long = "pubkey", max_values=32, parse(try_from_str=Ed25519PublicKey::from_encoded_string))]
#[arg(long = "pubkey", num_args(1..=32), value_parser = Ed25519PublicKey::from_encoded_string)]
/// public keys of other participants in this multisig account.
public_keys: Vec<Ed25519PublicKey>,

#[clap(short = 't', name = "threshold")]
/// In multi-sig case, a threshold is needed.
threshold: u8,

#[clap(long = "prikey", max_values = 32, parse(try_from_str=Ed25519PrivateKey::from_encoded_string))]
#[arg(long = "prikey", num_args(1..=32), value_parser = Ed25519PrivateKey::from_encoded_string
)]
/// hex encoded private key, if you control multi private keys, provide multi args.
private_keys: Vec<Ed25519PrivateKey>,

#[clap(long = "prikey-file", max_values = 32)]
#[arg(long = "prikey-file", num_args(1..=32))]
/// private key file contain the hex-encoded private key, if you control multi private keys, provide multi args.
private_key_files: Vec<PathBuf>,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/starcoin/src/account/receipt_identifier_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl CommandAction for ReceiptIdentifierCommand {

Ok(ReceiptIdentifierData {
address: opt.address_or_receipt.to_hex(),
receipt_identifier: opt.address_or_receipt.to_bech32(),
receipt_identifier: opt.address_or_receipt.to_standard_string(),
})
}
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/starcoin/src/account/rotate_auth_key_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::path::PathBuf;

use anyhow::{bail, Result};
use clap::Parser;
use clap::{value_parser, Parser};
use starcoin_crypto::{ValidCryptoMaterial, ValidCryptoMaterialStringExt};

use scmd::{CommandAction, ExecContext};
Expand Down Expand Up @@ -35,7 +35,7 @@ pub struct RotateAuthKeyOpt {
)]
account_address: AccountAddress,

#[clap(flatten)]
#[command(flatten)]
transaction_opts: TransactionOptions,

#[clap(
Expand All @@ -44,10 +44,10 @@ pub struct RotateAuthKeyOpt {
help = "input of private key for rotating"
)]
from_input: Option<String>,
#[clap(
#[arg(
short = 'f',
help = "file path of private key",
parse(from_os_str),
value_parser = value_parser!(std::ffi::OsString),
conflicts_with("input")
)]
from_file: Option<PathBuf>,
Expand Down
Loading
Loading