updated examples
This commit is contained in:
parent
3ffdc92298
commit
f5bfc0d502
|
@ -16,9 +16,9 @@ no-log-ix-name = []
|
||||||
cpi = ["no-entrypoint"]
|
cpi = ["no-entrypoint"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
bytemuck = "1.13.1"
|
||||||
switchboard-solana = { path = "../../../rust/switchboard-solana", version = "0.6.7" }
|
switchboard-solana = { path = "../../../rust/switchboard-solana", version = "0.6.7" }
|
||||||
# switchboard-solana = { version = "^0.5.2", path = "../../../rust/switchboard-solana" }
|
# switchboard-solana = { version = "^0.5.2", path = "../../../rust/switchboard-solana" }
|
||||||
anchor-lang = "^0.28.0"
|
# anchor-lang = "^0.28.0"
|
||||||
anchor-spl = "^0.28.0"
|
# anchor-spl = "^0.28.0"
|
||||||
solana-program = "1.16.1"
|
# solana-program = "1.16.1"
|
||||||
bytemuck = "1.13.1"
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use anchor_lang::prelude::*;
|
|
||||||
use anchor_lang::solana_program::clock;
|
use anchor_lang::solana_program::clock;
|
||||||
use anchor_spl::token::Token;
|
use anchor_spl::token::Token;
|
||||||
pub use switchboard_solana::{VrfLiteAccountData, VrfLiteClose, VrfCloseParams, PERMISSION_SEED};
|
// pub use switchboard_solana::{VrfLiteAccountData, VrfLiteClose, VrfCloseParams, PERMISSION_SEED};
|
||||||
|
|
||||||
#[derive(Accounts)]
|
#[derive(Accounts)]
|
||||||
#[instruction(params: CloseStateParams)]
|
#[instruction(params: CloseStateParams)]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use anchor_lang::prelude::*;
|
// use anchor_lang::prelude::*;
|
||||||
pub use switchboard_solana::VrfLiteAccountData;
|
// pub use switchboard_solana::VrfLiteAccountData;
|
||||||
|
|
||||||
#[derive(Accounts)]
|
#[derive(Accounts)]
|
||||||
#[instruction(params: InitStateParams)]
|
#[instruction(params: InitStateParams)]
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use anchor_lang::prelude::*;
|
// use anchor_lang::prelude::*;
|
||||||
use anchor_lang::solana_program::clock;
|
use anchor_lang::solana_program::clock;
|
||||||
use anchor_spl::token::Token;
|
use anchor_spl::token::Token;
|
||||||
pub use switchboard_solana::{
|
// pub use switchboard_solana::{
|
||||||
OracleQueueAccountData, PermissionAccountData, SbState, VrfLiteAccountData, VrfLiteRequestRandomness,
|
// OracleQueueAccountData, PermissionAccountData, SbState, VrfLiteAccountData, VrfLiteRequestRandomness,
|
||||||
VrfSetCallback,
|
// VrfSetCallback,
|
||||||
};
|
// };
|
||||||
|
|
||||||
#[derive(Accounts)]
|
#[derive(Accounts)]
|
||||||
#[instruction(params: RequestResultParams)] // rpc parameters hint
|
#[instruction(params: RequestResultParams)] // rpc parameters hint
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
pub mod actions;
|
pub mod actions;
|
||||||
pub use actions::*;
|
pub use actions::*;
|
||||||
|
|
||||||
pub use anchor_lang::prelude::*;
|
|
||||||
use anchor_spl::token::TokenAccount;
|
use anchor_spl::token::TokenAccount;
|
||||||
|
pub use switchboard_solana::prelude::*;
|
||||||
|
|
||||||
pub use switchboard_solana::SWITCHBOARD_PROGRAM_ID;
|
pub use switchboard_solana::SWITCHBOARD_PROGRAM_ID;
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@ describe("anchor-vrf-lite-parser test", () => {
|
||||||
const provider = AnchorProvider.env();
|
const provider = AnchorProvider.env();
|
||||||
anchor.setProvider(provider);
|
anchor.setProvider(provider);
|
||||||
|
|
||||||
|
console.log(anchor.workspace);
|
||||||
|
|
||||||
const vrfClientProgram: anchor.Program<AnchorVrfLiteParser> =
|
const vrfClientProgram: anchor.Program<AnchorVrfLiteParser> =
|
||||||
anchor.workspace.AnchorVrfLiteParser;
|
anchor.workspace.AnchorVrfLiteParser;
|
||||||
|
|
||||||
|
@ -76,7 +78,7 @@ describe("anchor-vrf-lite-parser test", () => {
|
||||||
switchboard = await SwitchboardTestContext.loadFromProvider(provider, {
|
switchboard = await SwitchboardTestContext.loadFromProvider(provider, {
|
||||||
// You can provide a keypair to so the PDA schemes dont change between test runs
|
// You can provide a keypair to so the PDA schemes dont change between test runs
|
||||||
name: "Test Queue",
|
name: "Test Queue",
|
||||||
keypair: SwitchboardTestContext.loadKeypair("~/.keypairs/queue.json"),
|
// keypair: SwitchboardTestContext.loadKeypair("~/.keypairs/queue.json"),
|
||||||
queueSize: 10,
|
queueSize: 10,
|
||||||
reward: 0,
|
reward: 0,
|
||||||
minStake: 0,
|
minStake: 0,
|
||||||
|
@ -84,13 +86,13 @@ describe("anchor-vrf-lite-parser test", () => {
|
||||||
unpermissionedFeeds: true,
|
unpermissionedFeeds: true,
|
||||||
unpermissionedVrf: true,
|
unpermissionedVrf: true,
|
||||||
enableBufferRelayers: true,
|
enableBufferRelayers: true,
|
||||||
oracle: {
|
// oracle: {
|
||||||
name: "Test Oracle",
|
// name: "Test Oracle",
|
||||||
enable: true,
|
// enable: true,
|
||||||
stakingWalletKeypair: SwitchboardTestContext.loadKeypair(
|
// stakingWalletKeypair: SwitchboardTestContext.loadKeypair(
|
||||||
"~/.keypairs/oracleWallet.json"
|
// "~/.keypairs/oracleWallet.json"
|
||||||
),
|
// ),
|
||||||
},
|
// },
|
||||||
});
|
});
|
||||||
queueAccount = switchboard.queue;
|
queueAccount = switchboard.queue;
|
||||||
queue = await queueAccount.loadData();
|
queue = await queueAccount.loadData();
|
||||||
|
|
Loading…
Reference in New Issue