Skip to content

Commit

Permalink
Add TokenizedVaultDepositor 2 (#55)
Browse files Browse the repository at this point in the history
* Squashed to deal with merge conflicts

* fix tests

* whitespace

* whitespace

* whitespace

* refactor tests, reduce boilerplate

* restrict issuing new tokens after rebase

* fix clippy

* fix clippy in gh action

* fix tests with adminclient

* fix test equality

* fix test equality

* test creating TokenizedDepositor for new shares base

* add token_cpi.rs

* clean up msc msg

* linter

* update yarn.lock

* address some PR comments

* make sure vault_protocol everywhere, consolidate rebase logic, consolidate VaultDepositorRecords

* use safemath

* chore: removes competition (#56)

* remove drift-competitions

* update main.yml

* fix linter

* remove default-features=false

* add continue-on-error

* cargo fetch before solana-verify

* cargo vendor before solana-verify

* try to parse last line of build output

* override shell command to keep errors

* kcikoff build

* use raw bash

* try another shell cmd

* update shell

* disable cargo frozen

* add DOCKER_FLAGS to solana-verify build

* use cargo vendor

* fix test

* Update CHANGELOG.md
  • Loading branch information
wphan authored Oct 29, 2024
1 parent 9c2ca35 commit 81d18a7
Show file tree
Hide file tree
Showing 51 changed files with 10,095 additions and 2,827 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: main

on:
push:
branches: master
branches: [master]
pull_request:
branches: master
branches: [master]

defaults:
run:
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Cargo fmt
run: cargo fmt -- --check
- name: Cargo clippy
run: cargo clippy -p drift
run: cargo clippy -p drift-vaults
unit:
name: Unit tests
runs-on: ubicloud
Expand Down Expand Up @@ -138,11 +138,17 @@ jobs:

- name: Install Solana Verify
run: |
cargo install solana-verify
cargo install --locked --version 0.2.11 solana-verify
solana-verify --version
- name: Verifiable Build
run: |
cargo vendor
mkdir -p .cargo
echo '[source.crates-io]' > .cargo/config.toml
echo 'replace-with = "vendored-sources"' >> .cargo/config.toml
echo '[source.vendored-sources]' >> .cargo/config.toml
echo 'directory = "vendor"' >> .cargo/config.toml
solana-verify build --library-name drift_vaults --base-image ellipsislabs/solana:1.16.6
- name: Upload Artifact
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/on-sdk-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- master
repository_dispatch:
types: [competitions-sdk-update]
types: [sdk-update]

env:
CARGO_TERM_COLOR: always
Expand All @@ -28,14 +28,11 @@ jobs:
id: determine-sdk-version
run: |
if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
echo "DRIFT_SDK_VERSION=${{ github.event.client_payload.sdk-version }}" >> $GITHUB_ENV
echo "COMPETITIONS_SDK_VERSION=${{ github.event.client_payload.competitions-version }}" >> $GITHUB_ENV
echo "DRIFT_SDK_VERSION=${{ github.event.client_payload.version }}" >> $GITHUB_ENV
else
# Get the current version of sdk used in package.json
CURRENT_DRIFT_SDK_VERSION=$(node -e "console.log(require('./ts/sdk/package.json').dependencies['@drift-labs/sdk'])")
CURRENT_COMPETITIONS_SDK_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@drift-labs/competitions-sdk'])")
echo "DRIFT_SDK_VERSION=$CURRENT_DRIFT_SDK_VERSION" >> $GITHUB_ENV
echo "COMPETITIONS_SDK_VERSION=$CURRENT_COMPETITIONS_SDK_VERSION" >> $GITHUB_ENV
fi
- name: Install dependencies
Expand All @@ -44,7 +41,6 @@ jobs:
- name: Add specific version of sdk
run: |
yarn add --dev @drift-labs/sdk@$DRIFT_SDK_VERSION
yarn add --dev @drift-labs/competitions-sdk@$COMPETITIONS_SDK_VERSION
cd ts/sdk
yarn add @drift-labs/sdk@$DRIFT_SDK_VERSION
Expand Down Expand Up @@ -75,7 +71,7 @@ jobs:
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
yarn run prettify:fix
git add -A
git commit --allow-empty -m "Bumping sdk and competitions-sdk dependencies to $DRIFT_SDK_VERSION and $COMPETITIONS_SDK_VERSION"
git commit --allow-empty -m "Bumping sdk to $DRIFT_SDK_VERSION"
git push
echo "VAULT_VERSION=$VERSION" >> $GITHUB_ENV
Expand Down
12 changes: 8 additions & 4 deletions Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ wallet = "~/.config/solana/id.json"
address = "dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH"
program = "./deps/drift.so"

[[test.genesis]]
address = "DraWMeQX9LfzQQSYoeBwHAgM5JcqFkgrX7GbTfjzVMVL"
program = "./deps/drift_competitions.so"

[[test.genesis]]
address = "FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH"
program = "./deps/pyth.so"

[[test.genesis]]
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
program = "./deps/metaplex/metaplex.so"

[[test.validator.account]]
address = "PwDiXFxQsGra4sFFTT8r1QWRMd4vfumiWC1jfWNfdYT"
filename = "./deps/metaplex/PwDiXFxQsGra4sFFTT8r1QWRMd4vfumiWC1jfWNfdYT.json"

[scripts]
test = "yarn anchor-tests"
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

* Tokenized Vaults ([#55](https://github.com/drift-labs/drift-vaults/pull/55))
* Remove drift-competitions ([#56](https://github.com/drift-labs/drift-vaults/pull/56))

### Fixes

### Breaking
Loading

0 comments on commit 81d18a7

Please sign in to comment.