Skip to content

Commit

Permalink
Merge pull request #3 from holaplex/espi/ah-purchase-receipt
Browse files Browse the repository at this point in the history
Document Purchase Based on Previous Instruction
  • Loading branch information
kespinola authored Feb 28, 2022
2 parents 975defe + db17a7b commit ea12dbd
Show file tree
Hide file tree
Showing 177 changed files with 5,410 additions and 3,231 deletions.
4 changes: 2 additions & 2 deletions .ammanrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ const programs = {
metadata: { programId: programIds.metadata, deployPath: localDeployPath('mpl_token_metadata') },
vault: { programId: programIds.vault, deployPath: localDeployPath('mpl_token_vault') },
auction: { programId: programIds.auction, deployPath: localDeployPath('mpl_auction') },
metaplex: { programId: programIds.mpl, deployPath: localDeployPath('mpl_metaplex') },
metaplex: { programId: programIds.metaplex, deployPath: localDeployPath('mpl_metaplex') },
fixedPriceSaleToken: {
programId: programIds.fixedPriceSaleToken,
deployPath: localDeployPath('mpl_fixed_price_sale'),
},
};

const validator = {
verifyFees: true,
verifyFees: false,
};

module.exports = {
Expand Down
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/member-ordering': ['error'],
'@typescript-eslint/ban-types': ['error', { extendDefaults: true, types: { '{}': false } }],
},
};
16 changes: 16 additions & 0 deletions .github/actions/build-auction/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Implicit dependencies
# - actions/checkout@v2
# - ./.github/actions/install-linux-build-deps
# - ./.github/actions/install-solana
# - ./.github/actions/install-rust

name: Build Auction
runs:
using: 'composite'
steps:
- name: build-auction-program
working-directory: ./auction/program
run: |
cargo +${{ env.RUST_STABLE }} build-bpf --version
cargo +${{ env.RUST_STABLE }} build-bpf --bpf-out-dir ../../target/deploy/
shell: bash
16 changes: 12 additions & 4 deletions .github/actions/yarn-install-and-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,41 @@ runs:
# token-vault and auction

- name: Install and Build core
if: ${{ inputs.build_core }}
if: inputs.build_core == 'true'
run: |
echo 'Install and Build core: yarn install'
yarn install
echo 'Install and Build core: yarn build'
yarn build
working-directory: ./core/js
shell: bash

- name: Install and Build auction
if: ${{ inputs.build_auction }}
if: inputs.build_auction == 'true'
run: |
echo 'Install and Build auction: yarn install'
yarn install
echo 'Install and Build auction: yarn build'
yarn build
working-directory: ./auction/js
shell: bash

- name: Install and Build token-metadata
if: ${{ inputs.build_token_metadata }}
if: inputs.build_token_metadata == 'true'
run: |
echo 'Install and Build token-metadata: yarn install'
yarn install
echo 'Install and Build token-metadata: yarn build'
yarn build
working-directory: ./token-metadata/js
shell: bash

- name: Install and Build token-vault
if: ${{ inputs.build_token_vault }}
if: inputs.build_token_vault == 'true'
run: |
echo 'Install and Build token-vault: yarn install'
yarn install
echo 'Install and Build token-vault: yarn build'
yarn build
working-directory: ./token-vault/js
shell: bash
Expand Down
18 changes: 13 additions & 5 deletions .github/actions/yarn-install-and-verify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,41 @@ runs:
# token-vault and auction

- name: Install and Build core
if: ${{ inputs.build_core }}
if: inputs.build_core == 'true'
run: |
echo 'Install and Build core: yarn install'
yarn install
echo 'Install and Build core: yarn build'
yarn build
working-directory: ./core/js
shell: bash

- name: Install and Build auction
if: ${{ inputs.build_auction }}
if: inputs.build_auction == 'true'
run: |
echo 'Install and Build auction: yarn install'
yarn install
echo 'Install and Build auction: yarn build'
yarn build
working-directory: ./auction/js
shell: bash

- name: Install and Build token-metadata
if: ${{ inputs.build_token_metadata }}
if: inputs.build_token_metadata == 'true'
run: |
echo 'Install and Build token-metadata: yarn install'
yarn install
echo 'Install and Build token-metadata: yarn build'
yarn build
working-directory: ./token-metadata/js
shell: bash

