Skip to content

Commit

Permalink
Fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
larrinator1 committed Sep 3, 2021
1 parent 4c0e5f9 commit 8d1eede
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 9 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,15 @@ jobs:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
- uses: Swatinem/rust-cache@v1
- run: cargo publish --token ${{ secrets.CARGO_PUBLISH_TOKEN }}
- name: Publish mint wrapper
run: cargo publish --token ${{ secrets.CARGO_PUBLISH_TOKEN }}
working-directory: programs/quarry-mint-wrapper
- name: Publish mine
run: cargo publish --token ${{ secrets.CARGO_PUBLISH_TOKEN }}
working-directory: programs/quarry-mine
- name: Publish registry
run: cargo publish --token ${{ secrets.CARGO_PUBLISH_TOKEN }}
working-directory: programs/quarry-registry

release-binaries:
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ cluster = "localnet"
wallet = "~/.config/solana/id.json"

[[test.genesis]]
address = "QMNFUvncKBh11ZgEwYtoup3aXvuVxt6fzrcsjk2cjpM"
address = "QMNeHCGYnLVDn1icRAfQZpjPLBNkfGbSKRB83G5d8KB"
program = "./target/deploy/quarry_mine.so"

[[test.genesis]]
address = "QMWVettd5nC2Y9nSkXa4pznj2dMfBg5oqvwc4kV8Sa6"
address = "QMWoBmAyJLAsA1Lh9ugMTw2gciTihncciphzdNzdZYV"
program = "./target/deploy/quarry_mint_wrapper.so"

[[test.genesis]]
address = "QREGBnEj9Sa5uR91AV8u3FxThgP5ZCvdZUW2bHAkfNc"
program = "./target/deploy/quarry_registry.so"
1 change: 1 addition & 0 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions programs/quarry-mine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
mod macros;

use anchor_lang::prelude::*;
use anchor_lang::solana_program::declare_id;
use anchor_lang::Key;
use anchor_spl::token::{self, Mint, TokenAccount, Transfer};
use num_traits::ToPrimitive;
Expand All @@ -30,7 +29,7 @@ pub mod rewarder;

use crate::quarry::StakeAction;

declare_id!("QMNFUvncKBh11ZgEwYtoup3aXvuVxt6fzrcsjk2cjpM");
solana_program::declare_id!("QMNeHCGYnLVDn1icRAfQZpjPLBNkfGbSKRB83G5d8KB");

/// Maximum number of tokens that can be rewarded by a [Rewarder] per year.
pub const MAX_ANNUAL_REWARDS_RATE: u64 = u64::MAX >> 3;
Expand Down
3 changes: 1 addition & 2 deletions programs/quarry-mint-wrapper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
mod macros;

use anchor_lang::prelude::*;
use anchor_lang::solana_program::declare_id;
use anchor_lang::Key;
use anchor_spl::token::{self, Mint, TokenAccount};
use vipers::validate::Validate;

mod account_validators;

declare_id!("QMWVettd5nC2Y9nSkXa4pznj2dMfBg5oqvwc4kV8Sa6");
solana_program::declare_id!("QMWoBmAyJLAsA1Lh9ugMTw2gciTihncciphzdNzdZYV");

#[program]
pub mod quarry_mint_wrapper {
Expand Down
1 change: 1 addition & 0 deletions programs/quarry-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ default = []
[dependencies]
anchor-lang = "0.13.2"
quarry-mine = { version = "1.0.0", path = "../quarry-mine", features = ["cpi"] }
solana-program = "1.7.8"
vipers = "0.1.1"
2 changes: 2 additions & 0 deletions programs/quarry-registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use quarry_mine::Rewarder;

mod account_validators;

solana_program::declare_id!("QREGBnEj9Sa5uR91AV8u3FxThgP5ZCvdZUW2bHAkfNc");

#[program]
pub mod quarry_registry {
use vipers::validate::Validate;
Expand Down
9 changes: 7 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ import { PublicKey } from "@solana/web3.js";
import { QuarryMineJSON } from "./idls/quarry_mine";
import { QuarryMintWrapperJSON } from "./idls/quarry_mint_wrapper";
import type { MineProgram, MintWrapperProgram } from "./programs";
import type { RegistryProgram } from "./programs/registry";
import { QuarryRegistryJSON } from "./programs/registry";

export interface Programs {
MintWrapper: MintWrapperProgram;
Mine: MineProgram;
Registry: RegistryProgram;
}

// See `Anchor.toml` for all addresses.
export const QUARRY_ADDRESSES = {
MintWrapper: new PublicKey("QMWVettd5nC2Y9nSkXa4pznj2dMfBg5oqvwc4kV8Sa6"),
Mine: new PublicKey("QMNFUvncKBh11ZgEwYtoup3aXvuVxt6fzrcsjk2cjpM"),
MintWrapper: new PublicKey("QMWoBmAyJLAsA1Lh9ugMTw2gciTihncciphzdNzdZYV"),
Mine: new PublicKey("QMNeHCGYnLVDn1icRAfQZpjPLBNkfGbSKRB83G5d8KB"),
Registry: new PublicKey("QREGBnEj9Sa5uR91AV8u3FxThgP5ZCvdZUW2bHAkfNc"),
};

export const QUARRY_IDLS = {
MintWrapper: QuarryMintWrapperJSON,
Mine: QuarryMineJSON,
Registry: QuarryRegistryJSON,
};

/**
Expand Down
1 change: 1 addition & 0 deletions src/programs/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./mine";
export * from "./mintWrapper";
export * from "./registry";
20 changes: 20 additions & 0 deletions src/programs/registry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { AnchorTypes } from "@saberhq/anchor-contrib";

import type { QuarryRegistryIDL } from "../idls/quarry_registry";

export * from "../idls/quarry_registry";

export type RegistryTypes = AnchorTypes<
QuarryRegistryIDL,
{
registry: RegistryData;
}
>;

type Accounts = RegistryTypes["Accounts"];

export type RegistryData = Accounts["Registry"];

export type RegistryError = RegistryTypes["Error"];

export type RegistryProgram = RegistryTypes["Program"];

0 comments on commit 8d1eede

Please sign in to comment.