Skip to content

Commit

Permalink
chore: pull monorepo changes (#111)
Browse files Browse the repository at this point in the history
* Project import generated by Copybara.

GitOrigin-RevId: 8a02570f92a45d5127c2437ea4ceb1867f1da725

* chore: Update pnpm lockfile

---------

Co-authored-by: Copybara <[email protected]>
Co-authored-by: gallynaut <[email protected]>
  • Loading branch information
3 people authored Jul 19, 2023
1 parent 0b5e091 commit 84c2abc
Show file tree
Hide file tree
Showing 320 changed files with 39,576 additions and 178,647 deletions.
8 changes: 3 additions & 5 deletions examples/feeds/01_feed_client/Cargo.lock

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

2 changes: 1 addition & 1 deletion examples/feeds/01_feed_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ cpi = ["no-entrypoint"]

[dependencies]
# switchboard-solana = "0.8.4"
switchboard-solana = { version = "0.9.1", path = "../../../rust/switchboard-solana" }
switchboard-solana = { version = "0.8.4", path = "../../../rust/switchboard-solana" }
bytemuck = "1.13.1"
24 changes: 7 additions & 17 deletions examples/feeds/01_feed_client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,30 @@
"directory": "examples/feeds/01_feed_client"
},
"scripts": {
"lint": "eslint --ext .js,.json,.ts 'src/**' --fix",
"build:old": "node ../build.js anchor-vrf-parser 4hfkS97f5P6zauWeJF5dcZDFaJwYwbMPvKrANVAuKN4p",
"build": "anchor build",
"test": "npm run localnet && npm run network:create && npm run network:start & sleep 60 && anchor test --skip-local-validator",
"test:dev": "npm run localnet && npm run network:create && npm run network:start:dev & sleep 15 && anchor test --skip-local-validator"
"build:cargo": "anchor build",
"fix": "cargo fmt && pnpm exec prettier ./tests/*.ts -w",
"clean": "pnpm exec rimraf node_modules .anchor .turbo"
},
"dependencies": {
"@coral-xyz/anchor": "^0.28.0",
"@coral-xyz/borsh": "^0.28.0",
"@project-serum/borsh": "^0.2.5",
"@solana/spl-token": "^0.3.6",
"@solana/web3.js": "^1.77.3",
"@switchboard-xyz/common": "^2.2.4",
"@switchboard-xyz/oracle": "^2.1.13",
"@switchboard-xyz/solana.js": "workspace:*",
"@switchboard-xyz/common": "latest",
"@switchboard-xyz/oracle": "latest",
"@switchboard-xyz/solana.js": "latest",
"chalk": "^4.1.2",
"dotenv": "^16.0.1",
"yargs": "^17.5.1"
},
"devDependencies": {
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
"@types/node": "^17.0.45",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"chai": "^4.3.6",
"eslint": "^8.28.0",
"mocha": "^9.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.4.1",
"prettier-plugin-organize-imports": "^2.3.4",
"shx": "^0.3.4",
"ts-mocha": "^9.0.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.3"
"ts-mocha": "^9.0.2"
}
}
27 changes: 6 additions & 21 deletions examples/feeds/01_feed_client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,23 @@
}
},
"compilerOptions": {
"types": [
"mocha",
"chai",
"node"
],
"typeRoots": [
"./node_modules/@types"
],
"types": ["mocha", "chai", "node"],
"typeRoots": ["./node_modules/@types"],
"module": "commonjs",
"noEmit": true,
"esModuleInterop": true,
"strict": false,
"strictNullChecks": false,
"target": "es6",
"paths": {
"@switchboard-xyz/solana.js": [
"../../../javascript/solana.js"
]
"@switchboard-xyz/solana.js": ["../../../javascript/solana.js"]
}
},
"include": [
"tests/**/*",
"./cli.ts",
"./client/**/*"
],
"exclude": [
"target",
"lib"
],
"include": ["tests/**/*", "./cli.ts", "./client/**/*"],
"exclude": ["target", "lib"],
"references": [
{
"path": "../../../javascript/solana.js"
}
]
}
}
2 changes: 1 addition & 1 deletion examples/feeds/02_spl_native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ no-entrypoint = []

