Skip to content

Commit 3d65497

Browse files
authored
solana: specify target network (#185)
previously, the wormhole-anchor-sdk just built against the mainnet addresses
1 parent fdd4f90 commit 3d65497

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

.github/workflows/solana.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ jobs:
101101
102102
mkdir -p "${BPF_OUT_DIR}"
103103
104-
cargo build-sbf
105-
cargo test-sbf
104+
cargo build-sbf --features "mainnet"
105+
cargo test-sbf --features "mainnet"
106106
cargo test
107107
anchor-test:
108108
name: Anchor Test

solana/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ anchor-lang = "0.29.0"
1313
anchor-spl = "0.29.0"
1414
solana-program = "=1.17.2"
1515

16-
wormhole-anchor-sdk = "0.29.0-alpha.1"
16+
wormhole-anchor-sdk = { version = "0.29.0-alpha.1", default-features = false }
1717
wormhole-sdk = { git = "https://github.com/wormhole-foundation/wormhole", rev = "eee4641" }
1818
serde_wormhole = { git = "https://github.com/wormhole-foundation/wormhole", rev = "eee4641" }
1919

solana/programs/example-native-token-transfers/Cargo.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,21 @@ crate-type = ["cdylib", "lib"]
99
name = "example_native_token_transfers"
1010

1111
[features]
12+
default = ["mainnet"]
1213
no-entrypoint = []
1314
no-idl = []
1415
no-log-ix-name = []
1516
cpi = ["no-entrypoint"]
16-
default = []
1717
idl-build = [
1818
"anchor-lang/idl-build",
1919
"anchor-spl/idl-build"
2020
]
2121
# cargo-test-sbf will pass this along
2222
test-sbf = []
23+
# networks
24+
mainnet = [ "wormhole-anchor-sdk/mainnet" ]
25+
solana-devnet = [ "wormhole-anchor-sdk/solana-devnet" ]
26+
tilt-devnet = [ "wormhole-anchor-sdk/tilt-devnet" ]
2327

2428
[dependencies]
2529
ahash = "=0.8.5"

solana/programs/wormhole-governance/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ crate-type = ["cdylib", "lib"]
99
name = "wormhole_governance"
1010

1111
[features]
12+
default = ["mainnet"]
1213
no-entrypoint = []
1314
no-idl = []
1415
no-log-ix-name = []
@@ -17,6 +18,10 @@ idl-build = [
1718
"anchor-lang/idl-build",
1819
]
1920

21+
mainnet = [ "wormhole-anchor-sdk/mainnet" ]
22+
solana-devnet = [ "wormhole-anchor-sdk/solana-devnet" ]
23+
tilt-devnet = [ "wormhole-anchor-sdk/tilt-devnet" ]
24+
2025
[dependencies]
2126
anchor-lang.workspace = true
2227
solana-program.workspace = true

0 commit comments

Comments
 (0)