Skip to content

Commit

Permalink
Update anchor v0.14.0 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
armaniferrante authored Sep 4, 2021
1 parent 7445b7a commit 64f3444
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ rust:
env:
global:
- NODE_VERSION="v14.7.0"
- SOLANA_VERSION="v1.7.8"
- ANCHOR_VERSION="v0.13.0"
- SOLANA_VERSION="v1.7.11"
- ANCHOR_VERSION="v0.14.0"

before_deploy:
- anchor build --verifiable
Expand Down
6 changes: 3 additions & 3 deletions Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ anchor_version = "0.13.0"
cluster = "localnet"
wallet = "~/.config/solana/id.json"

[programs.mainnet]
serum_multisig = "6tbPiQLgTU4ySYWyZGXbnVSAEzLc1uF8t5kJPXXgBmRP"

[programs.devnet]
serum_multisig = "F3Uf5F61dmht1xuNNNkk3jnzj82TY56vVjVEhZALRkN"

[programs.mainnet]
serum_multisig = { address = "A9HAbnCwoD6f2NkZobKFf6buJoN9gUVVvX5PoUnDHS6u", path = "./target/deploy/serum_multisig.so", idl = "./target/idl/serum_multisig.json" }

[scripts]
test = "mocha -t 1000000 tests/"
60 changes: 30 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion programs/multisig/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ cpi = ["no-entrypoint"]
default = []

[dependencies]
anchor-lang = "0.13.0"
anchor-lang = "0.14.0"
23 changes: 12 additions & 11 deletions programs/multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use anchor_lang::solana_program::instruction::Instruction;
use std::convert::Into;

#[program]
pub mod serum_multisig_impl {
pub mod serum_multisig {
use super::*;

// Initializes a new multisig account with a set of owners and a threshold.
Expand Down Expand Up @@ -177,15 +177,15 @@ pub mod serum_multisig_impl {

#[derive(Accounts)]
pub struct CreateMultisig<'info> {
#[account(init)]
#[account(zero)]
multisig: ProgramAccount<'info, Multisig>,
rent: Sysvar<'info, Rent>,
}

#[derive(Accounts)]
pub struct CreateTransaction<'info> {
multisig: ProgramAccount<'info, Multisig>,
#[account(init)]
#[account(zero)]
transaction: ProgramAccount<'info, Transaction>,
// One of the owners. Checked in the handler.
#[account(signer)]
Expand All @@ -208,21 +208,22 @@ pub struct Approve<'info> {
pub struct Auth<'info> {
#[account(mut)]
multisig: ProgramAccount<'info, Multisig>,
#[account(signer, seeds = [
multisig.to_account_info().key.as_ref(),
&[multisig.nonce],
])]
#[account(
signer,
seeds = [multisig.to_account_info().key.as_ref()],
bump = multisig.nonce,
)]
multisig_signer: AccountInfo<'info>,
}

#[derive(Accounts)]
pub struct ExecuteTransaction<'info> {
#[account(constraint = multisig.owner_set_seqno == transaction.owner_set_seqno)]
multisig: ProgramAccount<'info, Multisig>,
#[account(seeds = [
multisig.to_account_info().key.as_ref(),
&[multisig.nonce],
])]
#[account(
seeds = [multisig.to_account_info().key.as_ref()],
bump = multisig.nonce,
)]
multisig_signer: AccountInfo<'info>,
#[account(mut, has_one = multisig)]
transaction: ProgramAccount<'info, Transaction>,
Expand Down

0 comments on commit 64f3444

Please sign in to comment.