[dependencies]
# switchboard-solana = "0.8.4"
switchboard-solana = { version = "0.9.1", path = "../../../rust/switchboard-solana" }
switchboard-solana = { version = "0.8.4", path = "../../../rust/switchboard-solana" }
17 changes: 8 additions & 9 deletions examples/feeds/02_spl_native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,24 @@
"directory": "programs/native-feed-parser"
},
"scripts": {
"build:bpf": "cargo-build-sbf",
"build:cargo": "cargo-build-sbf",
"fix": "cargo fmt && pnpm exec prettier ./tests/*.ts -w",
"clean": "pnpm exec rimraf node_modules .anchor .turbo",
"deploy": "solana program deploy target/deploy/native_feed_parser.so",
"test": "echo \"For workspace native-feed-parser, use the anchor:test script\" && exit 0"
"test:program": "echo \"For workspace native-feed-parser, use the anchor:test script\" && exit 0"
},
"dependencies": {
"@coral-xyz/anchor": "^0.28.0",
"@solana/web3.js": "^1.77.3",
"@switchboard-xyz/common": "^2.2.4",
"@switchboard-xyz/oracle": "^2.1.13",
"@switchboard-xyz/solana.js": "workspace:*"
"@switchboard-xyz/common": "latest",
"@switchboard-xyz/oracle": "latest",
"@switchboard-xyz/solana.js": "latest"
},
"devDependencies": {
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
"@types/node": "^17.0.45",
"chai": "^4.3.6",
"mocha": "^9.0.3",
"ts-mocha": "^9.0.2",
"ts-node": "^10.4.0",
"typescript": "^4.7"
"ts-mocha": "^9.0.2"
}
}
23 changes: 6 additions & 17 deletions examples/feeds/02_spl_native/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
{
"compilerOptions": {
"types": [
"mocha",
"chai"
],
"typeRoots": [
"./node_modules/@types"
],
"lib": [
"es2015"
],
"types": ["mocha", "chai"],
"typeRoots": ["./node_modules/@types"],
"lib": ["es2015"],
"module": "commonjs",
"target": "es6",
"esModuleInterop": true,
"noEmit": true,
"paths": {
"@switchboard-xyz/solana.js": [
"../../../javascript/solana.js"
]
"@switchboard-xyz/solana.js": ["../../../javascript/solana.js"]
}
},
"exclude": [
"target"
],
"exclude": ["target"],
"references": [
{
"path": "../../../javascript/solana.js"
}
]
}
}
6 changes: 5 additions & 1 deletion examples/functions/01_basic_oracle/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ Makefile
README.md
node_modules
.turbo
measurement.txt
measurement.txt
.anchor
scripts
.prettierignore
.gitignore
10 changes: 7 additions & 3 deletions examples/functions/01_basic_oracle/Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ seeds = false
skip-lint = false

[programs.localnet]
basic_oracle = "8GHcguBXZEfKaLxRrBvis7LqPcFjBszv4ZYBgKwCUipS"
basic_oracle = "BkTMjFhosJ1xKtLMV2xchGtnTDBABLJ45aXzs7x9FdeX"

[programs.devnet]
basic_oracle = "BkTMjFhosJ1xKtLMV2xchGtnTDBABLJ45aXzs7x9FdeX"

[provider]
# cluster = "https://switchbo-switchbo-6225.devnet.rpcpool.com/f6fb9f02-0777-498b-b8f5-67cbb1fc0d14"
# cluster = "https://api.devnet.solana.com"
# wallet = "~/switchboard_environments_v2/devnet/upgrade_authority/upgrade_authority.json"
cluster = "Localnet"
wallet = "~/.config/solana/id.json"

# cluster = "devnet"
[scripts]
test = "pnpm exec ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

Expand Down Expand Up @@ -42,4 +46,4 @@ address = "sbattyXrzedoNATfc4L31wC9Mhxsi1BmFhTiN8gDshx"
address = "5ExuoQR69trmKQfB95fDsUGsUrrChbGq9PFgt8qouncz"

[[test.validator.clone]] # sb devnet attestation State
address = "BzqtGXZPiDSinP4xMFgPf6FLgSa6iPufK4m4JJFgMnTK"
address = "5MFs7RGTjLi1wtKNBFRtuLipCkkjs4YQwRRU9sjnbQbS"
2 changes: 1 addition & 1 deletion examples/functions/01_basic_oracle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ default = []

[dependencies]
switchboard-solana = { version = "=0.9.1" }
# switchboard-solana = { version = "0.9.1", path = "../../../../../rust/switchboard-solana" }
# switchboard-solana = { version = "0.9.1", path = "../../../rust/switchboard-solana" }
bytemuck = "^1"
anchor-lang = { version = "0.28.0", features = [
"init-if-needed",
Expand Down
37 changes: 37 additions & 0 deletions examples/functions/01_basic_oracle/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<div align="center">

![Switchboard Logo](https://github.com/switchboard-xyz/sbv2-core/raw/main/website/static/img/icons/switchboard/avatar.png)

# anchor-vrf-lite-parser

> An example program written in Anchor demonstrating how to integrate Switchboard Functions and verify attestation on-chain.
[![Anchor Test Status](https://github.com/switchboard-xyz/sbv2-solana/actions/workflows/anchor-test.yml/badge.svg)](https://github.com/switchboard-xyz/sbv2-solana/actions/workflows/anchor-test.yml)

</div>

<!-- install -->

<!-- installstop -->

## Usage

Build the example program

```bash
anchor build
```

Get your program ID and update `Anchor.toml` and `src/lib.rs` with your pubkey

```bash
export ANCHOR_VRF_LITE_PARSER_PUBKEY=$(solana-keygen pubkey target/deploy/anchor_vrf_lite_parser-keypair.json)
sed -i '' s/5Hhm5xKDiThfidbpqjJpKmMJEcKmjj5tEUNFpi2DzSvb/"$ANCHOR_VRF_LITE_PARSER_PUBKEY"/g Anchor.toml
sed -i '' s/5Hhm5xKDiThfidbpqjJpKmMJEcKmjj5tEUNFpi2DzSvb/"$ANCHOR_VRF_LITE_PARSER_PUBKEY"/g src/lib.rs
```

Then run Anchor test

```bash
anchor test
```
Loading

0 comments on commit 84c2abc

Please sign in to comment.