Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* chore: deprecate auction, metaplex, token-vault

* chore: rebuild lock file

* chore: adding mpl token vault back to toml file

* chore: removing build-metaplex from ci

* chore: removing build-metaplex from ci

* chore: adding token-vault to testing utils

* chore: adding token-vault to testing utils

* chore: adding crates

* chore: clippy

* chore: clippy

* chore: clippy

* chore: clippy

* chore: remove package from local test context

* chore: clippy

* chore: clippy

* chore: clippy

* chore: major clippy

* chore: major clippy

* chore: clippy

* chore: test

* chore: test

* chore: try to fix auctioneer ci

* chore: update lock

* chore: fixing token-metadata tests

* chore: fixing token-metadata tests

* chore: fixing builds failing on devdep error

* chore: fixing builds failing on devdep error

* chore: fixing builds failing on devdep error

* chore: fixing builds failing on devdep error

* chore: fixing builds failing on devdep error

* chore: fixing builds failing on devdep error

* chore: bumping solana versions

* chore: hopefully final changes before all tests passing

* chore: update ci for token-metadata

* chore: update ci for token-metadata

* chore: merge conflicts

* chore: fixing auctioneer tests

* chore: fixing auctioneer tests

* chore: fix lockfile

* chore: delete unneeded deps in toml file, deprecate test and associated code

* chore: delete unneeded deps in toml file, deprecate test and associated code

* add additional deprecation messages

* generate JS lib

* remove deprecated function warning to soothe clippy

* chore(fixed-price-sale/js): generate JS code

* rebase

* chore: regen token entangler

* chore: merge conflivts

* chore: merge conflivts

* chore: finally changes for fps

* chore: fixing fps tests

* chore: updated lock

* chore: trying to fix timeouts

* chore: trying to fix timeouts

* chore: merge conflicts

* chore: merge conflicts

* feat: hydra tests passing

Co-authored-by: Weiyuan Wu <[email protected]>
Co-authored-by: Samuel Vanderwaal <[email protected]>
  • Loading branch information
3 people authored Sep 9, 2022
1 parent a7fb06e commit d0de9f4
Show file tree
Hide file tree
Showing 110 changed files with 12,381 additions and 19 deletions.
7 changes: 6 additions & 1 deletion .base-ammanrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ const programs = {
label: "Candy Machine",
programId: 'cndy3Z4yapfJBmL3ShUp5exZKqR3z33thTzeNMm2gRZ',
deployPath: localDeployPath('mpl_candy_machine'),
},
},
hydra: {
label: 'Hydra',
programId: 'hyDQ4Nz1eYyegS6JfenyKwKzYxRsCWCriYSAjtzP4Vg',
deployPath: localDeployPath('mpl_hydra'),
},
};

const validator = {
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ module.exports = {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-types': ['error', { extendDefaults: true, types: { '{}': false } }],
'@typescript-eslint/ban-ts-comment': 'off',
},
};
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ body:
- core
- fixed-price-sale
- gumdrop
- hydra
- nft-packs
- token-entangler
- token-metadata
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ body:
- nft-packs
- token-entangler
- token-metadata
- hydra
validations:
required: true
- type: textarea
Expand Down
16 changes: 16 additions & 0 deletions .github/actions/build-hydra/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 Hydra
runs:
using: 'composite'
steps:
- name: build-hydra-program
working-directory: ./hydra/program
run: |
cargo +${{ env.RUST_STABLE }} build-bpf --version
cargo +${{ env.RUST_STABLE }} build-bpf --bpf-out-dir ../../target/deploy/
shell: bash
4 changes: 4 additions & 0 deletions .github/actions/make-version-changes/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const MPL_PROGRAM_CONFIG = {
has_idl: true,
uses_anchor: false,
},
'hydra': {
has_idl: true,
uses_anchor: true,
},
};

const wrappedExec = (cmd, cwd) => {
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/integration-hydra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Integration Hydra

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

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.10.35
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 }}
workflow: ${{ steps.filter.outputs.workflow }}
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:
- 'hydra/**'
workflow:
- '.github/workflows/integration-hydra.yml'
build-and-integration-test-hydra:
runs-on: ubuntu-latest
env:
cache_id: program-hydra
needs: changes
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' || needs.changes.outputs.workflow == '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 Program
- uses: ./.github/actions/build-hydra
- uses: ./.github/actions/build-token-metadata

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

# Run integration test
- name: start-local-test-validator
working-directory: ./hydra/js
run: yarn run api:gen && yarn run build && DEBUG=amman* yarn amman:start && DEBUG=mpl* yarn test && yarn run amman:stop

