Skip to content

Commit a1fd3c8

Browse files
committed
chore: add CI 8
1 parent 872d1b2 commit a1fd3c8

File tree

2 files changed

+47
-12
lines changed

2 files changed

+47
-12
lines changed

.github/workflows/pyth.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Check Pythnet
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions-rs/toolchain@v1
13+
with:
14+
profile: minimal
15+
toolchain: 1.60.0
16+
components: clippy
17+
override: true
18+
- name: Install dependencies
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang cmake make libprotobuf-dev
22+
- name: Check clippy
23+
run: cargo clippy --bins --tests --examples -- --deny warnings
24+
- name: Run tests
25+
run: cargo test
26+
format:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v2
30+
- uses: actions-rs/toolchain@v1
31+
with:
32+
profile: minimal
33+
toolchain: nightly-2022-04-01
34+
components: rustfmt
35+
override: true
36+
- name: Check formatting
37+
run: cargo fmt -- --check

validator/src/main.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,28 +3200,26 @@ fn process_account_indexes(matches: &ArgMatches) -> AccountSecondaryIndexes {
32003200
let exclude_keys = !account_indexes_exclude_keys.is_empty();
32013201
let include_keys = !account_indexes_include_keys.is_empty();
32023202

3203-
if include_keys {
3204-
if !account_indexes_include_keys.contains(&*ORACLE_PID)
3203+
if include_keys
3204+
&& (!account_indexes_include_keys.contains(&*ORACLE_PID)
32053205
|| !account_indexes_include_keys.contains(&*MESSAGE_BUFFER_PID)
3206-
|| !account_indexes_include_keys.contains(&*BATCH_PUBLISH_PID)
3207-
{
3208-
panic!(
3206+
|| !account_indexes_include_keys.contains(&*BATCH_PUBLISH_PID))
3207+
{
3208+
panic!(
32093209
"The oracle program id and message buffer program id must be included in the account index. Add the following flags\n\
32103210
--account-index-include-key {}\n\
32113211
--account-index-include-key {}\n\
32123212
--account-index-include-key {}\n",
32133213
&*ORACLE_PID, &*MESSAGE_BUFFER_PID, &*BATCH_PUBLISH_PID,
32143214
);
3215-
}
32163215
}
32173216

3218-
if exclude_keys {
3219-
if account_indexes_exclude_keys.contains(&*ORACLE_PID)
3217+
if exclude_keys
3218+
&& (account_indexes_exclude_keys.contains(&*ORACLE_PID)
32203219
|| account_indexes_exclude_keys.contains(&*MESSAGE_BUFFER_PID)
3221-
|| account_indexes_exclude_keys.contains(&*BATCH_PUBLISH_PID)
3222-
{
3223-
panic!("The oracle program id and message buffer program id must *not* be excluded from the account index.");
3224-
}
3220+
|| account_indexes_exclude_keys.contains(&*BATCH_PUBLISH_PID))
3221+
{
3222+
panic!("The oracle program id and message buffer program id must *not* be excluded from the account index.");
32253223
}
32263224

32273225
let keys = if !account_indexes.is_empty() && (exclude_keys || include_keys) {

0 commit comments

Comments
 (0)