- name: Install and Build token-vault
if: ${{ inputs.build_token_vault }}
if: inputs.build_token_vault == 'true'
run: |
echo 'Install and Build token-vault: yarn install'
yarn install
echo 'Install and Build token-vault: yarn build'
yarn build
working-directory: ./token-vault/js
shell: bash
Expand All @@ -93,7 +101,7 @@ runs:
shell: bash

- name: Test TypeScript
if: ${{ !inputs.skip_test }}
if: inputs.skip_test == 'false'
run: yarn test
working-directory: ${{ inputs.working_dir }}
shell: bash
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/integration-fixed-price-sale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,25 @@ jobs:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
code: ${{ steps.filter.outputs.code }}
core: ${{ steps.filter.outputs.core }}
package: ${{ steps.filter.outputs.package }}
steps:
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
code:
- 'core/**'
- 'fixed-price-sale/**'
core:
- 'core/**'
package:
- 'fixed-price-sale/**'
build-and-integration-test-fixed-price-sale:
runs-on: ubuntu-latest
env:
cache_id: program-fixed-price-sale
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' }}
steps:
# Setup Deps
- uses: actions/checkout@v2
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/integration-metaplex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Integration Metaplex

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

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.8.5
RUST_TOOLCHAIN: stable

jobs:
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
core: ${{ steps.filter.outputs.core }}
package: ${{ steps.filter.outputs.package }}
steps:
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- 'core/**'
package:
- 'metaplex/**'
build-and-integration-test-metaplex:
runs-on: ubuntu-latest
env:
cache_id: program-metaplex
needs: changes
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' }}
steps:
# Setup Deps
- uses: actions/checkout@v2
- uses: ./.github/actions/install-linux-build-deps
- uses: ./.github/actions/install-solana
with:
solana_version: ${{ env.SOLANA_VERSION }}
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}

# Restore Cache from previous build/test
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./rust/target
key: ${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUSTC_HASH }}

# Build Rust Programs
- uses: ./.github/actions/build-token-metadata
- uses: ./.github/actions/build-token-vault
- uses: ./.github/actions/build-auction
- uses: ./.github/actions/build-metaplex

# Install JS SDK deps
- uses: ./.github/actions/yarn-install-and-build
with:
cache_id: sdk-metaplex
working_dir: ./metaplex/js
build_token_metadata: true
build_token_vault: true
build_auction: true

# Run integration test
- name: start-local-test-validator
working-directory: ./metaplex/js
run: DEBUG=amman* yarn amman:start

- name: integration-test-metaplex-program
id: run_integration_test
working-directory: ./metaplex/js
run: DEBUG=mpl* yarn test
8 changes: 5 additions & 3 deletions .github/workflows/integration-token-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,25 @@ jobs:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
code: ${{ steps.filter.outputs.code }}
core: ${{ steps.filter.outputs.core }}
package: ${{ steps.filter.outputs.package }}
steps:
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
code:
core:
- 'core/**'
package:
- 'token-metadata/**'
build-and-integration-test-token-metadata:
runs-on: ubuntu-latest
env:
cache_id: program-token-metadata
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' }}
steps:
# Setup Deps
- uses: actions/checkout@v2
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/program-fixed-price-sale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.9.5
SOLANA_VERSION: 1.9.9
RUST_TOOLCHAIN: stable

jobs:
Expand All @@ -18,6 +18,7 @@ jobs:
outputs:
core: ${{ steps.filter.outputs.core }}
package: ${{ steps.filter.outputs.package }}
workflow: ${{ steps.filter.outputs.workflow }}
steps:
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
Expand All @@ -29,9 +30,11 @@ jobs:
- 'core/**'
package:
- 'fixed-price-sale/**'
workflow:
- '.github/workflows/program-fixed-price-sale.yml'
build-and-test-fixed-price-sale:
needs: changes
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' }}
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' || needs.changes.outputs.workflow == 'true' }}
runs-on: ubuntu-latest
env:
cache_id: program-fixed-price-sale
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/program-token-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.8.5
SOLANA_VERSION: 1.9.5
RUST_TOOLCHAIN: stable

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sdk-fixed-price-sale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ jobs:
cache_id: sdk-fixed-price-sale
working_dir: ./fixed-price-sale/js
build_token_metadata: true
skip_test: true
1 change: 1 addition & 0 deletions .github/workflows/sdk-metaplex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ jobs:
build_auction: true
build_token_vault: true
build_token_metadata: true
skip_test: true
2 changes: 1 addition & 1 deletion Cargo.lock

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

