Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Candy machine lock settings #511

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/actions/build-candy-machine/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 Candy Machine
runs:
using: 'composite'
steps:
- name: build-candy-machine-program
working-directory: ./candy-machine/program
run: |
cargo +${{ env.RUST_STABLE }} build-bpf --version
cargo +${{ env.RUST_STABLE }} build-bpf --bpf-out-dir ../../target/deploy/
shell: bash
85 changes: 85 additions & 0 deletions .github/workflows/integration-candy-machine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Integration Candy Machine

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

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.9.28
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:
- 'candy-machine/**'
workflow:
- '.github/workflows/integration-candy-machine.yml '
build-and-integration-test-candy-machine:
runs-on: ubuntu-latest
env:
cache_id: program-candy-machine
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 Programs
- uses: ./.github/actions/build-candy-machine
- uses: ./.github/actions/build-token-metadata

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

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

- name: integration-test-candy-machine-program
id: run_integration_test
working-directory: ./candy-machine/js
run: DEBUG=mpl* yarn test
24 changes: 13 additions & 11 deletions .github/workflows/sdk-candy-machine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
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:
- 'candy-machine/**'
- 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:
- 'candy-machine/**'

build-lint-and-test-candy-machine:
needs: changes
Expand All @@ -33,6 +33,8 @@ jobs:
steps:
- uses: actions/checkout@v1
- uses: ./.github/actions/yarn-install-and-verify
with:
with:
cache_id: sdk-candy-machine
working_dir: ./candy-machine/js
build_token_metadata: true
skip_test: true

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"pubkey": "mgr99QFMYByTqGPWmNqunV7vBLmWWXdSrHUfV8Jf3JM",
"account": {
"lamports": 1141440,
"data": [
"AgAAAAv4lRE1fW5TPKNEw0MEXrE2lagComH6CRyIbCR8+VDU",
"base64"
],
"owner": "BPFLoaderUpgradeab1e11111111111111111111111",
"executable": true,
"rentEpoch": 281
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"pubkey": "tmeEDp1RgoDtZFtx6qod3HkbQmv9LMe36uqKVvsLTDE",
"account": {
"lamports": 1141440,
"data": [
"AgAAAMBWPj8PYCD+yh3tv0IG15oQYKlzJl5AI7aVmrEof4Gt",
"base64"
],
"owner": "BPFLoaderUpgradeab1e11111111111111111111111",
"executable": true,
"rentEpoch": 281
}
}
20 changes: 17 additions & 3 deletions candy-machine/js/.ammanrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
'use strict';
// @ts-check
const base = require('../../.base-ammanrc.js');
const tokenManager = require('@cardinal/token-manager');
const validator = {
...base.validator,
programs: [base.programs.metadata, base.programs.candy_machine],
...base.validator,
accountsCluster: 'https://api.metaplex.solana.com',
programs: [base.programs.metadata, base.programs.candy_machine],
accounts: [
{
label: 'Token Manager',
accountId: tokenManager.programs.tokenManager.TOKEN_MANAGER_ADDRESS.toString(),
executable: true,
},
{
label: 'Time Invalidator',
accountId: tokenManager.programs.timeInvalidator.TIME_INVALIDATOR_ADDRESS.toString(),
executable: true,
},
],
};
module.exports = {validator};
module.exports = { validator };
6 changes: 4 additions & 2 deletions candy-machine/js/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# mpl-candy-machine

#

This package contains the Candy Machine contract SDK code. This MPL package targets the current generation of candy machine on the v2.0.0 release line.
This package contains the Candy Machine contract SDK code. This MPL package targets the current
generation of candy machine on the v2.0.0 release line.

## Developing

In order to update the generated SDK when the rust contract was updated please run:

```
yarn gen:api
yarn api:gen
```

NOTE: at this point this only generates the IDL json file but later will generate TypeScript
Expand Down
Loading