Skip to content

Commit

Permalink
cargo test compilable, fix some clap changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed Nov 8, 2022
1 parent 3f3dcdd commit 244be82
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 63 deletions.
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions crates/pink/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,9 @@ impl Config for PinkRuntime {

#[test]
fn detect_parameter_changes() {
use sp_core::Get;
insta::assert_debug_snapshot!((
<PinkRuntime as frame_system::Config>::BlockWeights::get(),
<PinkRuntime as Config>::Schedule::get(),
<PinkRuntime as Config>::ContractAccessWeight::get(),
<PinkRuntime as Config>::DeletionQueueDepth::get(),
<PinkRuntime as Config>::DeletionWeightLimit::get(),
<PinkRuntime as Config>::MaxCodeLen::get(),
Expand Down
3 changes: 1 addition & 2 deletions crates/sidevm/host/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use sidevm_host_runtime::{CacheOps, DynCacheOps, OcallError};

use clap::{AppSettings, Parser};
use clap::Parser;
use once_cell::sync::Lazy;
use std::collections::HashMap;
use std::sync::RwLock;
Expand All @@ -9,7 +9,6 @@ mod web_api;

#[derive(Parser)]
#[clap(about = "Demo sidevm host app", version, author)]
#[clap(global_setting(AppSettings::DeriveDisplayOrder))]
pub struct Args {
/// The gas limit for each poll.
#[arg(long, default_value_t = 50_000_000_000_u64)]
Expand Down
2 changes: 1 addition & 1 deletion scripts/debug-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::fmt::Debug;
// use phala_types;

#[derive(Debug, Parser)]
#[clap(name = "Phala Debug Utility CLI", next_display_order = None)]
#[clap(name = "Phala Debug Utility CLI")]
enum Cli {
DecodeWorkerRegistrationInfo {
#[arg(short)]
Expand Down
2 changes: 1 addition & 1 deletion standalone/headers-cache/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod web_api;
type BlockNumber = u32;

#[derive(Parser)]
#[clap(about = "Cache server for relaychain headers", version, author, next_display_order = None)]
#[clap(about = "Cache server for relaychain headers", version, author)]
pub struct Args {
#[command(subcommand)]
action: Action,
Expand Down
3 changes: 1 addition & 2 deletions standalone/node/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ use nix::{
sys::signal::{kill, Signal::SIGINT},
unistd::Pid,
};
use node_primitives::Block;
use remote_externalities::rpc_api::RpcService;
use node_primitives::{Hash, Header};
use std::{
io::{BufRead, BufReader, Read},
ops::{Deref, DerefMut},
Expand Down
46 changes: 23 additions & 23 deletions standalone/pherry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,19 @@ pub use phaxt::connect as subxt_connect;
#[clap(
about = "Sync messages between pruntime and the blockchain.",
version,
author,
next_display_order = None
author
)]
pub struct Args {
#[clap(
#[arg(
long,
help = "Dev mode (equivalent to `--use-dev-key --mnemonic='//Alice'`)"
)]
dev: bool,

#[clap(short = 'n', long = "no-init", help = "Should init pRuntime?")]
#[arg(short = 'n', long = "no-init", help = "Should init pRuntime?")]
no_init: bool,

#[clap(
#[arg(
long = "no-sync",
help = "Don't sync pRuntime. Quit right after initialization."
)]
Expand All @@ -76,41 +75,41 @@ pub struct Args {
#[arg(long, help = "Skip binding the worker endpoint.")]
no_bind: bool,

#[clap(
#[arg(
long,
help = "Inject dev key (0x1) to pRuntime. Cannot be used with remote attestation enabled."
)]
use_dev_key: bool,

#[clap(
#[arg(
default_value = "",
long = "inject-key",
help = "Inject key to pRuntime."
)]
inject_key: String,

#[clap(
#[arg(
default_value = "ws://localhost:9944",
long,
help = "Substrate rpc websocket endpoint"
)]
substrate_ws_endpoint: String,

#[clap(
#[arg(
default_value = "ws://localhost:9977",
long,
help = "Parachain collator rpc websocket endpoint"
)]
collator_ws_endpoint: String,

#[clap(
#[arg(
default_value = "http://localhost:8000",
long,
help = "pRuntime http endpoint"
)]
pruntime_endpoint: String,

#[clap(
#[arg(
long,
help = "pRuntime http endpoint to handover the key. The handover will only happen when the old pRuntime is synced."
)]
Expand All @@ -119,29 +118,29 @@ pub struct Args {
#[arg(default_value = "", long, help = "notify endpoint")]
notify_endpoint: String,

#[clap(
#[arg(
default_value = "//Alice",
short = 'm',
long = "mnemonic",
help = "Controller SR25519 private key mnemonic, private key seed, or derive path"
)]
mnemonic: String,

#[clap(
#[arg(
default_value = "1000",
long = "fetch-blocks",
help = "The batch size to fetch blocks from Substrate."
)]
fetch_blocks: u32,

#[clap(
#[arg(
default_value = "4",
long = "sync-blocks",
help = "The batch size to sync blocks to pRuntime."
)]
sync_blocks: BlockNumber,

#[clap(
#[arg(
long = "operator",
help = "The operator account to set the miner for the worker."
)]
Expand All @@ -150,7 +149,7 @@ pub struct Args {
#[arg(long = "parachain", help = "Parachain mode")]
parachain: bool,

#[clap(
#[arg(
long,
help = "The first parent header to be synced, default to auto-determine"
)]
Expand All @@ -159,27 +158,28 @@ pub struct Args {
#[arg(long, help = "Don't wait the substrate nodes to sync blocks")]
no_wait: bool,

#[clap(
#[arg(
default_value = "5000",
long,
help = "(Debug only) Set the wait block duration in ms"
)]
dev_wait_block_ms: u64,

#[clap(
#[arg(
default_value = "0",
long,
help = "The charge transaction payment, unit: balance"
)]
tip: u128,
#[clap(

#[arg(
default_value = "4",
long,
help = "The transaction longevity, should be a power of two between 4 and 65536. unit: block"
)]
longevity: u64,

#[clap(
#[arg(
default_value = "200",
long,
help = "Max number of messages to be submitted per-round"
Expand All @@ -189,7 +189,7 @@ pub struct Args {
#[arg(long, help = "Auto restart self after an error occurred")]
auto_restart: bool,

#[clap(
#[arg(
default_value = "10",
long,
help = "Max auto restart retries if it continiously failing. Only used with --auto-restart"
Expand All @@ -208,14 +208,14 @@ pub struct Args {
#[arg(default_value_t = BlockNumber::MAX)]
to_block: BlockNumber,

#[clap(
#[arg(
long,
help = "Disable syncing waiting parachain blocks in the beginning of each round"
)]
disable_sync_waiting_paraheaders: bool,

/// Attestation provider
#[clap(long, short = 'r', value_enum, default_value_t = RaOption::Ias)]
#[arg(long, short = 'r', value_enum, default_value_t = RaOption::Ias)]
attestation_provider: RaOption,
}

Expand Down
8 changes: 4 additions & 4 deletions standalone/pruntime/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion standalone/pruntime/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use phactory_api::ecall_args::{git_revision, InitArgs};
mod logger;

#[derive(Parser, Debug, Clone)]
#[clap(about = "The Phala TEE worker app.", version, author, next_display_order = None)]
#[clap(about = "The Phala TEE worker app.", version, author)]
struct Args {
/// Number of CPU cores to be used for mining.
#[arg(short, long)]
Expand Down
Loading

0 comments on commit 244be82

Please sign in to comment.