From e8a380f4727f070f818d4fc722a38ddfbec8173f Mon Sep 17 00:00:00 2001 From: adpthegreat Date: Thu, 12 Sep 2024 10:13:56 -0400 Subject: [PATCH] -Changed switchboard-v2 to switchboard-solana -Updated dependencies - prettier --- .../verifiable-randomness-functions.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/content/courses/connecting-to-offchain-data/verifiable-randomness-functions.md b/content/courses/connecting-to-offchain-data/verifiable-randomness-functions.md index 8bb80f50a..d2be270b7 100644 --- a/content/courses/connecting-to-offchain-data/verifiable-randomness-functions.md +++ b/content/courses/connecting-to-offchain-data/verifiable-randomness-functions.md @@ -322,14 +322,14 @@ context. That’s all the accounts needed for just the randomness request, now let's see what it looks like in a Solana program via CPI. To do this, we make use of the `VrfRequestRandomness` data struct from the -[SwitchboardV2 rust crate.](https://github.com/switchboard-xyz/solana-sdk/blob/main/rust/switchboard-solana/src/oracle_program/instructions/vrf_request_randomness.rs) +[Switchboard-Solana rust crate.](https://github.com/switchboard-xyz/solana-sdk/blob/main/rust/switchboard-solana/src/oracle_program/instructions/vrf_request_randomness.rs) This struct has some built-in capabilities to make our lives easier here, most notably the account structure is defined for us and we can easily call `invoke` or `invoke_signed` on the object. ```rust // our client program -use switchboard_v2::VrfRequestRandomness; +use switchboard_solana::VrfRequestRandomness; use state::*; pub fn request_randomness(ctx: Context, request_params: RequestRandomnessParams) -> Result <()> { @@ -482,9 +482,9 @@ in our `Cargo.toml` file. ```typescript [dependencies] -anchor-lang = "0.28.0" -anchor-spl = "0.28.0" -switchboard-v2 = "0.4.0" +anchor-lang = "0.29.0" +anchor-spl = "0.29.0" +switchboard-solana = "0.29" ``` ### 3. Lib.rs @@ -738,7 +738,7 @@ the following accounts: use crate::state::*; use crate::errors::*; use anchor_lang::prelude::*; -use switchboard_v2::VrfAccountData; +use switchboard_solana::VrfAccountData; pub const ANCHOR_DISCRIMINATOR: usize = 8; @@ -1016,7 +1016,7 @@ three accounts. use crate::state::*; use crate::errors::*; use anchor_lang::prelude::*; -use switchboard_v2::VrfAccountData; +use switchboard_solana::VrfAccountData; #[derive(Accounts)] pub struct ConsumeRandomness<'info> { @@ -1211,13 +1211,13 @@ file: ```toml ## VRF ACCOUNTS -[[test.validator.clone]] # Sbv2 attestation programID +[[test.validator.clone]] # Switchboard solana attestation programID address = "sbattyXrzedoNATfc4L31wC9Mhxsi1BmFhTiN8gDshx" -[[test.validator.clone]] # Sbv2 attestation IDL +[[test.validator.clone]] # Switchboard solana attestation IDL address = "5ExuoQR69trmKQfB95fDsUGsUrrChbGq9PFgt8qouncz" -[[test.validator.clone]] # Sbv2 SbState +[[test.validator.clone]] # Switchboard solana SbState address = "CyZuD7RPDcrqCGbNvLCyqk6Py9cEZTKmNKujfPi3ynDd" ```