Skip to content

Commit

Permalink
chore: Update dependencies (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aursen authored Feb 20, 2024
1 parent d299395 commit eca6aa6
Show file tree
Hide file tree
Showing 14 changed files with 365 additions and 337 deletions.
574 changes: 297 additions & 277 deletions Cargo.lock

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,29 @@ dirs-next = "2.0.0"
indicatif = "0.17"
reqwest = "0.11.14"
serde_json = "1.0.79"
solana-client = "=1.17.14"
solana-cli-config = "=1.17.14"
solana-sdk = "=1.17.14"
solana-client = "=1.17.22"
solana-cli-config = "=1.17.22"
solana-sdk = "=1.17.22"
solana-account-decoder = "=1.17.22"
solana-quic-client = "=1.17.22"
solana-logger = "=1.17.22"
solana-program = "=1.17.22"
solana-geyser-plugin-interface = "=1.17.22"
solana-zk-token-sdk = "=1.17.22"
spl-associated-token-account = "1.1.1"
spl-token = "~3.5.0"
tar = "0.4"
thiserror = "1.0.30"
termcolor = "1.2.0"
cargo_metadata = "=0.18.1"
nom = "~7"
solana-geyser-plugin-interface = "=1.17.14"
log = "0.4"
pyth-sdk-solana = "0.9.0"
solana-account-decoder = "=1.17.14"
solana-quic-client = "=1.17.14"
solana-logger = "=1.17.14"
solana-program = "=1.17.14"
pyth-sdk-solana = "0.10.0"
tokio = "1.18.4"
futures = "0.3.26"
version = "3.0.0"
actix-cors = "0.6.4"
actix-web = "4.3.1"
solana-zk-token-sdk = "=1.17.14"
rayon = "1.7.0"
regex = "1.7.1"
async-trait = "0.1.64"
Expand Down
32 changes: 23 additions & 9 deletions cli/src/processor/localnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,30 @@ use {
std::process::{Child, Command},
};

pub struct LocalnetStartArgs<'a> {
pub config: &'a mut CliConfig,
pub client: &'a Client,
pub clone_addresses: Vec<Pubkey>,
pub network_url: Option<String>,
pub program_infos: Vec<ProgramInfo>,
pub force_init: bool,
pub solana_archive: Option<String>,
pub sablier_archive: Option<String>,
pub dev: bool,
}

