Skip to content

Commit f3b2644

Browse files
authored
chore(cli): Fix path 'duplicate solana-program' check (#4328)
1 parent 37bfd15 commit f3b2644

File tree

13 files changed

+172
-1
lines changed

13 files changed

+172
-1
lines changed

.github/workflows/reusable-tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,8 @@ jobs:
457457
path: tests/auction-house
458458
- cmd: cd tests/floats && anchor test --skip-lint && npx tsc --noEmit
459459
path: tests/floats
460+
- cmd: cd tests/solana-program-deps && ./test.sh
461+
path: tests/solana-program-deps
460462
- cmd: cd tests/safety-checks && anchor run test
461463
path: tests/safety-checks
462464
- cmd: cd tests/custom-coder && anchor test --skip-lint && npx tsc --noEmit

cli/src/checks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub fn check_deps(cfg: &WithPath<Config>) -> Result<()> {
104104
};
105105
let workspace_toml = cargo_toml::Manifest::from_str(include_str!(concat!(
106106
env!("CARGO_MANIFEST_DIR"),
107-
"/Cargo.toml"
107+
"/../Cargo.toml"
108108
)))
109109
.unwrap();
110110
let version = workspace_toml
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[toolchain]
2+
3+
[features]
4+
resolution = true
5+
skip-lint = false
6+
7+
[programs.localnet]
8+
matching_solana_program = "E9GKQ5qAkB6N4eGK1Bu3R1a6hNFW2W2Kz6fTn6zkRgZN"
9+
10+
[provider]
11+
cluster = "localnet"
12+
wallet = "~/.config/solana/id.json"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[workspace]
2+
members = [
3+
"programs/*"
4+
]
5+
resolver = "2"
6+
7+
[profile.release]
8+
overflow-checks = true
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "matching-solana-program"
3+
version = "0.1.0"
4+
description = "Created with Anchor"
5+
edition = "2018"
6+
7+
[lib]
8+
crate-type = ["cdylib", "lib"]
9+
name = "matching_solana_program"
10+
11+
[features]
12+
no-entrypoint = []
13+
no-idl = []
14+
no-log-ix-name = []
15+
cpi = ["no-entrypoint"]
16+
default = []
17+
idl-build = ["anchor-lang/idl-build"]
18+
19+
[dependencies]
20+
anchor-lang = { path = "../../../../../lang" }
21+
solana-program = "3.0.0"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.bpfel-unknown-unknown.dependencies.std]
2+
features = []
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use anchor_lang::prelude::*;
2+
3+
declare_id!("E9GKQ5qAkB6N4eGK1Bu3R1a6hNFW2W2Kz6fTn6zkRgZN");
4+
5+
#[program]
6+
pub mod matching_solana_program {
7+
use super::*;
8+
9+
pub fn initialize(_ctx: Context<Initialize>) -> Result<()> {
10+
Ok(())
11+
}
12+
}
13+
14+
#[derive(Accounts)]
15+
pub struct Initialize {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[toolchain]
2+
3+
[features]
4+
resolution = true
5+
skip-lint = false
6+
7+
[programs.localnet]
8+
mismatched_solana_program = "5vHp6xYFQ4pc6D95P7h3CngkzyP4iMfsMghvYDn8ApXK"
9+
10+
[provider]
11+
cluster = "localnet"
12+
wallet = "~/.config/solana/id.json"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[workspace]
2+
members = [
3+
"programs/*"
4+
]
5+
resolver = "2"
6+
7+
[profile.release]
8+
overflow-checks = true
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "mismatched-solana-program"
3+
version = "0.1.0"
4+
description = "Created with Anchor"
5+
edition = "2018"
6+
7+
[lib]
8+
crate-type = ["cdylib", "lib"]
9+
name = "mismatched_solana_program"
10+
11+
[features]
12+
no-entrypoint = []
13+
no-idl = []
14+
no-log-ix-name = []
15+
cpi = ["no-entrypoint"]
16+
default = []
17+
idl-build = ["anchor-lang/idl-build"]
18+
19+
[dependencies]
20+
anchor-lang = { path = "../../../../../lang" }
21+
solana-program = "2.3.0"

0 commit comments

Comments
 (0)