21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,22 @@ merged.

### Rust Crates

| Package | Link | Version |
| -------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| Candy Machine | [mpl-candy-machine](https://crates.io/crates/mpl-candy-machine) | [![Crate](https://img.shields.io/crates/v/mpl-candy-machine)](https://crates.io/crates/mpl-candy-machine) |
| Token Metadata | [mpl-token-metadata](https://crates.io/crates/mpl-token-metadata) | [![Crate](https://img.shields.io/crates/v/mpl-token-metadata)](https://crates.io/crates/mpl-token-metadata) |
| Token Vault | [mpl-token-vault](https://crates.io/crates/mpl-token-vault) | [![Crate](https://img.shields.io/crates/v/mpl-token-vault)](https://crates.io/crates/mpl-token-vault) |
| Package | Link | Version |
|:--------------:|-------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Candy Machine | [mpl-candy-machine](https://crates.io/crates/mpl-candy-machine) | [![Crate](https://img.shields.io/crates/v/mpl-candy-machine)](https://crates.io/crates/mpl-candy-machine) |
| Token Metadata | [mpl-token-metadata](https://crates.io/crates/mpl-token-metadata) | [![Crate](https://img.shields.io/crates/v/mpl-token-metadata)](https://crates.io/crates/mpl-token-metadata) |
| Token Vault | [mpl-token-vault](https://crates.io/crates/mpl-token-vault) | [![Crate](https://img.shields.io/crates/v/mpl-token-vault)](https://crates.io/crates/mpl-token-vault) |
| Auction House | [mpl-auction-house](https://crates.io/crates/mpl-auction-house) | [![Crate](https://img.shields.io/crates/v/mpl-auction-house)](https://crates.io/crates/mpl-auction-house) |
| Testing Utils | [mpl-testing-utils](https://crates.io/crates/mpl-testing-utils) | [![Crate](https://img.shields.io/crates/v/mpl-testing-utils)](https://crates.io/crates/mpl-testing-utils) |

### Npm Packages
| Package | Link | Version |
|:--------------:|:-------------------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------|
| Candy Machine | [mpl-candy-machine](https://www.npmjs.com/package/@metaplex-foundation/mpl-candy-machine) | [![Crate](https://img.shields.io/npm/v/@metaplex-foundation/mpl-candy-machine)](https://www.npmjs.com/package/@metaplex-foundation/mpl-candy-machine) |
| Token Metadata | [mpl-token-metadata](https://www.npmjs.com/package/@metaplex-foundation/mpl-token-metadata) | [![Crate](https://img.shields.io/npm/v/@metaplex-foundation/mpl-token-metadata)](https://www.npmjs.com/package/@metaplex-foundation/mpl-token-metadata) |
| Core | [mpl-core](https://www.npmjs.com/package/@metaplex-foundation/mpl-core) | [![Crate](https://img.shields.io/npm/v/@metaplex-foundation/mpl-core)](https://www.npmjs.com/package/@metaplex-foundation/mpl-core) |
| Auction House | [mpl-auction-house](https://www.npmjs.com/package/@metaplex-foundation/mpl-auction-house) | [![Crate](https://img.shields.io/npm/v/@metaplex-foundation/mpl-auction-house)](https://www.npmjs.com/package/@metaplex-foundation/mpl-auction-house) |



## Reporting security issues
Expand Down
4 changes: 2 additions & 2 deletions auction-house/js/idl/auction_house.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.0",
"version": "1.0.2",
"name": "auction_house",
"instructions": [
{
Expand Down Expand Up @@ -694,7 +694,7 @@
},
{
"name": "transferAuthority",
"isMut": true,
"isMut": false,
"isSigner": false
},
{
Expand Down
Loading

0 comments on commit ea12dbd

Please sign in to comment.