Skip to content

Commit

Permalink
Merge branch 'feat.multsig' of github.com:templexxx/starcoin into fea…
Browse files Browse the repository at this point in the history
…t.multsig
  • Loading branch information
templexxx committed Jun 16, 2022
2 parents 08ff50e + f23a4ac commit 1c71eb0
Show file tree
Hide file tree
Showing 106 changed files with 248 additions and 223 deletions.
202 changes: 101 additions & 101 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion abi/decoder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-abi-decoder"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion abi/resolver/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-abi-resolver"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion abi/types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-abi-types"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion account/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-account"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion account/api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-account-api"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion account/provider/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-account-provider"
version = "1.11.10"
version = "1.11.11"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion account/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-account-service"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "benchmarks"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion block-relayer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-block-relayer"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion chain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-chain"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion chain/api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-chain-api"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion chain/chain-notify/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-chain-notify"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion chain/mock/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-chain-mock"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion chain/open-block/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-open-block"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion chain/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-chain-service"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion cmd/airdrop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "airdrop"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion cmd/db-exporter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "db-exporter"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion cmd/faucet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-faucet"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion cmd/generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-generator"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion cmd/genesis-nft-miner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "genesis-nft-miner"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion cmd/indexer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ edition = "2021"
license = "Apache-2.0"
name = "starcoin-indexer"
publish = false
version = "1.11.10"
version = "1.11.11"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion cmd/merkle-generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "merkle-generator"
version = "1.11.10"
version = "1.11.11"
authors = ["caojiafeng <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion cmd/miner_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-miner-client"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion cmd/miner_client/api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-miner-client-api"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion cmd/peer-watcher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-peer-watcher"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion cmd/replay/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-replay"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion cmd/resource-exporter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "resource-exporter"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion cmd/starcoin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-cmd"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
16 changes: 14 additions & 2 deletions cmd/starcoin/src/account/rotate_auth_key_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use starcoin_types::identifier::Identifier;
use starcoin_types::language_storage::ModuleId;
use starcoin_vm_types::account_address::AccountAddress;
use starcoin_vm_types::account_config::core_code_address;
use starcoin_vm_types::transaction::authenticator::AccountPrivateKey;
use starcoin_vm_types::transaction::authenticator::{AccountPrivateKey, AccountPublicKey};
use starcoin_vm_types::transaction::{ScriptFunction, TransactionArgument, TransactionPayload};
use starcoin_vm_types::value::MoveValue;

Expand Down Expand Up @@ -67,6 +67,7 @@ impl CommandAction for RotateAuthenticationKeyCommand {
) -> Result<Self::ReturnItem> {
let client = ctx.state().account_client();
let opt: &RotateAuthKeyOpt = ctx.opt();

let private_key = match (opt.from_input.as_ref(), opt.from_file.as_ref()) {
(Some(p), _) => AccountPrivateKey::from_encoded_string(p)?,
(None, Some(p)) => {
Expand All @@ -77,7 +78,18 @@ impl CommandAction for RotateAuthenticationKeyCommand {
bail!("private key should be specified, use <input>, <from-file>")
}
};
let auth_key = private_key.public_key().authentication_key();

let account_public_key = match &private_key.public_key() {
AccountPublicKey::Multi(_) => {
bail!(
"{} is multisig address, you could use execute-function to rotate it step by step",
opt.account_address
);
}
m => m.clone(),
};

let auth_key = account_public_key.authentication_key();
let mut txn_opt = opt.transaction_opts.clone();
txn_opt.blocking = true;
txn_opt.sender = Option::from(opt.account_address);
Expand Down
18 changes: 17 additions & 1 deletion cmd/starcoin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ use scmd::CmdContext;
use starcoin_account_provider::ProviderFactory;
use starcoin_cmd::*;
use starcoin_cmd::{CliState, StarcoinOpt};
use starcoin_config::{Connect, G_APP_VERSION, G_CRATE_VERSION};
use starcoin_config::{Connect, NodeConfig, G_APP_VERSION, G_CRATE_VERSION};
use starcoin_logger::prelude::*;
use starcoin_node_api::errors::NodeStartError;
use starcoin_rpc_client::RpcClient;
use std::fs;
use std::sync::Arc;
use std::time::Duration;

Expand All @@ -33,6 +34,21 @@ fn run() -> Result<()> {
(client, None)
} else {
info!("Start starcoin node...");
// check and do some clean work
let config = NodeConfig::load_with_opt(opt)
.expect("load config with opt should success.");
let ipc_file = config.rpc.get_ipc_file();
if ipc_file.exists() {
// check if ipc is connectable
info!(
"ipc_file: {:?} already exists, try to check if it's connectable",
ipc_file
);
if RpcClient::connect_ipc(&ipc_file).is_err() {
info!("ipc_file: {:?} is not usable, just to remove it.", ipc_file);
_ = fs::remove_file(ipc_file);
}
}
let (node_handle, config) = starcoin_node::run_node_by_opt(opt)?;
match node_handle {
//first cli use local connect.
Expand Down
2 changes: 1 addition & 1 deletion cmd/tx-factory/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-tx-factory"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion commons/accumulator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-accumulator"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion commons/api-limiter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "api-limiter"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion commons/bcs_ext/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bcs-ext"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion commons/decrypt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-decrypt"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion commons/forkable-jellyfish-merkle/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "forkable-jellyfish-merkle"
version = "1.11.10"
version = "1.11.11"
authors = ["Diem Association <[email protected]>", "Starcoin Core Dev <[email protected]>"]
description = "Diem jellyfish merkle"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion commons/logger/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-logger"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion commons/metrics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-metrics"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion commons/proptest-helpers/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-proptest-helpers"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion commons/scmd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "scmd"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion commons/serde-helpers/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serde-helpers"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion commons/service-registry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-service-registry"
version = "1.11.10"
version = "1.11.11"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
Expand Down
Loading

0 comments on commit 1c71eb0

Please sign in to comment.