Update clap to v3.1.6 (#224)

This commit is contained in:
kirill lykov 2022-03-21 14:36:13 +01:00 committed by GitHub
parent 5b43fe1455
commit 9a6f6abcb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1649 additions and 1498 deletions

3103
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,7 @@ pub fn create_account_rent_exempt(
let instructions = vec![create_account_instr];
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(
&instructions,
@ -63,7 +63,7 @@ pub fn create_token_account(
payer,
)?;
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let signers = vec![payer, &spl_account];
let txn = Transaction::new_signed_with_payer(
@ -143,7 +143,7 @@ pub fn create_and_init_mint(
)?;
let instructions = vec![create_mint_account_instruction, initialize_mint_instruction];
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(
&instructions,
Some(&payer_keypair.pubkey()),
@ -193,7 +193,7 @@ pub fn mint_to_new_account(
let instructions = vec![create_recip_instr, init_recip_instr, mint_tokens_instr];
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(
&instructions,
Some(&payer.pubkey()),
@ -221,7 +221,7 @@ pub fn transfer(
&[],
amount,
)?;
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let signers = [payer, from_authority];
let txn =
Transaction::new_signed_with_payer(&[instr], Some(&payer.pubkey()), &signers, recent_hash);

View File

@ -11,7 +11,7 @@ path = "src/bin/main.rs"
serum_dex = { path = "../", default-features = false, features = ["client"] }
serum-common = { path = "../../common", features = ["client"] }
spl-token = { version = "3.0.0-pre1", features = ["no-entrypoint"], default-features = false }
clap = "3.0.0-beta.1"
clap = { version = "3.1.6", features = ["derive"] }
enumflags2 = "0.6.4"
solana-client = "1.6.18"
solana-sdk = "1.6.18"

View File

@ -1,5 +1,5 @@
use anyhow::Result;
use clap::Clap;
use clap::Parser;
use crank::Opts;
fn main() -> Result<()> {

View File

@ -11,7 +11,7 @@ use std::sync::{Arc, Mutex};
use std::{thread, time};
use anyhow::{format_err, Result};
use clap::Clap;
use clap::Parser;
use debug_print::debug_println;
use enumflags2::BitFlags;
use log::{error, info};
@ -63,7 +63,7 @@ fn read_keypair_file(s: &str) -> Result<Keypair> {
.map_err(|_| format_err!("failed to read keypair from {}", s))
}
#[derive(Clap, Debug)]
#[derive(Parser, Debug)]
pub struct Opts {
#[clap(default_value = "mainnet")]
pub cluster: Cluster,
@ -77,7 +77,7 @@ impl Opts {
}
}
#[derive(Clap, Debug)]
#[derive(Parser, Debug)]
pub enum Command {
Genesis {
#[clap(long, short)]
@ -726,7 +726,7 @@ pub fn consume_events_once(
&payer.pubkey(),
rand::random::<u64>() % 10000 + 1,
);
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(
&[instruction, random_instruction],
Some(&payer.pubkey()),
@ -761,7 +761,7 @@ fn consume_events(
Some(i) => i,
}
};
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
info!("Consuming events ...");
let txn = Transaction::new_signed_with_payer(
std::slice::from_ref(&instruction),
@ -968,7 +968,7 @@ pub fn cancel_order_by_client_order_id(
&state.event_q,
client_order_id,
)?];
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(ixs, Some(&owner.pubkey()), &[owner], recent_hash);
debug_println!("Canceling order by client order id instruction ...");
@ -997,7 +997,7 @@ pub fn close_open_orders(
&owner.pubkey(),
&state.market,
)?];
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(ixs, Some(&owner.pubkey()), &[owner], recent_hash);
debug_println!("Simulating close open orders instruction ...");
@ -1046,7 +1046,7 @@ pub fn init_open_orders(
)?);
signers.push(owner);
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(
&instructions,
Some(&owner.pubkey()),
@ -1109,7 +1109,7 @@ pub fn place_order(
instructions.push(instruction);
signers.push(payer);
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(
&instructions,
Some(&payer.pubkey()),
@ -1146,7 +1146,7 @@ fn settle_funds(
AccountMeta::new_readonly(spl_token::ID, false),
],
};
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let mut signers = vec![payer];
if let Some(s) = signer {
signers.push(s);
@ -1231,7 +1231,7 @@ pub fn list_market(
instructions.push(init_market_instruction);
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let signers = vec![
payer,
&market_key,
@ -1363,7 +1363,7 @@ pub fn match_orders(
data: instruction_data,
};
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(
std::slice::from_ref(&instruction),
Some(&payer.pubkey()),
@ -1412,7 +1412,7 @@ fn create_account(
let instructions = vec![create_account_instr, init_account_instr];
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(
&instructions,
@ -1446,7 +1446,7 @@ fn mint_to_existing_account(
)?;
let instructions = vec![mint_tokens_instr];
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(
&instructions,
Some(&payer.pubkey()),
@ -1475,7 +1475,7 @@ fn initialize_token_account(client: &RpcClient, mint: &Pubkey, owner: &Keypair)
)?;
let signers = vec![owner, &recip_keypair];
let instructions = vec![create_recip_instr, init_recip_instr];
let (recent_hash, _fee_calc) = client.get_recent_blockhash()?;
let recent_hash = client.get_latest_blockhash()?;
let txn = Transaction::new_signed_with_payer(
&instructions,
Some(&owner.pubkey()),