@@ -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
@@ -42,11 +48,15 @@ endif
42
48
43
49
.PHONY : anchor-test-setup
44
50
anchor-test-setup : node_modules ts/tests/artifacts $(CLONED_MAINNET_PROGRAMS )
45
- anchor build -- --features integration-test
51
+ anchor build --no-idl -- --features integration-test
46
52
47
53
.PHONY : idl
48
54
idl :
49
- anchor build -- --features localnet
55
+ mkdir -p target/idl target/types
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
50
60
mkdir -p ts/src/idl/json
51
61
mkdir -p ts/src/idl/ts
52
62
cp -r target/idl/* ts/src/idl/json/
@@ -65,7 +75,7 @@ anchor-test: anchor-test-setup
65
75
66
76
.PHONY : anchor-test-upgrade
67
77
anchor-test-upgrade : node_modules ts/tests/artifacts $(CLONED_MAINNET_PROGRAMS )
68
- anchor build -- --features testnet
78
+ anchor build --no-idl -- --features testnet
69
79
cp target/deploy/matching_engine.so ts/tests/artifacts/new_testnet_matching_engine.so
70
80
cp target/deploy/token_router.so ts/tests/artifacts/new_testnet_token_router.so
71
81
cp target/deploy/upgrade_manager.so ts/tests/artifacts/testnet_upgrade_manager.so
0 commit comments