Skip to content

Commit

Permalink
Account for API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Feb 6, 2024
1 parent 6bdc176 commit a82cb1f
Show file tree
Hide file tree
Showing 26 changed files with 136 additions and 115 deletions.
24 changes: 12 additions & 12 deletions crate/diffs/arbitrary_cpi.diff
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
diff -r ./insecure/Cargo.toml ../../../../lints/arbitrary_cpi/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/arbitrary_cpi/ui/insecure/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = { version = "3.1.1", features = ["no-entrypoint"] }
\ No newline at end of file
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/arbitrary_cpi/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/arbitrary_cpi/ui/insecure/src/lib.rs
2a3,4
> use anchor_lang::solana_program::entrypoint::ProgramResult;
> use anchor_spl::token::spl_token;
Expand All @@ -18,18 +18,18 @@ diff -r ./insecure/src/lib.rs ../../../../lints/arbitrary_cpi/ui/insecure/src/li
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/arbitrary_cpi/ui: insecure-2
diff -r ./recommended/Cargo.toml ../../../../lints/arbitrary_cpi/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/arbitrary_cpi/ui/recommended/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = { version = "3.1.1", features = ["no-entrypoint"] }
\ No newline at end of file
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/arbitrary_cpi/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/arbitrary_cpi/ui/recommended/src/lib.rs
10c10
< pub fn cpi(ctx: Context<Cpi>, amount: u64) -> ProgramResult {
---
Expand All @@ -38,17 +38,17 @@ diff -r ./recommended/src/lib.rs ../../../../lints/arbitrary_cpi/ui/recommended/
>
> #[allow(dead_code)]
> fn main() {}
diff -r ./secure/Cargo.toml ../../../../lints/arbitrary_cpi/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/arbitrary_cpi/ui/secure/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = { version = "3.1.1", features = ["no-entrypoint"] }
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/arbitrary_cpi/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/arbitrary_cpi/ui/secure/src/lib.rs
2a3,4
> use anchor_lang::solana_program::entrypoint::ProgramResult;
> use anchor_spl::token::spl_token;
Expand Down
18 changes: 9 additions & 9 deletions crate/diffs/bump_seed_canonicalization.diff
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff -r ./insecure/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/insecure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/insecure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
30a32,34
Expand All @@ -15,28 +15,28 @@ diff -r ./insecure/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/in
Only in ../../../../lints/bump_seed_canonicalization/ui/insecure/src: lib.stderr
Only in ../../../../lints/bump_seed_canonicalization/ui: insecure-2
Only in ../../../../lints/bump_seed_canonicalization/ui: insecure-3
diff -r ./recommended/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/recommended/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/recommended/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
35a37,39
>
> #[allow(dead_code)]
> fn main() {}
diff -r ./secure/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/bump_seed_canonicalization/ui/secure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/bump_seed_canonicalization/ui/secure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
38a40,42
Expand Down
30 changes: 15 additions & 15 deletions crate/diffs/insecure_account_close.diff
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
diff -r ./insecure/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
30a32,34
>
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/insecure_account_close/ui/insecure/src: lib.stderr
diff -r ./insecure-still/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure-still/Cargo.toml
diff -r -x Cargo.lock ./insecure-still/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure-still/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure-still/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure-still/src/lib.rs
diff -r -x Cargo.lock ./insecure-still/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure-still/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
45a47,49
>
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/insecure_account_close/ui/insecure-still/src: lib.stderr
diff -r ./insecure-still-still/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure-still-still/Cargo.toml
diff -r -x Cargo.lock ./insecure-still-still/Cargo.toml ../../../../lints/insecure_account_close/ui/insecure-still-still/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure-still-still/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure-still-still/src/lib.rs
diff -r -x Cargo.lock ./insecure-still-still/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure-still-still/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
45a47,49
>
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/insecure_account_close/ui/insecure-still-still/src: lib.stderr
diff -r ./recommended/Cargo.toml ../../../../lints/insecure_account_close/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/insecure_account_close/ui/recommended/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/insecure_account_close/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/insecure_account_close/ui/recommended/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
18d18
Expand All @@ -60,14 +60,14 @@ diff -r ./recommended/src/lib.rs ../../../../lints/insecure_account_close/ui/rec
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/insecure_account_close/ui/recommended/src: lib.stderr
diff -r ./secure/Cargo.toml ../../../../lints/insecure_account_close/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/insecure_account_close/ui/secure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/insecure_account_close/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/insecure_account_close/ui/secure/src/lib.rs
2a3
> use anchor_lang::solana_program::entrypoint::ProgramResult;
71a73,75
Expand Down
24 changes: 12 additions & 12 deletions crate/diffs/missing_owner_check.diff
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
diff -r ./insecure/Cargo.toml ../../../../lints/missing_owner_check/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/missing_owner_check/ui/insecure/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = "3.2.0"
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/missing_owner_check/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/missing_owner_check/ui/insecure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
4c5
Expand All @@ -20,35 +20,35 @@ diff -r ./insecure/src/lib.rs ../../../../lints/missing_owner_check/ui/insecure/
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/missing_owner_check/ui/insecure/src: lib.stderr
diff -r ./recommended/Cargo.toml ../../../../lints/missing_owner_check/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/missing_owner_check/ui/recommended/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = "3.2.0"
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/missing_owner_check/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/missing_owner_check/ui/recommended/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
21a23,25
>
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/missing_owner_check/ui/recommended/src: lib.stderr
diff -r ./secure/Cargo.toml ../../../../lints/missing_owner_check/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/missing_owner_check/ui/secure/Cargo.toml
19,21c19,22
< anchor-lang = "0.20.1"
< anchor-spl = "0.20.1"
< spl-token = "3.2.0"
---
> anchor-lang = "0.25.0"
> anchor-spl = "0.25.0"
> anchor-lang = "0.29.0"
> anchor-spl = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/missing_owner_check/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/missing_owner_check/ui/secure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
4c5,6
Expand Down
18 changes: 9 additions & 9 deletions crate/diffs/missing_signer_check.diff
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff -r ./insecure/Cargo.toml ../../../../lints/missing_signer_check/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/missing_signer_check/ui/insecure/Cargo.toml
19c19,21
< anchor-lang = "0.20.0"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/missing_signer_check/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/missing_signer_check/ui/insecure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
3a5
Expand All @@ -15,29 +15,29 @@ diff -r ./insecure/src/lib.rs ../../../../lints/missing_signer_check/ui/insecure
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/missing_signer_check/ui/insecure/src: lib.stderr
diff -r ./recommended/Cargo.toml ../../../../lints/missing_signer_check/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/missing_signer_check/ui/recommended/Cargo.toml
19c19,21
< anchor-lang = "0.20.0"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/missing_signer_check/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/missing_signer_check/ui/recommended/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
18a20,22
>
> #[allow(dead_code)]
> fn main() {}
Only in ../../../../lints/missing_signer_check/ui/recommended/src: lib.stderr
diff -r ./secure/Cargo.toml ../../../../lints/missing_signer_check/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/missing_signer_check/ui/secure/Cargo.toml
19c19,21
< anchor-lang = "0.20.0"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/missing_signer_check/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/missing_signer_check/ui/secure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
21a23,25
Expand Down
18 changes: 9 additions & 9 deletions crate/diffs/type_cosplay.diff
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff -r ./insecure/Cargo.toml ../../../../lints/type_cosplay/ui/insecure/Cargo.toml
diff -r -x Cargo.lock ./insecure/Cargo.toml ../../../../lints/type_cosplay/ui/insecure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./insecure/src/lib.rs ../../../../lints/type_cosplay/ui/insecure/src/lib.rs
diff -r -x Cargo.lock ./insecure/src/lib.rs ../../../../lints/type_cosplay/ui/insecure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
37a39,41
Expand All @@ -16,14 +16,14 @@ Only in ../../../../lints/type_cosplay/ui/insecure/src: lib.stderr
Only in ../../../../lints/type_cosplay/ui: insecure-2
Only in ../../../../lints/type_cosplay/ui: insecure-3
Only in ../../../../lints/type_cosplay/ui: insecure-anchor
diff -r ./recommended/Cargo.toml ../../../../lints/type_cosplay/ui/recommended/Cargo.toml
diff -r -x Cargo.lock ./recommended/Cargo.toml ../../../../lints/type_cosplay/ui/recommended/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./recommended/src/lib.rs ../../../../lints/type_cosplay/ui/recommended/src/lib.rs
diff -r -x Cargo.lock ./recommended/src/lib.rs ../../../../lints/type_cosplay/ui/recommended/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
31a33,35
Expand All @@ -32,14 +32,14 @@ diff -r ./recommended/src/lib.rs ../../../../lints/type_cosplay/ui/recommended/s
> fn main() {}
Only in ../../../../lints/type_cosplay/ui/recommended/src: lib.stderr
Only in ../../../../lints/type_cosplay/ui: recommended-2
diff -r ./secure/Cargo.toml ../../../../lints/type_cosplay/ui/secure/Cargo.toml
diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/type_cosplay/ui/secure/Cargo.toml
19c19,21
< anchor-lang = "0.20.1"
---
> anchor-lang = "0.25.0"
> anchor-lang = "0.29.0"
>
> [workspace]
diff -r ./secure/src/lib.rs ../../../../lints/type_cosplay/ui/secure/src/lib.rs
diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/type_cosplay/ui/secure/src/lib.rs
1a2
> use anchor_lang::solana_program::entrypoint::ProgramResult;
48a50,52
Expand Down
3 changes: 3 additions & 0 deletions crate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

extern crate rustc_hir;

#[allow(unused_extern_crates)]
extern crate rustc_driver;

pub mod paths;

pub mod utils;
3 changes: 2 additions & 1 deletion crate/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// all in upper snake case.

pub const ANCHOR_LANG_ACCOUNT: [&str; 4] = ["anchor_lang", "accounts", "account", "Account"];
pub const ANCHOR_LANG_ACCOUNT_LOADER: [&str; 4] = ["anchor_lang", "accounts", "account_loader", "AccountLoader"];
pub const ANCHOR_LANG_ACCOUNT_LOADER: [&str; 4] =
["anchor_lang", "accounts", "account_loader", "AccountLoader"];
pub const ANCHOR_LANG_PROGRAM: [&str; 4] = ["anchor_lang", "accounts", "program", "Program"];
pub const ANCHOR_LANG_SYSTEM_ACCOUNT: [&str; 4] =
["anchor_lang", "accounts", "system_account", "SystemAccount"];
Expand Down
3 changes: 3 additions & 0 deletions crate/tests/meta.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#![feature(rustc_private)]
#![warn(unused_extern_crates)]

#[allow(unused_extern_crates)]
extern crate rustc_driver;

extern crate rustc_data_structures;

use rustc_data_structures::fx::FxHashMap;
Expand Down
Loading

0 comments on commit a82cb1f

Please sign in to comment.