chore: Upgrade Anchor to 0.26.0
This commit is contained in:
parent
55b5ea2390
commit
fd850016e6
File diff suppressed because it is too large
Load Diff
|
@ -6,7 +6,7 @@ edition = "2021"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
voter-stake-registry = { path = "../programs/voter-stake-registry", features = ["no-entrypoint"] }
|
voter-stake-registry = { path = "../programs/voter-stake-registry", features = ["no-entrypoint"] }
|
||||||
|
|
||||||
anchor-lang = "0.24.2"
|
anchor-lang = "0.26.0"
|
||||||
|
|
||||||
serde = "^1.0"
|
serde = "^1.0"
|
||||||
serde_json = "^1.0"
|
serde_json = "^1.0"
|
||||||
|
|
|
@ -21,8 +21,8 @@ test-bpf = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# a) for deployment use these
|
# a) for deployment use these
|
||||||
anchor-lang = { version = "0.24.2", features = ["init-if-needed"] }
|
anchor-lang = { version = "0.26.0", features = ["init-if-needed"] }
|
||||||
anchor-spl = { version = "0.24.2" }
|
anchor-spl = { version = "0.26.0" }
|
||||||
# b) while testing, use below dependencies for debugging instead of above ones
|
# b) while testing, use below dependencies for debugging instead of above ones
|
||||||
# anchor-lang = { git = "https://github.com/microwavedcola1/anchor.git", branch = "master-debug" }
|
# anchor-lang = { git = "https://github.com/microwavedcola1/anchor.git", branch = "master-debug" }
|
||||||
# anchor-spl = { git = "https://github.com/microwavedcola1/anchor.git", branch = "master-debug", features = ["governance"]}
|
# anchor-spl = { git = "https://github.com/microwavedcola1/anchor.git", branch = "master-debug", features = ["governance"]}
|
||||||
|
@ -39,13 +39,13 @@ bytemuck = "1.9.1"
|
||||||
spl-governance = { version = "=2.2.1", features = ["no-entrypoint"] }
|
spl-governance = { version = "=2.2.1", features = ["no-entrypoint"] }
|
||||||
spl-governance-addin-api = "=0.1.1"
|
spl-governance-addin-api = "=0.1.1"
|
||||||
|
|
||||||
solana-program = "~1.9.13"
|
solana-program = "1.14.10"
|
||||||
static_assertions = "1.1"
|
static_assertions = "1.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
solana-sdk = "~1.9.13"
|
solana-sdk = "1.14.10"
|
||||||
solana-program-test = "~1.9.13"
|
solana-program-test = "1.14.10"
|
||||||
solana-logger = "~1.9.13"
|
solana-logger = "1.14.10"
|
||||||
spl-token = { version = "^3.0.0", features = ["no-entrypoint"] }
|
spl-token = { version = "^3.0.0", features = ["no-entrypoint"] }
|
||||||
spl-associated-token-account = { version = "^1.0.3", features = ["no-entrypoint"] }
|
spl-associated-token-account = { version = "^1.0.3", features = ["no-entrypoint"] }
|
||||||
bytemuck = "^1.7.2"
|
bytemuck = "^1.7.2"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
use solana_sdk::transport::TransportError;
|
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
instruction::Instruction,
|
instruction::Instruction,
|
||||||
signature::{Keypair, Signer},
|
signature::{Keypair, Signer},
|
||||||
|
@ -234,7 +234,7 @@ impl AddinCookie {
|
||||||
start_ts: Option<u64>,
|
start_ts: Option<u64>,
|
||||||
periods: u32,
|
periods: u32,
|
||||||
allow_clawback: bool,
|
allow_clawback: bool,
|
||||||
) -> std::result::Result<(), TransportError> {
|
) -> std::result::Result<(), BanksClientError> {
|
||||||
let vault = voter.vault_address(&voting_mint);
|
let vault = voter.vault_address(&voting_mint);
|
||||||
|
|
||||||
let data = anchor_lang::InstructionData::data(
|
let data = anchor_lang::InstructionData::data(
|
||||||
|
@ -287,7 +287,7 @@ impl AddinCookie {
|
||||||
token_address: Pubkey,
|
token_address: Pubkey,
|
||||||
deposit_entry_index: u8,
|
deposit_entry_index: u8,
|
||||||
amount: u64,
|
amount: u64,
|
||||||
) -> std::result::Result<(), TransportError> {
|
) -> std::result::Result<(), BanksClientError> {
|
||||||
let vault = voter.vault_address(&voting_mint);
|
let vault = voter.vault_address(&voting_mint);
|
||||||
|
|
||||||
let data =
|
let data =
|
||||||
|
@ -336,7 +336,7 @@ impl AddinCookie {
|
||||||
deposit_token: Pubkey,
|
deposit_token: Pubkey,
|
||||||
token_authority: &Keypair,
|
token_authority: &Keypair,
|
||||||
grant_authority: &Keypair,
|
grant_authority: &Keypair,
|
||||||
) -> std::result::Result<VoterCookie, TransportError> {
|
) -> std::result::Result<VoterCookie, BanksClientError> {
|
||||||
let (voter, voter_bump) = Pubkey::find_program_address(
|
let (voter, voter_bump) = Pubkey::find_program_address(
|
||||||
&[
|
&[
|
||||||
®istrar.address.to_bytes(),
|
®istrar.address.to_bytes(),
|
||||||
|
@ -417,7 +417,7 @@ impl AddinCookie {
|
||||||
realm_authority: &Keypair,
|
realm_authority: &Keypair,
|
||||||
token_address: Pubkey,
|
token_address: Pubkey,
|
||||||
deposit_entry_index: u8,
|
deposit_entry_index: u8,
|
||||||
) -> std::result::Result<(), TransportError> {
|
) -> std::result::Result<(), BanksClientError> {
|
||||||
let vault = voter.vault_address(&voting_mint);
|
let vault = voter.vault_address(&voting_mint);
|
||||||
|
|
||||||
let data =
|
let data =
|
||||||
|
@ -461,7 +461,7 @@ impl AddinCookie {
|
||||||
token_address: Pubkey,
|
token_address: Pubkey,
|
||||||
deposit_entry_index: u8,
|
deposit_entry_index: u8,
|
||||||
amount: u64,
|
amount: u64,
|
||||||
) -> std::result::Result<(), TransportError> {
|
) -> std::result::Result<(), BanksClientError> {
|
||||||
let vault = voter.vault_address(&voting_mint);
|
let vault = voter.vault_address(&voting_mint);
|
||||||
|
|
||||||
let data =
|
let data =
|
||||||
|
@ -505,7 +505,7 @@ impl AddinCookie {
|
||||||
voter: &VoterCookie,
|
voter: &VoterCookie,
|
||||||
voting_mint: &VotingMintConfigCookie,
|
voting_mint: &VotingMintConfigCookie,
|
||||||
voter_authority: &Keypair,
|
voter_authority: &Keypair,
|
||||||
) -> std::result::Result<(), TransportError> {
|
) -> std::result::Result<(), BanksClientError> {
|
||||||
let vault = voter.vault_address(&voting_mint);
|
let vault = voter.vault_address(&voting_mint);
|
||||||
|
|
||||||
let data =
|
let data =
|
||||||
|
@ -568,7 +568,7 @@ impl AddinCookie {
|
||||||
&self,
|
&self,
|
||||||
registrar: &RegistrarCookie,
|
registrar: &RegistrarCookie,
|
||||||
voter: &VoterCookie,
|
voter: &VoterCookie,
|
||||||
) -> std::result::Result<voter_stake_registry::state::VoterWeightRecord, TransportError> {
|
) -> std::result::Result<voter_stake_registry::state::VoterWeightRecord, BanksClientError> {
|
||||||
let instructions = vec![self.update_voter_weight_record_instruction(registrar, voter)];
|
let instructions = vec![self.update_voter_weight_record_instruction(registrar, voter)];
|
||||||
|
|
||||||
self.solana.process_transaction(&instructions, None).await?;
|
self.solana.process_transaction(&instructions, None).await?;
|
||||||
|
@ -587,7 +587,7 @@ impl AddinCookie {
|
||||||
voter: &VoterCookie,
|
voter: &VoterCookie,
|
||||||
authority: &Keypair,
|
authority: &Keypair,
|
||||||
deposit_entry_index: u8,
|
deposit_entry_index: u8,
|
||||||
) -> Result<(), TransportError> {
|
) -> Result<(), BanksClientError> {
|
||||||
let data = anchor_lang::InstructionData::data(
|
let data = anchor_lang::InstructionData::data(
|
||||||
&voter_stake_registry::instruction::CloseDepositEntry {
|
&voter_stake_registry::instruction::CloseDepositEntry {
|
||||||
deposit_entry_index,
|
deposit_entry_index,
|
||||||
|
@ -625,7 +625,7 @@ impl AddinCookie {
|
||||||
deposit_entry_index: u8,
|
deposit_entry_index: u8,
|
||||||
kind: voter_stake_registry::state::LockupKind,
|
kind: voter_stake_registry::state::LockupKind,
|
||||||
periods: u32,
|
periods: u32,
|
||||||
) -> Result<(), TransportError> {
|
) -> Result<(), BanksClientError> {
|
||||||
let data =
|
let data =
|
||||||
anchor_lang::InstructionData::data(&voter_stake_registry::instruction::ResetLockup {
|
anchor_lang::InstructionData::data(&voter_stake_registry::instruction::ResetLockup {
|
||||||
deposit_entry_index,
|
deposit_entry_index,
|
||||||
|
@ -665,7 +665,7 @@ impl AddinCookie {
|
||||||
source_deposit_entry_index: u8,
|
source_deposit_entry_index: u8,
|
||||||
target_deposit_entry_index: u8,
|
target_deposit_entry_index: u8,
|
||||||
amount: u64,
|
amount: u64,
|
||||||
) -> Result<(), TransportError> {
|
) -> Result<(), BanksClientError> {
|
||||||
let data = anchor_lang::InstructionData::data(
|
let data = anchor_lang::InstructionData::data(
|
||||||
&voter_stake_registry::instruction::InternalTransferLocked {
|
&voter_stake_registry::instruction::InternalTransferLocked {
|
||||||
source_deposit_entry_index,
|
source_deposit_entry_index,
|
||||||
|
@ -706,7 +706,7 @@ impl AddinCookie {
|
||||||
source_deposit_entry_index: u8,
|
source_deposit_entry_index: u8,
|
||||||
target_deposit_entry_index: u8,
|
target_deposit_entry_index: u8,
|
||||||
amount: u64,
|
amount: u64,
|
||||||
) -> Result<(), TransportError> {
|
) -> Result<(), BanksClientError> {
|
||||||
let data = anchor_lang::InstructionData::data(
|
let data = anchor_lang::InstructionData::data(
|
||||||
&voter_stake_registry::instruction::InternalTransferUnlocked {
|
&voter_stake_registry::instruction::InternalTransferUnlocked {
|
||||||
source_deposit_entry_index,
|
source_deposit_entry_index,
|
||||||
|
|
|
@ -258,7 +258,7 @@ impl GovernanceRealmCookie {
|
||||||
voter: &VoterCookie,
|
voter: &VoterCookie,
|
||||||
payer: &Keypair,
|
payer: &Keypair,
|
||||||
vwr_instruction: Instruction,
|
vwr_instruction: Instruction,
|
||||||
) -> std::result::Result<ProposalCookie, TransportError> {
|
) -> std::result::Result<ProposalCookie, BanksClientError> {
|
||||||
let proposal = spl_governance::state::proposal::get_proposal_address(
|
let proposal = spl_governance::state::proposal::get_proposal_address(
|
||||||
&self.governance.program_id,
|
&self.governance.program_id,
|
||||||
&governance,
|
&governance,
|
||||||
|
@ -325,7 +325,7 @@ impl GovernanceRealmCookie {
|
||||||
authority: &Keypair,
|
authority: &Keypair,
|
||||||
payer: &Keypair,
|
payer: &Keypair,
|
||||||
vwr_instruction: Instruction,
|
vwr_instruction: Instruction,
|
||||||
) -> std::result::Result<(), TransportError> {
|
) -> std::result::Result<(), BanksClientError> {
|
||||||
let instructions = vec![
|
let instructions = vec![
|
||||||
vwr_instruction,
|
vwr_instruction,
|
||||||
spl_governance::instruction::cast_vote(
|
spl_governance::instruction::cast_vote(
|
||||||
|
@ -364,7 +364,7 @@ impl GovernanceRealmCookie {
|
||||||
token_owner_record: Pubkey,
|
token_owner_record: Pubkey,
|
||||||
authority: &Keypair,
|
authority: &Keypair,
|
||||||
beneficiary: Pubkey,
|
beneficiary: Pubkey,
|
||||||
) -> std::result::Result<(), TransportError> {
|
) -> std::result::Result<(), BanksClientError> {
|
||||||
let instructions = vec![spl_governance::instruction::relinquish_vote(
|
let instructions = vec![spl_governance::instruction::relinquish_vote(
|
||||||
&self.governance.program_id,
|
&self.governance.program_id,
|
||||||
&governance,
|
&governance,
|
||||||
|
|
|
@ -11,7 +11,6 @@ use solana_sdk::{
|
||||||
pubkey::Pubkey,
|
pubkey::Pubkey,
|
||||||
signature::{Keypair, Signer},
|
signature::{Keypair, Signer},
|
||||||
transaction::Transaction,
|
transaction::Transaction,
|
||||||
transport::TransportError,
|
|
||||||
};
|
};
|
||||||
use spl_token::*;
|
use spl_token::*;
|
||||||
|
|
||||||
|
@ -27,7 +26,7 @@ impl SolanaCookie {
|
||||||
&self,
|
&self,
|
||||||
instructions: &[Instruction],
|
instructions: &[Instruction],
|
||||||
signers: Option<&[&Keypair]>,
|
signers: Option<&[&Keypair]>,
|
||||||
) -> Result<(), TransportError> {
|
) -> Result<(), BanksClientError> {
|
||||||
*self.program_output.write().unwrap() = super::ProgramOutput::default();
|
*self.program_output.write().unwrap() = super::ProgramOutput::default();
|
||||||
|
|
||||||
let mut context = self.context.borrow_mut();
|
let mut context = self.context.borrow_mut();
|
||||||
|
|
Loading…
Reference in New Issue