Skip to content

Commit

Permalink
Merge branch 'master' into async
Browse files Browse the repository at this point in the history
  • Loading branch information
Aursen authored Jun 4, 2023
2 parents b562e98 + 1c6f86e commit 2420fbf
Show file tree
Hide file tree
Showing 50 changed files with 2,074 additions and 911 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/no-caching-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: ./.github/workflows/reusable-tests.yaml
with:
cache: false
solana_cli_version: 1.14.16
solana_cli_version: 1.16.0
node_version: 17.0.1
cargo_profile: release
anchor_binary_name: anchor-binary-no-caching
59 changes: 32 additions & 27 deletions .github/workflows/reusable-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,33 +332,34 @@ jobs:
# - run: cd tests/misc && chmod +x ci.sh && ./ci.sh
# - run: cd tests/misc && anchor test --skip-lint

test-anchor-init:
needs: setup-anchor-cli
name: Test Anchor Init
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup/
- uses: ./.github/actions/setup-ts/
- uses: ./.github/actions/setup-solana/
# TODO: Re-enable after releasing `0.28.0`. See https://github.com/coral-xyz/anchor/pull/2512
# test-anchor-init:
# needs: setup-anchor-cli
# name: Test Anchor Init
# runs-on: ubuntu-latest
# timeout-minutes: 30
# steps:
# - uses: actions/checkout@v3
# - uses: ./.github/actions/setup/
# - uses: ./.github/actions/setup-ts/
# - uses: ./.github/actions/setup-solana/

- uses: actions/cache@v3
if: ${{ env.CACHE != 'false' }}
name: Cache Cargo registry + index
id: cache-anchor
with:
path: ${{ env.CARGO_CACHE_PATH }}
key: cargo-${{ runner.os }}-${{ env.CARGO_PROFILE }}-anchor-${{ hashFiles('**/Cargo.lock') }}
# - uses: actions/cache@v3
# if: ${{ env.CACHE != 'false' }}
# name: Cache Cargo registry + index
# id: cache-anchor
# with:
# path: ${{ env.CARGO_CACHE_PATH }}
# key: cargo-${{ runner.os }}-${{ env.CARGO_PROFILE }}-anchor-${{ hashFiles('**/Cargo.lock') }}

- uses: actions/download-artifact@v3
with:
name: ${{ env.ANCHOR_BINARY_NAME }}
path: ~/.cargo/bin/
- run: chmod +x ~/.cargo/bin/anchor
# - uses: actions/download-artifact@v3
# with:
# name: ${{ env.ANCHOR_BINARY_NAME }}
# path: ~/.cargo/bin/
# - run: chmod +x ~/.cargo/bin/anchor

- run: cd "$(mktemp -d)" && anchor init hello-anchor && cd hello-anchor && yarn link @coral-xyz/anchor && yarn && anchor test && yarn lint:fix
- uses: ./.github/actions/git-diff/
# - run: cd "$(mktemp -d)" && anchor init hello-anchor && cd hello-anchor && yarn link @coral-xyz/anchor && yarn && anchor test && yarn lint:fix
# - uses: ./.github/actions/git-diff/