pub fn start(
config: &mut CliConfig,
client: &Client,
clone_addresses: Vec<Pubkey>,
network_url: Option<String>,
program_infos: Vec<ProgramInfo>,
force_init: bool,
solana_archive: Option<String>,
sablier_archive: Option<String>,
dev: bool,
LocalnetStartArgs {
config,
client,
clone_addresses,
network_url,
program_infos,
force_init,
solana_archive,
sablier_archive,
dev,
}: LocalnetStartArgs<'_>,
) -> Result<(), CliError> {
config.dev = dev;
deps::download_deps(
Expand Down
10 changes: 6 additions & 4 deletions cli/src/processor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ use crate::{
processor::thread::parse_pubkey_from_id_or_address,
};

use self::localnet::LocalnetStartArgs;

pub fn process(matches: &ArgMatches) -> Result<(), CliError> {
// Parse command and config
let command = CliCommand::try_from(matches)?;
Expand Down Expand Up @@ -75,17 +77,17 @@ pub fn process(matches: &ArgMatches) -> Result<(), CliError> {
solana_archive,
sablier_archive,
dev,
} => localnet::start(
&mut config,
&client,
} => localnet::start(LocalnetStartArgs {
config: &mut config,
client: &client,
clone_addresses,
network_url,
program_infos,
force_init,
solana_archive,
sablier_archive,
dev,
),
}),
CliCommand::PoolGet { id } => pool::get(&client, id),
CliCommand::PoolList {} => pool::list(&client),
CliCommand::PoolUpdate { id, size } => pool::update(&client, id, size),
Expand Down
32 changes: 15 additions & 17 deletions cron/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,21 @@
//! use chrono::{DateTime, NaiveDateTime, Utc};
//! use std::str::FromStr;
//!
//! fn main() {
//! // sec min hour day of month month day of week year
//! let expression = "0 30 9,12,15 1,15 May-Aug Mon,Wed,Fri 2018/2";
//! let schedule = Schedule::from_str(expression).unwrap();
//! let ts = 1234567890;
//! let next_ts = match schedule
//! .after(&DateTime::<Utc>::from_utc(
//! NaiveDateTime::from_timestamp(ts, 0),
//! Utc,
//! ))
//! .take(1)
//! .next()
//! {
//! Some(datetime) => Some(datetime.timestamp()),
//! None => None,
//! };
//! }
//! // sec min hour day of month month day of week year
//! let expression = "0 30 9,12,15 1,15 May-Aug Mon,Wed,Fri 2018/2";
//! let schedule = Schedule::from_str(expression).unwrap();
//! let ts = 1234567890;
//! let next_ts = match schedule
//! .after(&DateTime::<Utc>::from_utc(
//! NaiveDateTime::from_timestamp(ts, 0),
//! Utc,
//! ))
//! .take(1)
//! .next()
//! {
//! Some(datetime) => Some(datetime.timestamp()),
//! None => None,
//! };
//!
//! /*
//! Upcoming fire times:
Expand Down
2 changes: 1 addition & 1 deletion cron/src/parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ where
{
fn from_field(field: Field) -> Result<T, Error> {
if field.specifiers.len() == 1
&& field.specifiers.get(0).unwrap() == &RootSpecifier::from(Specifier::All)
&& field.specifiers.first().unwrap() == &RootSpecifier::from(Specifier::All)
{
return Ok(T::all());
}
Expand Down
6 changes: 3 additions & 3 deletions cron/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ mod tests {
let starting_date = Utc.with_ymd_and_hms(2023, 3, 1, 14, 29, 36).unwrap();
let mut events = schedule.after(&starting_date);
assert_eq!(
Utc.with_ymd_and_hms(2023, 03, 03, 0, 0, 0).unwrap(),
Utc.with_ymd_and_hms(2023, 3, 3, 0, 0, 0).unwrap(),
events.next().unwrap()
);
assert_eq!(
Utc.with_ymd_and_hms(2023, 03, 10, 0, 0, 0).unwrap(),
Utc.with_ymd_and_hms(2023, 3, 10, 0, 0, 0).unwrap(),
events.next().unwrap()
);
assert_eq!(
Utc.with_ymd_and_hms(2023, 03, 17, 0, 0, 0).unwrap(),
Utc.with_ymd_and_hms(2023, 3, 17, 0, 0, 0).unwrap(),
events.next().unwrap()
);
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "sablier_plugin"
version.workspace = true
# this needs to match whatever solana uses!
rust-version = "1.73.0"
rust-version = "1.76.0"
description = "Sablier plugin for Solana validators"
edition.workspace = true
license.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion plugin/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn main() {
let rustc_v = rustc_version::version()
.expect("Unable to get rustc version")
.to_string();
let expected_v = "1.73.0".to_string();
let expected_v = "1.76.0".to_string();

// Check for a minimum version
if rustc_v != expected_v {
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/builders/thread_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub async fn build_thread_exec_tx(

// Parse the resulting thread account for the next instruction to simulate.
if let Some(ui_accounts) = response.value.accounts {
if let Some(Some(ui_account)) = ui_accounts.get(0) {
if let Some(Some(ui_account)) = ui_accounts.first() {
if let Some(account) = ui_account.decode::<Account>() {
if let Ok(sim_thread) = VersionedThread::try_from(account.data) {
if sim_thread.next_instruction().is_some() {
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/events.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anchor_lang::{prelude::AccountInfo, AccountDeserialize, Discriminator};
use bincode::deserialize;
use pyth_sdk_solana::{load_price_feed_from_account_info, PriceFeed};
use pyth_sdk_solana::{state::SolanaPriceAccount, PriceFeed};
use sablier_thread_program::state::{Thread, VersionedThread};
use sablier_webhook_program::state::Webhook;
use solana_geyser_plugin_interface::geyser_plugin_interface::{
Expand Down Expand Up @@ -71,7 +71,7 @@ impl TryFrom<&mut ReplicaAccountInfo<'_>> for AccountUpdateEvent {
account_info.executable,
account_info.rent_epoch,
);
let price_feed = load_price_feed_from_account_info(&acc_info).map_err(|_| {
let price_feed = SolanaPriceAccount::account_info_to_feed(&acc_info).map_err(|_| {
GeyserPluginError::AccountsUpdateError {
msg: "Failed to parse Pyth price account".into(),
}
Expand Down
5 changes: 3 additions & 2 deletions programs/thread/src/instructions/thread_kickoff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{

use anchor_lang::prelude::*;
use chrono::{DateTime, NaiveDateTime, Utc};
use pyth_sdk_solana::load_price_feed_from_account_info;
use pyth_sdk_solana::state::SolanaPriceAccount;
use sablier_cron::Schedule;
use sablier_network_program::state::{Worker, WorkerAccount};
use sablier_utils::thread::Trigger;
Expand Down Expand Up @@ -204,7 +204,8 @@ pub fn handler(ctx: Context<ThreadKickoff>) -> Result<()> {
SablierError::TriggerConditionFailed
);
const STALENESS_THRESHOLD: u64 = 60; // staleness threshold in seconds
let price_feed = load_price_feed_from_account_info(account_info).unwrap();
let price_feed =
SolanaPriceAccount::account_info_to_feed(account_info).unwrap();
let current_timestamp = Clock::get()?.unix_timestamp;
let current_price = price_feed
.get_price_no_older_than(current_timestamp, STALENESS_THRESHOLD)
Expand Down
2 changes: 0 additions & 2 deletions programs/thread/src/state/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ use sablier_utils::{
thread::{ClockData, SerializableInstruction, Trigger},
};

pub use sablier_utils::thread::Equality;

use crate::constants::{NEXT_INSTRUCTION_SIZE, SEED_THREAD};

/// Tracks the current state of a transaction thread on Solana.
Expand Down
9 changes: 2 additions & 7 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
[toolchain]
channel = "1.73.0"
components = ["rustfmt", "rust-analyzer", "clippy"]
channel = "1.76.0"
components = ["rustfmt", "clippy"]
profile = "minimal"
targets = [
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"aarch64-apple-darwin",
]

0 comments on commit eca6aa6

Please sign in to comment.