Make anchor's lint pass

This commit is contained in:
Christian Kamm 2022-08-15 10:42:37 +02:00
parent 0265b9b0a9
commit 58105207af
7 changed files with 8 additions and 8 deletions

View File

@ -7,9 +7,8 @@ set -e pipefail
WALLET_WITH_FUNDS=~/.config/solana/mango-devnet.json
PROGRAM_ID=5V2zCYCQkm4sZc3WctiwQEAzvfAiFxyjbwCvzQnmtmkM
# TODO fix need for --skip-lint
# build program,
cargo run -p anchor-cli -- build --skip-lint
cargo run -p anchor-cli -- build
# patch types, which we want in rust, but anchor client doesn't support
./idl-fixup.sh

View File

@ -27,6 +27,7 @@ pub struct FlashLoanBegin<'info> {
pub token_program: Program<'info, Token>,
/// Instructions Sysvar for instruction introspection
/// CHECK: fixed instructions sysvar account
#[account(address = tx_instructions::ID)]
pub instructions: UncheckedAccount<'info>,
}

View File

@ -34,8 +34,10 @@ pub struct TokenUpdateIndexAndRate<'info> {
)]
pub mint_info: AccountLoader<'info, MintInfo>,
/// CHECK: oracle can be one of multiple account types
pub oracle: UncheckedAccount<'info>,
/// CHECK: fixed instructions sysvar account
#[account(address = tx_instructions::ID)]
pub instructions: UncheckedAccount<'info>,
}

View File

@ -115,6 +115,7 @@ impl<T: Sized> DerefOrBorrowMut<[T]> for Vec<T> {
}
pub struct AccountLoaderDynamic<'info, D: DynamicAccountType> {
/// CHECK: is checked below
acc_info: AccountInfo<'info>,
phantom1: PhantomData<&'info D>,
}

View File

@ -5,9 +5,8 @@ set -ex pipefail
WALLET_WITH_FUNDS=~/.config/solana/mango-devnet.json
PROGRAM_ID=m43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD
# TODO fix need for --skip-lint
# build program,
cargo run -p anchor-cli -- build --skip-lint
cargo run -p anchor-cli -- build
# patch types, which we want in rust, but anchor client doesn't support
./idl-fixup.sh

View File

@ -5,9 +5,8 @@ set -ex pipefail
WALLET_WITH_FUNDS=~/.config/solana/mango-mainnet.json
PROGRAM_ID=m43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD
# TODO fix need for --skip-lint
# build program,
cargo run -p anchor-cli -- build --skip-lint
cargo run -p anchor-cli -- build
# patch types, which we want in rust, but anchor client doesn't support
./idl-fixup.sh

View File

@ -2,9 +2,8 @@
set -e pipefail
# TODO fix need for --skip-lint
# build program,
cargo run -p anchor-cli -- build --skip-lint
cargo run -p anchor-cli -- build
# patch types, which we want in rust, but anchor client doesn't support
./idl-fixup.sh