Skip to content

Commit 9750528

Browse files
authored
feat: Anchor bankrun (#113)
* Skip ignoring spl2.0 dependency issue (#2) * basics, bankrun seperated * .ghaignore programs * npm dependencies fix * tokens 🚧 * tokens escrow 🚧 * anchor action bug * anchor action bug * build errors * added tokens bankrun * tokens done * cargo.toml remove pin
1 parent 8139019 commit 9750528

File tree

115 files changed

+34409
-23241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+34409
-23241
lines changed

.github/.ghaignore

+8-13
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,21 @@ tokens/nft-minter/native
1111
tokens/transfer-tokens/native
1212
tokens/spl-token-minter/native
1313
tokens/create-token/native
14-
tokens/create-token/anchor
15-
tokens/nft-minter/anchor
16-
tokens/pda-mint-authority/anchor
17-
tokens/spl-token-minter/anchor
14+
1815
tokens/token-swap/anchor
19-
tokens/transfer-tokens/anchor
2016

2117
# not building
2218
oracles/pyth/anchor
2319

24-
# avm broke hence can't build
25-
# can't use anchor.toml [toolchain] with stable rust
26-
# update these programs to use latest anchor version to fix
27-
tokens/token-2022/group/anchor
28-
tokens/token-2022/immutable-owner/anchor
29-
tokens/token-2022/interest-bearing/anchor
30-
tokens/token-2022/memo-transfer/anchor
31-
3220
# not building
3321
compression/cutils/anchor
3422
compression/cnft-vault/anchor
3523
# builds but need to test on localhost
3624
compression/cnft-burn/anchor
25+
26+
# test failing
27+
# https://github.com/solana-developers/helpers/issues/40
28+
tokens/escrow/anchor
29+
30+
# not live
31+
tokens/token-2022/group/anchor

.github/workflows/anchor.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -125,31 +125,37 @@ jobs:
125125
function build_and_test() {
126126
local project=$1
127127
echo "Building and Testing $project"
128-
cd "$project"
128+
cd "$project" || return 1
129129
130130
# Run anchor build
131131
if ! anchor build; then
132132
echo "::error::anchor build failed for $project"
133133
echo "$project: anchor build failed" >> $GITHUB_WORKSPACE/failed_projects.txt
134+
rm -rf target
135+
cd - > /dev/null
134136
return 1
135137
fi
136138
137139
# Install dependencies
138140
if ! pnpm install --frozen-lockfile; then
139141
echo "::error::pnpm install failed for $project"
140142
echo "$project: pnpm install failed" >> $GITHUB_WORKSPACE/failed_projects.txt
143+
cd - > /dev/null
141144
return 1
142145
fi
143146
144147
# Run anchor test
145148
if ! anchor test; then
146149
echo "::error::anchor test failed for $project"
147150
echo "$project: anchor test failed" >> $GITHUB_WORKSPACE/failed_projects.txt
151+
rm -rf target node_modules
152+
cd - > /dev/null
148153
return 1
149154
fi
150155
151156
echo "Build and tests succeeded for $project."
152157
rm -rf target node_modules
158+
cd - > /dev/null
153159
return 0
154160
}
155161

basics/account-data/anchor/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"dependencies": {
3-
"@coral-xyz/anchor": "^0.30.0"
3+
"@coral-xyz/anchor": "^0.30.0",
4+
"@solana/web3.js": "^1.95.2"
45
},
56
"devDependencies": {
7+
"anchor-bankrun": "^0.4.0",
8+
"solana-bankrun": "^0.3.0",
69
"@types/bn.js": "^5.1.0",
710
"@types/chai": "^4.3.0",
811
"@types/mocha": "^9.0.0",

0 commit comments

Comments
 (0)