@@ -7,6 +7,12 @@ CLONED_MAINNET_PROGRAMS=\
7
7
ts/tests/artifacts/mainnet_cctp_token_messenger_minter.so \
8
8
ts/tests/artifacts/mainnet_cctp_message_transmitter.so
9
9
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
+
10
16
.PHONY : all
11
17
all : check
12
18
@@ -47,12 +53,10 @@ anchor-test-setup: node_modules ts/tests/artifacts $(CLONED_MAINNET_PROGRAMS)
47
53
.PHONY : idl
48
54
idl :
49
55
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
56
60
mkdir -p ts/src/idl/json
57
61
mkdir -p ts/src/idl/ts
58
62
cp -r target/idl/* ts/src/idl/json/
@@ -72,9 +76,9 @@ anchor-test: anchor-test-setup
72
76
.PHONY : anchor-test-upgrade
73
77
anchor-test-upgrade : node_modules ts/tests/artifacts $(CLONED_MAINNET_PROGRAMS )
74
78
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
78
82
bash sh/run_anchor_test_upgrade.sh
79
83
80
84
.PHONY : clippy
0 commit comments