Skip to content

Commit 6b254ed

Browse files
authored
Update/v2.107.0 (#90)
* update for v2.107.0 program compatibility
1 parent 4368ba5 commit 6b254ed

File tree

5 files changed

+132
-40
lines changed

5 files changed

+132
-40
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ jobs:
4848
rustup component add clippy rustfmt
4949
- name: install libdrift_ffi_sys
5050
run: |
51-
curl -L https://github.com/drift-labs/drift-ffi-sys/releases/download/v2.105.0/libdrift_ffi_sys.so > libdrift_ffi_sys.so
52-
ldd libdrift_ffi_sys.so
51+
curl -L https://github.com/drift-labs/drift-ffi-sys/releases/download/v2.107.0/libdrift_ffi_sys.so > libdrift_ffi_sys.so
5352
sudo cp libdrift_ffi_sys.so $CARGO_DRIFT_FFI_PATH
54-
ldconfig -p
5553
- name: Format
5654
run: cargo fmt --all -- --check
5755
- name: Build

crates/drift-ffi-sys

crates/src/constants.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ pub fn oracle_source_to_owner(context: Context, source: OracleSource) -> Pubkey
199199
OracleSource::SwitchboardOnDemand => ids::switchboard_on_demand::ID,
200200
OracleSource::QuoteAsset => DEFAULT_PUBKEY,
201201
OracleSource::Prelaunch | OracleSource::PythLazer => PROGRAM_ID,
202+
OracleSource::PythLazer1K | OracleSource::PythLazer1M => {
203+
ids::drift_oracle_receiver_program::ID
204+
}
202205
}
203206
}
204207

crates/src/drift_idl.rs

