Skip to content

Commit

Permalink
fix gh actions with anchor 0.29.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wphan committed Jun 11, 2024
1 parent a2073a3 commit 9206849
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 86 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ defaults:

env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: 1.67.0
SOLANA_VERSION: "1.14.16"
RUST_TOOLCHAIN: 1.70.0
SOLANA_VERSION: "1.16.27"

jobs:
fmt-clippy:
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
- uses: ./.github/actions/setup-solana/

- name: install anchor cli
run: cargo install --git https://github.com/coral-xyz/anchor --tag v0.26.0 anchor-cli --locked
run: cargo install --git https://github.com/coral-xyz/anchor --tag v0.29.0 anchor-cli --locked

- name: Setup node
uses: actions/setup-node@v2
Expand Down
55 changes: 28 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ soon^TM

# Development

Developed using Anchor 0.26.0:
* anchor 0.29.0
* rust 1.70.0
* solana 1.16.27

```
avm use 0.26.0
avm use 0.29.0
rustup default 1.70.0
sh -c "$(curl -sSfL https://release.solana.com/v1.16.27/install)"
```

## Run tests
Expand All @@ -22,4 +27,4 @@ yarn build
cd ..
export ANCHOR_WALLET=~/.config/solana/id.json
anchor test
```
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"anchor-tests": "yarn update-types && yarn update-idl && yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
},
"devDependencies": {
"@coral-xyz/anchor": "^0.26.0",
"@coral-xyz/anchor": "^0.29.0",
"@drift-labs/competitions-sdk": "0.2.330",
"@drift-labs/sdk": "2.84.0-beta.2",
"@solana/web3.js": "1.73.2",
Expand Down
3 changes: 2 additions & 1 deletion programs/drift_vaults/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ drift = { git = "https://github.com/drift-labs/protocol-v2.git", rev = "a95009",
drift-competitions = { git = "https://github.com/drift-labs/drift-competitions.git", rev = "c8baa6", features = ["cpi"]}
bytemuck = { version = "1.4.0" }
static_assertions = "1.1.0"
drift-macros = { git = "https://github.com/drift-labs/drift-macros.git", rev = "c57d87" }
drift-macros = { git = "https://github.com/drift-labs/drift-macros.git", rev = "c57d87" }
ahash = "=0.8.6"
2 changes: 1 addition & 1 deletion ts/sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.env
lib
node_modules
*.txt
_scripts
4 changes: 2 additions & 2 deletions ts/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"lib": "lib"
},
"dependencies": {
"@coral-xyz/anchor": "^0.26.0",
"@drift-labs/competitions-sdk": "0.2.325",
"@coral-xyz/anchor": "0.28.0",
"@drift-labs/competitions-sdk": "0.2.330",
"@drift-labs/sdk": "2.84.0-beta.2",
"@solana/web3.js": "1.73.2",
"commander": "^11.0.0",
Expand Down
2 changes: 1 addition & 1 deletion ts/sdk/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const getDriftVaultProgram = (
connection: Connection,
wallet: IWallet
): anchor.Program<DriftVaults> => {
const provider = new AnchorProvider(connection, wallet, {});
const provider = new AnchorProvider(connection, wallet as anchor.Wallet, {});
anchor.setProvider(provider);
const vaultProgram = new anchor.Program(IDL, VAULT_PROGRAM_ID, provider);

Expand Down
1 change: 1 addition & 0 deletions ts/sdk/src/vaultClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ export class VaultClient {
amount: BN,
withdrawUnit: WithdrawUnit
): Promise<TransactionSignature> {
this.program.idl.types;
// @ts-ignore
const vaultAccount = (await this.program.account.vault.fetch(
vault
Expand Down
56 changes: 10 additions & 46 deletions ts/sdk/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
dependencies:
regenerator-runtime "^0.14.0"

"@coral-xyz/anchor@0.28.1-beta.2":
version "0.28.1-beta.2"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.28.1-beta.2.tgz#4ddd4b2b66af04407be47cf9524147793ec514a0"
integrity sha512-xreUcOFF8+IQKWOBUrDKJbIw2ftpRVybFlEPVrbSlOBCbreCWrQ5754Gt9cHIcuBDAzearCDiBqzsGQdNgPJiw==
"@coral-xyz/anchor@0.28.0", "@coral-xyz/anchor@^0.28.0":
version "0.28.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.28.0.tgz#8345c3c9186a91f095f704d7b90cd256f7e8b2dc"
integrity sha512-kQ02Hv2ZqxtWP30WN1d4xxT4QqlOXYDxmEd3k/bbneqhV3X5QMO4LAtoUFs7otxyivOgoqam5Il5qx81FuI4vw==
dependencies:
"@coral-xyz/borsh" "^0.28.0"
"@noble/hashes" "^1.3.1"
"@solana/web3.js" "^1.68.0"
base64-js "^1.5.1"
bn.js "^5.1.2"
Expand All @@ -39,6 +38,7 @@
cross-fetch "^3.1.5"
crypto-hash "^1.3.0"
eventemitter3 "^4.0.7"
js-sha256 "^0.9.0"
pako "^2.0.3"
snake-case "^3.0.4"
superstruct "^0.15.4"
Expand Down Expand Up @@ -85,27 +85,6 @@
superstruct "^0.15.4"
toml "^3.0.0"

"@coral-xyz/anchor@^0.28.0":
version "0.28.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.28.0.tgz#8345c3c9186a91f095f704d7b90cd256f7e8b2dc"
integrity sha512-kQ02Hv2ZqxtWP30WN1d4xxT4QqlOXYDxmEd3k/bbneqhV3X5QMO4LAtoUFs7otxyivOgoqam5Il5qx81FuI4vw==
dependencies:
"@coral-xyz/borsh" "^0.28.0"
"@solana/web3.js" "^1.68.0"
base64-js "^1.5.1"
bn.js "^5.1.2"
bs58 "^4.0.1"
buffer-layout "^1.2.2"
camelcase "^6.3.0"
cross-fetch "^3.1.5"
crypto-hash "^1.3.0"
eventemitter3 "^4.0.7"
js-sha256 "^0.9.0"
pako "^2.0.3"
snake-case "^3.0.4"
superstruct "^0.15.4"
toml "^3.0.0"

"@coral-xyz/borsh@^0.26.0":
version "0.26.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.26.0.tgz#d054f64536d824634969e74138f9f7c52bbbc0d5"
Expand Down Expand Up @@ -137,13 +116,13 @@
dependencies:
"@jridgewell/trace-mapping" "0.3.9"

"@drift-labs/competitions-sdk@0.2.325":
version "0.2.325"
resolved "https://registry.yarnpkg.com/@drift-labs/competitions-sdk/-/competitions-sdk-0.2.325.tgz#e625d3fb81db0f4c0f94f29a9a0b2e267b8959a0"
integrity sha512-VW+t0x2+RDI+jEdlOltuuPQweN34nkt1GpcpRJJGcgqnSrlUSqxA7PnFEhRTaHA8CEoh8WeG3SbgTAVsL48uVQ==
"@drift-labs/competitions-sdk@0.2.330":
version "0.2.330"
resolved "https://registry.yarnpkg.com/@drift-labs/competitions-sdk/-/competitions-sdk-0.2.330.tgz#2a6809ad99237e24bb84a64b929482722fde9022"
integrity sha512-6cwez9QWPQT9+DBYZ89FFRnRTj5yoefsa1e02c6HRz94zXOlhOmUAq6b+Hx4WHfhCr1i0lGamoMNFptfGCdz7Q==
dependencies:
"@coral-xyz/anchor" "^0.26.0"
"@drift-labs/sdk" "2.83.0-beta.13"
"@drift-labs/sdk" "2.84.0-beta.2"
"@solana/web3.js" "1.73.2"
"@switchboard-xyz/solana.js" "^2.7.1"
cerializr "^3.1.4"
Expand All @@ -152,21 +131,6 @@
ts-node "^10.9.1"
typescript "^5.1.6"

"@drift-labs/sdk@2.83.0-beta.13":
version "2.83.0-beta.13"
resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.83.0-beta.13.tgz#25a78962ed59eb22c2f24927cf3a126e06dc91c0"
integrity sha512-iLVsxEAGDmxDv75mYoyAAtjJrkyaSA872/XUaqZucO51aSjS5Mhw/HTdSDaa3AnSkhsb0jqKpHI5+l8Fd5znEQ==
dependencies:
"@coral-xyz/anchor" "0.28.1-beta.2"
"@ellipsis-labs/phoenix-sdk" "^1.4.2"
"@project-serum/serum" "^0.13.38"
"@pythnetwork/client" "2.5.3"
"@solana/spl-token" "^0.3.7"
"@solana/web3.js" "1.91.7"
strict-event-emitter-types "^2.0.0"
uuid "^8.3.2"
zstddec "^0.1.0"

"@drift-labs/sdk@2.84.0-beta.2":
version "2.84.0-beta.2"
resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.84.0-beta.2.tgz#48f32ac6c7a4160719cfe0ca0a2517144763c9db"
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
dependencies:
regenerator-runtime "^0.14.0"

"@coral-xyz/anchor@0.29.0":
"@coral-xyz/anchor@0.29.0", "@coral-xyz/anchor@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.29.0.tgz#bd0be95bedfb30a381c3e676e5926124c310ff12"
integrity sha512-eny6QNG0WOwqV0zQ7cs/b1tIuzZGmP7U7EcH+ogt4Gdbl8HDmIYVMh/9aTmYZPaFWjtUaI8qSn73uYEXWfATdA==
Expand Down

0 comments on commit 9206849

Please sign in to comment.