test-programs:
needs: setup-anchor-cli
Expand All @@ -383,7 +384,9 @@ jobs:
path: tests/multisig
# - cmd: cd tests/lockup && anchor test --skip-lint
# path: tests/lockup
- cmd: cd tests/swap/deps/openbook-dex/dex && cargo build-bpf -- --locked && cd ../../../ && anchor test --skip-lint
# TODO: Remove `1.14.18` installation if/when https://github.com/solana-labs/solana/issues/31960 is solved
# `swap` tests don't work with Solana `1.16.0`, downgrade to `1.14.18`
- cmd: cd tests/swap/deps/openbook-dex/dex && solana-install init 1.14.18 && cargo build-bpf -- --locked && cd ../../../ && solana-install init $SOLANA_CLI_VERSION && anchor test --skip-lint
path: tests/swap
- cmd: cd tests/escrow && anchor test --skip-lint && npx tsc --noEmit
path: tests/escrow
Expand All @@ -403,15 +406,17 @@ jobs:
path: tests/declare-id
- cmd: cd tests/typescript && anchor test --skip-lint && npx tsc --noEmit
path: tests/typescript
- cmd: cd tests/zero-copy && anchor test --skip-lint && cd programs/zero-copy && cargo test-bpf
- cmd: cd tests/zero-copy && rustup toolchain install 1.66.1-x86_64-unknown-linux-gnu && anchor test --skip-lint && cd programs/zero-copy && cargo test-bpf
path: tests/zero-copy
- cmd: cd tests/chat && anchor test --skip-lint
path: tests/chat
- cmd: cd tests/ido-pool && anchor test --skip-lint
path: tests/ido-pool
# - cmd: cd tests/cfo && anchor run test-with-build && cd deps/stake && git checkout Cargo.lock && cd ../swap && git checkout Cargo.lock
# path: tests/cfo
- cmd: cd tests/auction-house && yarn --frozen-lockfile && anchor test --skip-lint && git checkout Cargo.lock
# TODO: Remove `1.14.18` installation if/when https://github.com/solana-labs/solana/issues/31960 is solved
# `auction-house` tests don't work with Solana `1.16.0`, downgrade to `1.14.18`
- cmd: cd tests/auction-house && solana-install init 1.14.18 && yarn --frozen-lockfile && anchor test --skip-lint && git checkout Cargo.lock
path: tests/auction-house
- cmd: cd tests/floats && yarn --frozen-lockfile && anchor test --skip-lint && npx tsc --noEmit
path: tests/floats
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: ./.github/workflows/reusable-tests.yaml
with:
cache: true
solana_cli_version: 1.14.16
solana_cli_version: 1.16.0
node_version: 17.0.1
cargo_profile: debug
anchor_binary_name: anchor-binary
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ The minor version will be incremented upon a breaking change and the patch versi
- spl: Add `token_program` constraint to `Token`, `Mint`, and `AssociatedToken` accounts in order to override required `token_program` fields and use different token interface implementations in the same instruction ([#2460](https://github.com/coral-xyz/anchor/pull/2460))
- cli: Add support for Solidity programs. `anchor init` and `anchor new` take an option `--solidity` which creates solidity code rather than rust. `anchor build` and `anchor test` work accordingly ([#2421](https://github.com/coral-xyz/anchor/pull/2421))
- bench: Add benchmarking for compute units usage ([#2466](https://github.com/coral-xyz/anchor/pull/2466))
- cli: `idl set-buffer`, `idl set-authority` and `idl close` take an option `--print-only`. which prints transaction in a base64 Borsh compatible format but not sent to the cluster. It's helpful when managing authority under a multisig, e.g., a user can create a proposal for a `Custom Instruction` in SPL Governance ([#2486](https://github.com/coral-xyz/anchor/pull/2486)).
- lang: Add `emit_cpi!` and `#[event_cpi]` macros(behind `event-cpi` feature flag) to store event logs in transaction metadata ([#2438](https://github.com/coral-xyz/anchor/pull/2438)).
- cli: Add `keys sync` command to sync program id declarations ([#2505](https://github.com/coral-xyz/anchor/pull/2505)).

### Fixes

- ts: Narrowed `AccountClient` type to it's appropriate account type ([#2440](https://github.com/coral-xyz/anchor/pull/2440))
- lang: Fix inability to use identifiers `program_id`, `accounts`, `ix_data`, `remaining_accounts` in instruction arguments ([#2464](https://github.com/coral-xyz/anchor/pull/2464))
- cli: Fix incorrect `metadata.address` generation in IDL after deploying with a custom keypair ([#2485](https://github.com/coral-xyz/anchor/pull/2485))
- cli: IDL commands no longer hang when the payer doesn't have funds to pay for the transaction fee ([#2492](https://github.com/coral-xyz/anchor/pull/2492))
- cli, client, lang, spl: Update Solana toolchain and dependencies to `1.16.0` and specify maximum version of `<1.17.0` ([#2512](https://github.com/coral-xyz/anchor/pull/2512)).

### Breaking

Expand Down
Loading

0 comments on commit 2420fbf

Please sign in to comment.