Skip to content

Commit 404a909

Browse files
authored
fix: support for anchor 0.32.1 (#31)
* fix: support for anchor 0.32.1 * change to non-optional * formatting * add back featuring * format * oops * update run-tests * update versions * tick anchor to 0.32.1 * pls * version-align
1 parent ae2d7ef commit 404a909

File tree

5 files changed

+23
-12
lines changed

5 files changed

+23
-12
lines changed

.github/packages/npm-package/package.json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@magicblock-labs/${node_pkg}",
33
"description": "MagicBlock Ephemeral VRF Oracle (${node_pkg})",
4-
"version": "0.2.0",
4+
"version": "0.2.1",
55
"repository": {
66
"type": "git",
77
"url": "git+https://github.com/magicblock-labs/ephemeral-vrf.git"

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resolver = "2"
33
members = ["api", "program", "sdk", "src", "vrf", "vrf-cli", "vrf-oracle"]
44

55
[workspace.package]
6-
version = "0.2.0"
6+
version = "0.2.1"
77
edition = "2021"
88
license = "Business Source License 1.1"
99
authors = ["MagicBlock Labs <[email protected]>"]
@@ -26,9 +26,9 @@ crossbeam-channel = "0.5.15"
2626
curve25519-dalek = { version = "4.1.3", default-features = false }
2727
env_logger = "0.11.7"
2828
ephemeral-rollups-sdk = "0.2.4"
29-
ephemeral-vrf = { path = "./vrf", version = "0.2.0" }
30-
ephemeral-vrf-api = { path = "./api", version = "0.2.0" }
31-
ephemeral-vrf-sdk-vrf-macro = { path = "sdk/vrf-macro", version = "0.2.0" }
29+
ephemeral-vrf = { path = "./vrf", version = "0.2.1" }
30+
ephemeral-vrf-api = { path = "./api", version = "0.2.1" }
31+
ephemeral-vrf-sdk-vrf-macro = { path = "sdk/vrf-macro", version = "0.2.1" }
3232
futures = "0.3.31"
3333
futures-core = "0.3.31"
3434
futures-util = "0.3.31"

sdk/src/anchor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub struct VrfProgram;
99

1010
#[cfg(feature = "anchor")]
1111
impl anchor_lang::Id for VrfProgram {
12-
fn id() -> ::solana_program::pubkey::Pubkey {
12+
fn id() -> anchor_lang::prelude::Pubkey {
1313
crate::consts::VRF_PROGRAM_ID
1414
}
1515
}

sdk/src/instructions.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::consts;
2+
use crate::solana::{system_program, Pubkey};
23
use crate::types::{RequestRandomness, SerializableAccountMeta};
3-
use ::solana_program::pubkey::Pubkey;
44

55
/// Parameters for creating a request randomness instruction
66
#[derive(Default)]
@@ -26,10 +26,7 @@ pub fn create_request_randomness_ix(
2626
true,
2727
),
2828
solana_program::instruction::AccountMeta::new(params.oracle_queue, false),
29-
solana_program::instruction::AccountMeta::new_readonly(
30-
solana_program::system_program::ID,
31-
false,
32-
),
29+
solana_program::instruction::AccountMeta::new_readonly(system_program::ID, false),
3330
solana_program::instruction::AccountMeta::new_readonly(
3431
solana_program::sysvar::slot_hashes::ID,
3532
false,

sdk/src/lib.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ pub mod pda;
66
pub mod rnd;
77
pub mod types;
88

9-
pub const fn id() -> ::solana_program::pubkey::Pubkey {
9+
#[cfg(not(feature = "anchor"))]
10+
mod solana {
11+
pub use solana_program::pubkey::Pubkey;
12+
pub use solana_program::system_program;
13+
}
14+
15+
#[cfg(feature = "anchor")]
16+
mod solana {
17+
pub use anchor_lang::prelude::Pubkey;
18+
pub use anchor_lang::system_program;
19+
}
20+
21+
pub use solana::Pubkey;
22+
23+
pub const fn id() -> Pubkey {
1024
consts::VRF_PROGRAM_ID
1125
}

0 commit comments

Comments
 (0)