Lines changed: 85 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,6 +1985,7 @@ pub mod instructions {
19851985
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
19861986
pub struct InitializePythLazerOracle {
19871987
pub feed_id: u32,
1988+
pub exponent: i32,
19881989
}
19891990
#[automatically_derived]
19901991
impl anchor_lang::Discriminator for InitializePythLazerOracle {
@@ -1993,6 +1994,17 @@ pub mod instructions {
19931994
#[automatically_derived]
19941995
impl anchor_lang::InstructionData for InitializePythLazerOracle {}
19951996
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
1997+
pub struct UpdatePythLazerOracleExponent {
1998+
pub feed_id: u32,
1999+
pub exponent: i32,
2000+
}
2001+
#[automatically_derived]
2002+
impl anchor_lang::Discriminator for UpdatePythLazerOracleExponent {
2003+
const DISCRIMINATOR: [u8; 8] = [80, 30, 57, 83, 39, 183, 97, 185];
2004+
}
2005+
#[automatically_derived]
2006+
impl anchor_lang::InstructionData for UpdatePythLazerOracleExponent {}
2007+
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
19962008
pub struct PostPythLazerOracleUpdate {
19972009
pub pyth_message: Vec<u8>,
19982010
}
@@ -3447,6 +3459,8 @@ pub mod types {
34473459
PythStableCoinPull,
34483460
SwitchboardOnDemand,
34493461
PythLazer,
3462+
PythLazer1K,
3463+
PythLazer1M,
34503464
}
34513465
#[derive(
34523466
AnchorSerialize,
@@ -4849,7 +4863,7 @@ pub mod accounts {
48494863
AnchorSerialize, AnchorDeserialize, Serialize, Deserialize, Clone, Default, Debug, PartialEq,
48504864
)]
48514865
pub struct SwiftUserOrders {
4852-
pub user_pubkey: Pubkey,
4866+
pub authority_pubkey: Pubkey,
48534867
pub padding: u32,
48544868
pub swift_order_data: Vec<SwiftOrderId>,
48554869
}
@@ -5385,7 +5399,6 @@ pub mod accounts {
53855399
pub struct InitializeSwiftUserOrders {
53865400
pub swift_user_orders: Pubkey,
53875401
pub authority: Pubkey,
5388-
pub user: Pubkey,
53895402
pub payer: Pubkey,
53905403
pub rent: Pubkey,
53915404
pub system_program: Pubkey,
@@ -5416,11 +5429,6 @@ pub mod accounts {
54165429
is_signer: true,
54175430
is_writable: false,
54185431
},
5419-
AccountMeta {
5420-
pubkey: self.user,
5421-
is_signer: false,
5422-
is_writable: false,
5423-
},
54245432
AccountMeta {
54255433
pubkey: self.payer,
54265434
is_signer: true,
@@ -5473,7 +5481,6 @@ pub mod accounts {
54735481
pub struct ResizeSwiftUserOrders {
54745482
pub swift_user_orders: Pubkey,
54755483
pub authority: Pubkey,
5476-
pub user: Pubkey,
54775484
pub system_program: Pubkey,
54785485
}
54795486
#[automatically_derived]
@@ -5502,11 +5509,6 @@ pub mod accounts {
55025509
is_signer: true,
55035510
is_writable: true,
55045511
},
5505-
AccountMeta {
5506-
pubkey: self.user,
5507-
is_signer: false,
5508-
is_writable: false,
5509-
},
55105512
AccountMeta {
55115513
pubkey: self.system_program,
55125514
is_signer: false,
@@ -8273,7 +8275,6 @@ pub mod accounts {
82738275
#[repr(C)]
82748276
#[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
82758277
pub struct DeleteSwiftUserOrders {
8276-
pub user: Pubkey,
82778278
pub swift_user_orders: Pubkey,
82788279
pub state: Pubkey,
82798280
pub authority: Pubkey,
@@ -8294,11 +8295,6 @@ pub mod accounts {
82948295
impl ToAccountMetas for DeleteSwiftUserOrders {
82958296
fn to_account_metas(&self) -> Vec<AccountMeta> {
82968297
vec![
8297-
AccountMeta {
8298-
pubkey: self.user,
8299-
is_signer: false,
8300-
is_writable: true,
8301-
},
83028298
AccountMeta {
83038299
pubkey: self.swift_user_orders,
83048300
is_signer: false,
@@ -19701,6 +19697,76 @@ pub mod accounts {
1970119697
}
1970219698
#[repr(C)]
1970319699
#[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
19700+
pub struct UpdatePythLazerOracleExponent {
19701+
pub admin: Pubkey,
19702+
pub lazer_oracle: Pubkey,
19703+
pub state: Pubkey,
19704+
}
19705+
#[automatically_derived]
19706+
impl anchor_lang::Discriminator for UpdatePythLazerOracleExponent {
19707+
const DISCRIMINATOR: [u8; 8] = [123, 11, 72, 80, 41, 152, 104, 72];
19708+
}
19709+
#[automatically_derived]
19710+
unsafe impl anchor_lang::__private::bytemuck::Pod for UpdatePythLazerOracleExponent {}
19711+
#[automatically_derived]
19712+
unsafe impl anchor_lang::__private::bytemuck::Zeroable for UpdatePythLazerOracleExponent {}
19713+
#[automatically_derived]
19714+
impl anchor_lang::ZeroCopy for UpdatePythLazerOracleExponent {}
19715+
#[automatically_derived]
19716+
impl anchor_lang::InstructionData for UpdatePythLazerOracleExponent {}
19717+
#[automatically_derived]
19718+
impl ToAccountMetas for UpdatePythLazerOracleExponent {
19719+
fn to_account_metas(&self) -> Vec<AccountMeta> {
19720+
vec![
19721+
AccountMeta {
19722+
pubkey: self.admin,
19723+
is_signer: true,
19724+
is_writable: true,
19725+
},
19726+
AccountMeta {
19727+
pubkey: self.lazer_oracle,
19728+
is_signer: false,
19729+
is_writable: true,
19730+
},
19731+
AccountMeta {
19732+
pubkey: self.state,
19733+
is_signer: false,
19734+
is_writable: false,
19735+
},
19736+
]
19737+
}
19738+
}
19739+
#[automatically_derived]
19740+
impl anchor_lang::AccountSerialize for UpdatePythLazerOracleExponent {
19741+
fn try_serialize<W: std::io::Write>(&self, writer: &mut W) -> anchor_lang::Result<()> {
19742+
if writer.write_all(&Self::DISCRIMINATOR).is_err() {
19743+
return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19744+
}
19745+
if AnchorSerialize::serialize(self, writer).is_err() {
19746+
return Err(anchor_lang::error::ErrorCode::AccountDidNotSerialize.into());
19747+
}
19748+
Ok(())
19749+
}
19750+
}
19751+
#[automatically_derived]
19752+
impl anchor_lang::AccountDeserialize for UpdatePythLazerOracleExponent {
19753+
fn try_deserialize(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19754+
let given_disc = &buf[..8];
19755+
if Self::DISCRIMINATOR != given_disc {
19756+
return Err(anchor_lang::error!(
19757+
anchor_lang::error::ErrorCode::AccountDiscriminatorMismatch
19758+
));
19759+
}
19760+
Self::try_deserialize_unchecked(buf)
19761+
}
19762+
fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
19763+
let mut data: &[u8] = &buf[8..];
19764+
AnchorDeserialize::deserialize(&mut data)
19765+
.map_err(|_| anchor_lang::error::ErrorCode::AccountDidNotDeserialize.into())
19766+
}
19767+
}
19768+
#[repr(C)]
19769+
#[derive(Copy, Clone, Default, AnchorSerialize, AnchorDeserialize, Serialize, Deserialize)]
1970419770
pub struct PostPythLazerOracleUpdate {
1970519771
pub keeper: Pubkey,
1970619772
pub pyth_lazer_storage: Pubkey,

res/drift.json

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.106.0",
2+
"version": "2.107.0",
33
"name": "drift",
44
"instructions": [
55
{
@@ -142,11 +142,6 @@
142142
"isMut": false,
143143
"isSigner": true
144144
},
145-
{
146-
"name": "user",
147-
"isMut": false,
148-
"isSigner": false
149-
},
150145
{
151146
"name": "payer",
152147
"isMut": true,
@@ -183,11 +178,6 @@
183178
"isMut": true,
184179
"isSigner": true
185180
},
186-
{
187-
"name": "user",
188-
"isMut": false,
189-
"isSigner": false
190-
},
191181
{
192182
"name": "systemProgram",
193183
"isMut": false,
@@ -1553,11 +1543,6 @@
15531543
{
15541544
"name": "deleteSwiftUserOrders",
15551545
"accounts": [
1556-
{
1557-
"name": "user",
1558-
"isMut": true,
1559-
"isSigner": false
1560-
},
15611546
{
15621547
"name": "swiftUserOrders",
15631548
"isMut": true,
@@ -6682,6 +6667,40 @@
66826667
{
66836668
"name": "feedId",
66846669
"type": "u32"
6670+
},
6671+
{
6672+
"name": "exponent",
6673+
"type": "i32"
6674+
}
6675+
]
6676+
},
6677+
{
6678+
"name": "updatePythLazerOracleExponent",
6679+
"accounts": [
6680+
{
6681+
"name": "admin",
6682+
"isMut": true,
6683+
"isSigner": true
6684+
},
6685+
{
6686+
"name": "lazerOracle",
6687+
"isMut": true,
6688+
"isSigner": false
6689+
},
6690+
{
6691+
"name": "state",
6692+
"isMut": false,
6693+
"isSigner": false
6694+
}
6695+
],
6696+
"args": [
6697+
{
6698+
"name": "feedId",
6699+
"type": "u32"
6700+
},
6701+
{
6702+
"name": "exponent",
6703+
"type": "i32"
66856704
}
66866705
]
66876706
},
@@ -8212,7 +8231,7 @@
82128231
"kind": "struct",
82138232
"fields": [
82148233
{
8215-
"name": "userPubkey",
8234+
"name": "authorityPubkey",
82168235
"type": "publicKey"
82178236
},
82188237
{
@@ -11471,6 +11490,12 @@
1147111490
},
1147211491
{
1147311492
"name": "PythLazer"
11493+
},
11494+
{
11495+
"name": "PythLazer1K"
11496+
},
11497+
{
11498+
"name": "PythLazer1M"
1147411499
}
1147511500
]
1147611501
}

0 commit comments

Comments
 (0)