cli, examples, tests: Remove global JavaScript dependencies in favour of local (#990)

This commit is contained in:
Tom Linton 2021-11-12 11:38:35 +13:00 committed by GitHub
parent d027b39c56
commit 468fe79473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 2944 additions and 108 deletions

View File

@ -21,19 +21,12 @@ _defaults: &defaults
_tests: &tests
before_install:
- nvm install $NODE_VERSION
- npm install -g mocha
- npm install -g ts-mocha
- npm install -g typescript
- npm install -g ts-node
- npm install -g buffer
- cd ts && yarn && yarn build && npm link && cd ../
- npm install -g @project-serum/serum
- npm install -g @project-serum/common
- npm install -g @solana/spl-token
- cd ts && yarn && yarn build && yarn link && cd ../
- cd examples/tutorial && yarn && yarn link @project-serum/anchor && cd ../../
- cd tests && yarn && yarn link @project-serum/anchor && cd ..
- sudo apt-get install -y pkg-config build-essential libudev-dev
- sh -c "$(curl -sSfL https://release.solana.com/v${SOLANA_CLI_VERSION}/install)"
- export PATH="/home/travis/.local/share/solana/install/active_release/bin:$PATH"
- export NODE_PATH="/home/travis/.nvm/versions/node/v${NODE_VERSION}/lib/node_modules/:$NODE_PATH"
- yes | solana-keygen new
- cargo install --path $TRAVIS_BUILD_DIR/cli anchor-cli --locked
@ -67,20 +60,16 @@ jobs:
- pushd tests/misc && anchor test && popd
- pushd tests/events && anchor test && popd
- pushd tests/cashiers-check && anchor test && popd
- pushd tests/typescript && yarn && anchor test && popd
- pushd tests/zero-copy && yarn && anchor test && popd
- pushd tests/chat && yarn && anchor test && popd
- pushd tests/ido-pool && yarn && anchor test && popd
- pushd tests/typescript && anchor test && popd
- pushd tests/zero-copy && anchor test && popd
- pushd tests/chat && anchor test && popd
- pushd tests/ido-pool && anchor test && popd
- pushd tests/swap/deps/serum-dex/dex && cargo build-bpf && cd ../../../ && anchor test && popd
- pushd tests/cfo && anchor run test-with-build && popd
- <<: *tests
name: Runs the e2e tests 3
script:
- pushd tests/escrow && yarn && anchor test && popd
- pushd tests/pyth && yarn && anchor test && popd
- pushd tests/system-accounts && yarn && anchor test && popd
- pushd examples/tutorial/basic-0 && anchor test && popd
- pushd examples/tutorial/basic-1 && anchor test && popd
- pushd examples/tutorial/basic-2 && anchor test && popd
- pushd examples/tutorial/basic-3 && anchor test && popd
- pushd examples/tutorial/basic-4 && anchor test && popd
- pushd tests/escrow && anchor test && popd
- pushd tests/pyth && anchor test && popd
- pushd tests/system-accounts && anchor test && popd
- pushd examples/tutorial && yarn workspaces run test

View File

@ -11,6 +11,8 @@ incremented for features.
## [Unreleased]
* cli: Replace global JavaScript dependency installs with local.
### Features
* lang: Add `SystemAccount<'info>` account type for generic wallet addresses or accounts owned by the system program ([#954](https://github.com/project-serum/anchor/pull/954))

View File

@ -400,9 +400,9 @@ fn init(cfg_override: &ConfigOverride, name: String, javascript: bool) -> Result
cfg.scripts.insert(
"test".to_owned(),
if javascript {
"mocha -t 1000000 tests/"
"yarn run mocha -t 1000000 tests/"
} else {
"ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
"yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
}
.to_owned(),
);

View File

@ -40,6 +40,7 @@ Initializes a project workspace with the following structure.
* `Anchor.toml`: Anchor configuration file.
* `Cargo.toml`: Rust workspace configuration file.
* `package.json`: JavaScript dependencies file.
* `programs/`: Directory for Solana program crates.
* `app/`: Directory for your application frontend.
* `tests/`: Directory for JavaScript integration tests.
@ -228,4 +229,3 @@ anchor verify <program-id>
```
Verifies the on-chain bytecode matches the locally compiled artifact.

View File

@ -21,12 +21,12 @@ See the solana [docs](https://docs.solana.com/cli/install-solana-cli-tools) for
sh -c "$(curl -sSfL https://release.solana.com/v1.8.0/install)"
```
## Install Mocha
## Install Yarn
Program integration tests are run using [Mocha](https://mochajs.org/).
[Yarn](https://yarnpkg.com/) is recommended for JavaScript package management.
```bash
npm install -g mocha
npm install -g yarn
```
## Install Anchor
@ -53,15 +53,6 @@ On Linux systems you may need to install additional dependencies if `cargo insta
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev
```
To install the JavaScript package.
```bash
npm install -g @project-serum/anchor
```
Make sure your `NODE_PATH` is set properly so that globally installed modules
can be resolved.
Now verify the CLI is installed properly.
```bash

View File

@ -17,12 +17,18 @@ Next, checkout the tagged branch of the same version of the anchor cli you have
git checkout tags/<version>
```
And change directories to the [example](https://github.com/project-serum/anchor/tree/master/examples/tutorial/basic-0).
Change directories to the [example](https://github.com/project-serum/anchor/tree/master/examples/tutorial/basic-0).
```bash
cd anchor/examples/tutorial/basic-0
```
And install any additional JavaScript dependencies:
```bash
yarn install
```
## Starting a Localnet
In a separate terminal, start a local network. If you're running solana

View File

@ -12,12 +12,18 @@ To get started, clone the repo.
git clone https://github.com/project-serum/anchor
```
And change directories to the [example](https://github.com/project-serum/anchor/tree/master/examples/tutorial/basic-1).
Change directories to the [example](https://github.com/project-serum/anchor/tree/master/examples/tutorial/basic-1).
```bash
cd anchor/examples/tutorial/basic-1
```
And install any additional JavaScript dependencies:
```bash
yarn install
```
## Defining a Program
We define our program as follows

View File

@ -26,12 +26,18 @@ To get started, clone the repo.
git clone https://github.com/project-serum/anchor
```
And change directories to the [example](https://github.com/project-serum/anchor/tree/master/examples/tutorial/basic-2).
Change directories to the [example](https://github.com/project-serum/anchor/tree/master/examples/tutorial/basic-2).
```bash
cd anchor/examples/tutorial/basic-2
```
And install any additional JavaScript dependencies:
```bash
yarn install
```
## Defining a Program
Here we have a simple **Counter** program, where anyone can create a counter, but only the assigned

View File

@ -11,12 +11,18 @@ To get started, clone the repo.
git clone https://github.com/project-serum/anchor
```
And change directories to the [example](https://github.com/project-serum/anchor/tree/master/examples/tutorial/basic-3).
Change directories to the [example](https://github.com/project-serum/anchor/tree/master/examples/tutorial/basic-3).
```bash
cd anchor/examples/tutorial/basic-3
```
And install any additional JavaScript dependencies:
```bash
yarn install
```
## Defining a Puppet Program
We start with the program that will be called by another program, the puppet.
@ -44,8 +50,8 @@ Things to notice
here `SetData` and `puppet_program`.
* To invoke an instruction on another program, just use the `cpi` module on the crate, here, `puppet::cpi::set_data`.
* Our `Accounts` struct contains the puppet account we are calling into via CPI. Accounts used for CPI are not specifically denoted
as such with the `CpiAccount` label since v0.15. Accounts used for CPI are not fundamentally different from `Program` or `Signer`
accounts except for their role and ownership in the specific context in which they are used.
as such with the `CpiAccount` label since v0.15. Accounts used for CPI are not fundamentally different from `Program` or `Signer`
accounts except for their role and ownership in the specific context in which they are used.
::: tip
When using another Anchor program for CPI, make sure to specify the `cpi` feature in your `Cargo.toml`.

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
basic_0 = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "basic-0",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
basic_1 = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "basic-1",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
basic_2 = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "basic-2",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -7,4 +7,4 @@ puppet = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
puppet_master = "HmbTLCmaGvZhKnn1Zfa1JVnp7vkMV4DYVxPLWBVoN65L"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "basic-3",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
basic_4 = "CwrqeMj2U8tFr1Rhkgwc84tpAsqbt9pTt2a4taoTADPr"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "basic-4",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -0,0 +1,17 @@
{
"name": "anchor-examples",
"private": true,
"workspaces": [
"basic-0",
"basic-1",
"basic-2",
"basic-3",
"basic-4"
],
"dependencies": {
"@project-serum/anchor": "^0.18.0"
},
"devDependencies": {
"mocha": "^9.1.3"
}
}

1048
examples/tutorial/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
cashiers_check = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "cashiers-check",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -11,7 +11,7 @@ lockup = { address = "6ebQNeTPZ1j7k3TtkCCtEPRvG7GQsucQrZ7sSEDQi9Ks", idl = "./de
#
# Testing.
#
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"
test-with-build = "anchor run build && anchor test --skip-build"
#
# Build the program and all CPI dependencies.

19
tests/cfo/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "cfo",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor run test-with-build"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
chat = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

19
tests/chat/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "chat",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
composite = "EHthziFziNoac9LBGxEaVN47Y3uUiRoXvqAiR6oes4iU"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "composite",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
errors = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

19
tests/errors/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "errors",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -1,17 +1,19 @@
{
"dependencies": {
"@project-serum/anchor": "../../ts",
"@project-serum/serum": "latest",
"@solana/spl-token": "latest",
"@solana/web3.js": "latest",
"@types/chai": "^4.2.22",
"@types/mocha": "^9.0.0",
"@types/node": "^14.14.37",
"bn.js": "^5.2.0",
"camelcase": "^6.2.0",
"chai": "^4.3.4",
"mocha": "^9.1.2",
"ts-mocha": "^8.0.0",
"typescript": "^4.4.3"
"name": "escrow",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -1,10 +1,6 @@
import * as anchor from "../../../ts";
import { Program, BN, IdlAccounts } from "../../../ts";
import {
PublicKey,
Keypair,
SystemProgram,
} from '@solana/web3.js';
import * as anchor from "@project-serum/anchor";
import { Program, BN, IdlAccounts } from "@project-serum/anchor";
import { PublicKey, Keypair, SystemProgram } from "@solana/web3.js";
import { TOKEN_PROGRAM_ID, Token } from "@solana/spl-token";
import { assert } from "chai";
import { Escrow } from "../target/types/escrow";
@ -119,9 +115,8 @@ describe("escrow", () => {
initializerTokenAccountA
);
let _escrowAccount: EscrowAccount = await program.account.escrowAccount.fetch(
escrowAccount.publicKey
);
let _escrowAccount: EscrowAccount =
await program.account.escrowAccount.fetch(escrowAccount.publicKey);
// Check that the new owner is the PDA.
assert.ok(_initializerTokenAccountA.owner.equals(pda));

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
events = "2dhGsWUzy5YKUsjZdLHLmkNpUDAXkNa9MYWsPc4Ziqzy"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

19
tests/events/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "events",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
ido_pool = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "ido-pool",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -7,4 +7,4 @@ counter = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
counter_auth = "Aws2XRVHjNqCUbMmaU245ojT2DBJFYX58KVo2YySEeeP"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "interface",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -7,4 +7,4 @@ lockup = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
registry = "HmbTLCmaGvZhKnn1Zfa1JVnp7vkMV4DYVxPLWBVoN65L"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

19
tests/lockup/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "lockup",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -14,4 +14,4 @@ program = "./target/deploy/misc.so"
exclude = ["programs/shared"]
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -1,7 +1,19 @@
{
"dependencies": {
"@project-serum/anchor": "^0.11.1",
"@solana/spl-token": "^0.1.6",
"mocha": "^9.0.3"
"name": "misc",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
multisig = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "multisig",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

40
tests/package.json Normal file
View File

@ -0,0 +1,40 @@
{
"name": "anchor-tests",
"private": true,
"workspaces": [
"cashiers-check",
"cfo",
"chat",
"composite",
"errors",
"escrow",
"events",
"ido-pool",
"interface",
"lockup",
"misc",
"multisig",
"permissioned-markets",
"pyth",
"spl/token-proxy",
"swap",
"system-accounts",
"sysvars",
"tictactoe",
"typescript",
"zero-copy"
],
"dependencies": {
"@project-serum/anchor": "^0.18.0",
"@project-serum/common": "^0.0.1-beta.3",
"@project-serum/serum": "^0.13.60",
"@solana/spl-token": "^0.1.8"
},
"devDependencies": {
"@types/node": "^14.14.37",
"chai": "^4.3.4",
"mocha": "^9.1.3",
"ts-mocha": "^8.0.0",
"typescript": "^4.4.4"
}
}

View File

@ -11,4 +11,4 @@ address = "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"
program = "./deps/serum-dex/dex/target/deploy/serum_dex.so"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "permissioned-markets",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
pyth = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

19
tests/pyth/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "pyth",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
token_proxy = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "token-proxy",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -10,4 +10,4 @@ address = "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"
program = "./deps/serum-dex/dex/target/deploy/serum_dex.so"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

19
tests/swap/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "swap",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
system_accounts = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "system-accounts",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
sysvars = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "sysvars",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -6,4 +6,4 @@ wallet = "~/.config/solana/id.json"
tictactoe = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"

View File

@ -0,0 +1,19 @@
{
"name": "tictactoe",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}

View File

@ -9,4 +9,4 @@ typescript = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
members = ["programs/typescript"]
[scripts]
test = "ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

View File

@ -1,17 +1,19 @@
{
"name": "typescript",
"version": "1.0.0",
"description": "",
"main": "index.js",
"directories": {
"test": "tests"
"name": "typescript-example",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@types/node": "^14.14.37"
"test": "anchor test"
}
}

1277
tests/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ wallet = "~/.config/solana/id.json"
members = ["programs/zero-copy", "programs/zero-cpi"]
[scripts]
test = "mocha -t 1000000 tests/"
test = "yarn run mocha -t 1000000 tests/"
[programs.localnet]
zero_cpi = "ErjUjtqKE5AGWUsjseSJCVLtddM6rhaMbDqmhzraF9h6"

View File

@ -0,0 +1,19 @@
{
"name": "zero-copy",
"version": "0.18.0",
"license": "(MIT OR Apache-2.0)",
"homepage": "https://github.com/project-serum/anchor#readme",
"bugs": {
"url": "https://github.com/project-serum/anchor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/project-serum/anchor.git"
},
"engines": {
"node": ">=11"
},
"scripts": {
"test": "anchor test"
}
}