Skip to content

Commit ff2462a

Browse files
committed
solana: update Makefile
1 parent ed70bb9 commit ff2462a

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

solana/Makefile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ CLONED_MAINNET_PROGRAMS=\
77
ts/tests/artifacts/mainnet_cctp_token_messenger_minter.so \
88
ts/tests/artifacts/mainnet_cctp_message_transmitter.so
99

10+
PROGRAM_NAMES=matching-engine token-router upgrade-manager
11+
12+
### Building the IDL requires a nightly build. We arbitrarily chose the same
13+
### date as the release of Anchor 0.30.1.
14+
IDL_TOOLCHAIN=nightly-2024-06-20
15+
1016
.PHONY: all
1117
all: check
1218

@@ -47,12 +53,10 @@ anchor-test-setup: node_modules ts/tests/artifacts $(CLONED_MAINNET_PROGRAMS)
4753
.PHONY: idl
4854
idl:
4955
mkdir -p target/idl target/types
50-
RUSTUP_TOOLCHAIN=nightly-2024-06-20 anchor idl build -p matching-engine -o target/idl/matching_engine.json
51-
anchor idl type -o target/types/matching_engine.ts target/idl/matching_engine.json
52-
RUSTUP_TOOLCHAIN=nightly-2024-06-20 anchor idl build -p token-router -o target/idl/token_router.json
53-
anchor idl type -o target/types/token_router.ts target/idl/token_router.json
54-
RUSTUP_TOOLCHAIN=nightly-2024-06-20 anchor idl build -p upgrade-manager -o target/idl/upgrade_manager.json
55-
anchor idl type -o target/types/upgrade_manager.ts target/idl/upgrade_manager.json
56+
for program in $(PROGRAM_NAMES); do \
57+
RUSTUP_TOOLCHAIN=$(IDL_TOOLCHAIN) anchor idl build -p $$program -o target/idl/$$program.json; \
58+
anchor idl type -o target/types/$$program.ts target/idl/$$program.json; \
59+
done
5660
mkdir -p ts/src/idl/json
5761
mkdir -p ts/src/idl/ts
5862
cp -r target/idl/* ts/src/idl/json/
@@ -72,9 +76,9 @@ anchor-test: anchor-test-setup
7276
.PHONY: anchor-test-upgrade
7377
anchor-test-upgrade: node_modules ts/tests/artifacts $(CLONED_MAINNET_PROGRAMS)
7478
anchor build --no-idl -- --features testnet
75-
cp target/deploy/matching_engine.so ts/tests/artifacts/new_testnet_matching_engine.so
76-
cp target/deploy/token_router.so ts/tests/artifacts/new_testnet_token_router.so
77-
cp target/deploy/upgrade_manager.so ts/tests/artifacts/testnet_upgrade_manager.so
79+
for program in $(PROGRAM_NAMES); do \
80+
cp target/deploy/$$program.so ts/tests/artifacts/new_testnet_$$program.so; \
81+
done
7882
bash sh/run_anchor_test_upgrade.sh
7983

8084
.PHONY: clippy

0 commit comments

Comments
 (0)