# - name: integration-test-hydra-program
# id: run_integration_test
# working-directory: ./hydra/js
# run: DEBUG=mpl* yarn test

# - name: stop-local-test-validator
# working-directory: ./hydra/js
# run: yarn amman:stop
79 changes: 79 additions & 0 deletions .github/workflows/program-hydra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Program Hydra

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

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.10.25
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:
- 'hydra/**'
build-and-test-hyrdra:
needs: changes
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' }}
runs-on: ubuntu-latest
env:
cache_id: program-hydra

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 }}

# Run lint checks
- uses: ./.github/actions/verify-rust
with:
working-directory: ./hydra/program

# Build deps
- uses: ./.github/actions/build-token-metadata

# Run test
# - name: test-hydra-program
# id: run_test
# working-directory: ./hydra/program
# run: |
# cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1
# cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version
# cargo +${{ env.RUST_TOOLCHAIN }} test-bpf -- --nocapture --test-threads 1
53 changes: 53 additions & 0 deletions .github/workflows/sdk-hydra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: SDK Hydra

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

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.10.35
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:
- 'hydra/**'
build-lint-and-test-hydra:
needs: changes
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' }}
runs-on: ubuntu-latest

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 }}

- uses: ./.github/actions/yarn-install-and-verify
with:
cache_id: sdk-hydra
working_dir: ./hydra/js
build_token_metadata: true
skip_test: true
8 changes: 7 additions & 1 deletion Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@ program = "target/deploy/mpl_fixed_price_sale.so"
address = "gdrpGjVffourzkdDRrQmySw4aTHr8a3xmQzzxSwFD1a"
program = "target/deploy/mpl_gumdrop.so"

[[test.genesis]]
address = "hyDQ4Nz1eYyegS6JfenyKwKzYxRsCWCriYSAjtzP4Vg"
program = "target/deploy/mpl_hydra.so"

[workspace]
members = [
"token-entangler/program",
"token-metadata/program",
"auction-house/program",
"fixed-price-sale/program",
"bubblegum/program"
"hydra/program",
"bubblegum/program",
"candy-wrapper/program"
]
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exclude = [
"fixed-price-sale/cli",
"token-metadata",
"auction-house/program",
"hydra/program",
"candy-machine/program",
"bubblegum/program",
"candy-wrapper/program",
Expand Down
2 changes: 1 addition & 1 deletion bubblegum/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ fn process_creator_verification<'info>(
.collect::<Vec<Creator>>();

// Calculate new creator hash.
let updated_creator_hash = hash_creators(&updated_creator_vec)?;
let updated_creator_hash = hash_creators(&message.creators)?;

// Update creator Vec in metadata args.
message.creators = updated_creator_vec;
Expand Down
1 change: 1 addition & 0 deletions core/rust/testing-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ num = "~0.4"
num-derive = "~0.3"
num-traits = "~0.2"
borsh = "~0.9.1"

2 changes: 1 addition & 1 deletion fixed-price-sale/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ solana-program-test = "~1.9.28"
solana-program = "~1.9.28"
solana-sdk = "~1.9.28"
spl-associated-token-account = "~1.0.3"
mpl-testing-utils= {path="../../core/rust/testing-utils" }
mpl-testing-utils= {path="../../core/rust/testing-utils" }
40 changes: 40 additions & 0 deletions hydra/cli/cli_api.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
use clap::{crate_description, crate_name, crate_version, App, Arg, SubCommand};
use solana_clap_utils::input_validators::{is_url, is_valid_signer};

pub const SHOW: &str = "show_hydra";

pub fn init_api<'a, 'b>() -> App<'a, 'b> {
App::new(crate_name!())
.about(crate_description!())
.version(crate_version!())
.arg(
Arg::with_name("keypair")
.long("keypair")
.value_name("KEYPAIR")
.validator(is_valid_signer)
.takes_value(true)
.global(true)
.help("Filepath or URL to a keypair"),
)
.arg(
Arg::with_name("rpc")
.long("json_rpc_url")
.value_name("URL")
.takes_value(true)
.global(true)
.validator(is_url)
.help("JSON RPC URL for the cluster [default: devnet]"),
)
.subcommand(
SubCommand::with_name(SHOW)
.about("Show Hydra")
.arg(
Arg::with_name("hydra_address")
.long("hydra_address")
.global(true)
.value_name("NAME")
.takes_value(true)
.help("The Hydra Address. Note this must be the parent address not the mint addresses"),
)
)
}
Loading

0 comments on commit d0de9f4

Please sign in to comment.