From d5a36f5c0a82d638252bd98c3c3cffd989837d02 Mon Sep 17 00:00:00 2001 From: holygits Date: Wed, 10 Jan 2024 09:46:44 +0800 Subject: [PATCH] Update to drift v2.53.0 --- Cargo.lock | 15 +++++++++++++-- programs/jit-proxy/Cargo.toml | 2 +- programs/jit-proxy/src/instructions/arb_perp.rs | 2 +- programs/jit-proxy/src/instructions/jit.rs | 2 +- programs/jit-proxy/src/state.rs | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6757b9..2ca8eb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -636,8 +636,8 @@ dependencies = [ [[package]] name = "drift" -version = "2.41.0" -source = "git+https://github.com/drift-labs/protocol-v2.git?rev=e5cdd4#e5cdd497bec48e83e8b9d99dc67e1493d82940a9" +version = "2.53.0" +source = "git+https://github.com/drift-labs/protocol-v2.git?tag=v2.53.0#376187a77283ae8095027a48e4a75a2511c33b12" dependencies = [ "anchor-lang", "anchor-spl", @@ -645,6 +645,7 @@ dependencies = [ "base64 0.13.0", "borsh", "bytemuck", + "drift-macros", "enumflags2", "num-derive", "num-integer", @@ -654,10 +655,20 @@ dependencies = [ "serum_dex", "solana-program", "solana-security-txt", + "static_assertions", "thiserror", "uint", ] +[[package]] +name = "drift-macros" +version = "0.1.0" +source = "git+https://github.com/drift-labs/drift-macros.git?rev=c57d87#c57d87e073d13d43f4d1fb09fe6822915a4ccc11" +dependencies = [ + "quote", + "syn 1.0.92", +] + [[package]] name = "ed25519" version = "1.5.3" diff --git a/programs/jit-proxy/Cargo.toml b/programs/jit-proxy/Cargo.toml index c3055e3..f712f75 100644 --- a/programs/jit-proxy/Cargo.toml +++ b/programs/jit-proxy/Cargo.toml @@ -16,6 +16,6 @@ default = [] [dependencies] anchor-lang = "0.27.0" anchor-spl = "0.27.0" -drift = { git = "https://github.com/drift-labs/protocol-v2.git", rev = "e5cdd4", features = ["cpi", "mainnet-beta"]} bytemuck = { version = "1.4.0" } +drift = { git = "https://github.com/drift-labs/protocol-v2.git", tag = "v2.53.0", features = ["cpi", "mainnet-beta"]} static_assertions = "1.1.0" diff --git a/programs/jit-proxy/src/instructions/arb_perp.rs b/programs/jit-proxy/src/instructions/arb_perp.rs index 0475a7b..5bf1b13 100644 --- a/programs/jit-proxy/src/instructions/arb_perp.rs +++ b/programs/jit-proxy/src/instructions/arb_perp.rs @@ -3,12 +3,12 @@ use drift::controller::position::PositionDirection; use drift::cpi::accounts::PlaceAndTake; use drift::error::DriftResult; use drift::instructions::optional_accounts::{load_maps, AccountMaps}; -use drift::instructions::{OrderParams, PostOnlyParam}; use drift::math::casting::Cast; use drift::math::constants::{BASE_PRECISION, MARGIN_PRECISION_U128, QUOTE_PRECISION}; use drift::math::margin::MarginRequirementType; use drift::program::Drift; use drift::state::perp_market_map::MarketSet; +use drift::state::order_params::{OrderParams, PostOnlyParam}; use std::ops::Deref; use drift::math::orders::find_bids_and_asks_from_users; diff --git a/programs/jit-proxy/src/instructions/jit.rs b/programs/jit-proxy/src/instructions/jit.rs index c487c9f..a142f62 100644 --- a/programs/jit-proxy/src/instructions/jit.rs +++ b/programs/jit-proxy/src/instructions/jit.rs @@ -3,10 +3,10 @@ use drift::controller::position::PositionDirection; use drift::cpi::accounts::PlaceAndMake; use drift::error::DriftResult; use drift::instructions::optional_accounts::{load_maps, AccountMaps}; -use drift::instructions::OrderParams; use drift::math::casting::Cast; use drift::math::safe_math::SafeMath; use drift::program::Drift; +use drift::state::order_params::OrderParams; use drift::state::perp_market_map::MarketSet; use drift::state::state::State; use drift::state::user::{MarketType as DriftMarketType, OrderTriggerCondition, OrderType}; diff --git a/programs/jit-proxy/src/state.rs b/programs/jit-proxy/src/state.rs index 4620cb7..677fc07 100644 --- a/programs/jit-proxy/src/state.rs +++ b/programs/jit-proxy/src/state.rs @@ -1,6 +1,6 @@ use anchor_lang::prelude::*; use borsh::{BorshDeserialize, BorshSerialize}; -use drift::instructions::PostOnlyParam as DriftPostOnlyParam; +use drift::state::order_params::PostOnlyParam as DriftPostOnlyParam; use drift::state::user::MarketType as DriftMarketType; #[derive(Clone, Copy, BorshSerialize, BorshDeserialize, PartialEq, Debug, Eq)]