Browse Source

Delete basics/cross-program-invocation/native directory

Joe Caulfield 3 years ago
parent
commit
23ed76e173

+ 0 - 8
basics/cross-program-invocation/native/cicd.sh

@@ -1,8 +0,0 @@
-#!/bin/bash
-
-# This script is for quick building & deploying of the program.
-# It also serves as a reference for the commands used for building & deploying Solana programs.
-# Run this bad boy with "bash cicd.sh" or "./cicd.sh"
-
-cargo build-bpf --manifest-path=./program/Cargo.toml --bpf-out-dir=./program/target/so
-solana program deploy ./program/target/so/program.so

+ 0 - 18
basics/cross-program-invocation/native/package.json

@@ -1,18 +0,0 @@
-{
-  "scripts": {
-    "test": "yarn run ts-mocha -p ./tsconfig.json -t 1000000 ./tests/test.ts"
-  },
-  "dependencies": {
-    "@solana/web3.js": "^1.47.3",
-    "fs": "^0.0.1-security"
-  },
-  "devDependencies": {
-    "@types/bn.js": "^5.1.0",
-    "@types/chai": "^4.3.1",
-    "@types/mocha": "^9.1.1",
-    "chai": "^4.3.4",
-    "mocha": "^9.0.3",
-    "ts-mocha": "^10.0.0",
-    "typescript": "^4.3.5"
-  }
-}

+ 0 - 10
basics/cross-program-invocation/native/program/Cargo.toml

@@ -1,10 +0,0 @@
-[package]
-name = "program"
-version = "0.1.0"
-edition = "2021"
-
-[dependencies]
-solana-program = "1.10.12"
-
-[lib]
-crate-type = ["cdylib", "lib"]

+ 0 - 29
basics/cross-program-invocation/native/program/src/lib.rs

@@ -1,29 +0,0 @@
-use solana_program::{
-    account_info::AccountInfo, 
-    entrypoint, 
-    entrypoint::ProgramResult, 
-    msg, 
-    pubkey::Pubkey,
-};
-
-
-// Tells Solana that the entrypoint to this program
-//  is the "process_instruction" function.
-//
-entrypoint!(process_instruction);
-
-
-// Our entrypoint's parameters have to match the
-//  anatomy of a transaction instruction (see README).
-//
-fn process_instruction(
-    program_id: &Pubkey,
-    accounts: &[AccountInfo],
-    instruction_data: &[u8],
-) -> ProgramResult {
-
-    
-    msg!("Hello, Solana!");
-
-    Ok(())
-}

+ 0 - 45
basics/cross-program-invocation/native/tests/test.ts

@@ -1,45 +0,0 @@
-import {
-    Connection,
-    Keypair,
-    sendAndConfirmTransaction,
-    Transaction,
-    TransactionInstruction,
-} from '@solana/web3.js';
-
-function createKeypairFromFile(path: string): Keypair {
-    return Keypair.fromSecretKey(
-        Buffer.from(JSON.parse(require('fs').readFileSync(path, "utf-8")))
-    )
-};
-
-
-describe("hello-solana", () => {
-
-    // Loading these from local files for development
-    //
-    const connection = new Connection(`http://localhost:8899`, 'confirmed');
-    const payer = createKeypairFromFile(require('os').homedir() + '/.config/solana/id.json');
-    const program = createKeypairFromFile('./program/target/so/program-keypair.json');
-  
-    it("Say hello!", async () => {
-
-        // We set up our instruction first.
-        //
-        let ix = new TransactionInstruction({
-            keys: [
-                {pubkey: payer.publicKey, isSigner: true, isWritable: true}
-            ],
-            programId: program.publicKey,
-            data: Buffer.alloc(0), // No data
-        });
-
-        // Now we send the transaction over RPC
-        //
-        await sendAndConfirmTransaction(
-            connection, 
-            new Transaction().add(ix), // Add our instruction (you can add more than one)
-            [payer]
-        );
-    });
-  });
-  

+ 0 - 10
basics/cross-program-invocation/native/tsconfig.json

@@ -1,10 +0,0 @@
-{
-  "compilerOptions": {
-    "types": ["mocha", "chai"],
-    "typeRoots": ["./node_modules/@types"],
-    "lib": ["es2015"],
-    "module": "commonjs",
-    "target": "es6",
-    "esModuleInterop": true
-  }
-}