From 24ec0d57e9ae611898eef1345b225a9ef6ad37ca Mon Sep 17 00:00:00 2001 From: brewmaster012 <88689859+brewmaster012@users.noreply.github.com> Date: Wed, 19 Jun 2024 03:10:48 -0500 Subject: [PATCH] fix build and test build --- programs/protocol-contracts-solana/Cargo.toml | 2 +- programs/protocol-contracts-solana/src/lib.rs | 4 +--- tests/protocol-contracts-solana.ts | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/programs/protocol-contracts-solana/Cargo.toml b/programs/protocol-contracts-solana/Cargo.toml index ea2eb46..ebcb404 100644 --- a/programs/protocol-contracts-solana/Cargo.toml +++ b/programs/protocol-contracts-solana/Cargo.toml @@ -18,6 +18,6 @@ idl-build = ["anchor-lang/idl-build"] [dependencies] anchor-lang = "0.30.0" -anchor-spl = "0.30.0" +anchor-spl = { version = "0.30.0" , features = ["idl-build"]} solana-program = "1.18.15" diff --git a/programs/protocol-contracts-solana/src/lib.rs b/programs/protocol-contracts-solana/src/lib.rs index c7cd3b9..2391988 100644 --- a/programs/protocol-contracts-solana/src/lib.rs +++ b/programs/protocol-contracts-solana/src/lib.rs @@ -1,7 +1,6 @@ use anchor_lang::prelude::*; use anchor_lang::system_program; use anchor_spl::token::{transfer, Token, TokenAccount}; -use borsh::BorshDeserialize; use solana_program::keccak::hash; use solana_program::secp256k1_recover::secp256k1_recover; use std::mem::size_of; @@ -15,9 +14,8 @@ pub enum MyError { declare_id!("9WSwbVLthCsJXABeDJcVcw4UQMYuoNLTJTLqueFXU5Q2"); - #[program] -pub mod crowdfund { +pub mod gateway { use super::*; pub fn initialize(ctx: Context) -> Result<()> { diff --git a/tests/protocol-contracts-solana.ts b/tests/protocol-contracts-solana.ts index 9da7bfb..22af828 100644 --- a/tests/protocol-contracts-solana.ts +++ b/tests/protocol-contracts-solana.ts @@ -1,12 +1,12 @@ import * as anchor from "@coral-xyz/anchor"; import { Program } from "@coral-xyz/anchor"; -import { ProtocolContractsSolana } from "../target/types/protocol_contracts_solana"; +import { Gateway } from "../target/types/gateway"; -describe("protocol-contracts-solana", () => { +describe("some tests", () => { // Configure the client to use the local cluster. anchor.setProvider(anchor.AnchorProvider.env()); - const program = anchor.workspace.ProtocolContractsSolana as Program; + const program = anchor.workspace.Gateway as Program; it("Is initialized!", async () => { // Add your test here.