Make anchor's lint pass
This commit is contained in:
parent
0265b9b0a9
commit
58105207af
|
@ -7,9 +7,8 @@ set -e pipefail
|
||||||
WALLET_WITH_FUNDS=~/.config/solana/mango-devnet.json
|
WALLET_WITH_FUNDS=~/.config/solana/mango-devnet.json
|
||||||
PROGRAM_ID=5V2zCYCQkm4sZc3WctiwQEAzvfAiFxyjbwCvzQnmtmkM
|
PROGRAM_ID=5V2zCYCQkm4sZc3WctiwQEAzvfAiFxyjbwCvzQnmtmkM
|
||||||
|
|
||||||
# TODO fix need for --skip-lint
|
|
||||||
# build program,
|
# 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
|
# patch types, which we want in rust, but anchor client doesn't support
|
||||||
./idl-fixup.sh
|
./idl-fixup.sh
|
||||||
|
|
|
@ -27,6 +27,7 @@ pub struct FlashLoanBegin<'info> {
|
||||||
pub token_program: Program<'info, Token>,
|
pub token_program: Program<'info, Token>,
|
||||||
|
|
||||||
/// Instructions Sysvar for instruction introspection
|
/// Instructions Sysvar for instruction introspection
|
||||||
|
/// CHECK: fixed instructions sysvar account
|
||||||
#[account(address = tx_instructions::ID)]
|
#[account(address = tx_instructions::ID)]
|
||||||
pub instructions: UncheckedAccount<'info>,
|
pub instructions: UncheckedAccount<'info>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,10 @@ pub struct TokenUpdateIndexAndRate<'info> {
|
||||||
)]
|
)]
|
||||||
pub mint_info: AccountLoader<'info, MintInfo>,
|
pub mint_info: AccountLoader<'info, MintInfo>,
|
||||||
|
|
||||||
|
/// CHECK: oracle can be one of multiple account types
|
||||||
pub oracle: UncheckedAccount<'info>,
|
pub oracle: UncheckedAccount<'info>,
|
||||||
|
|
||||||
|
/// CHECK: fixed instructions sysvar account
|
||||||
#[account(address = tx_instructions::ID)]
|
#[account(address = tx_instructions::ID)]
|
||||||
pub instructions: UncheckedAccount<'info>,
|
pub instructions: UncheckedAccount<'info>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,7 @@ impl<T: Sized> DerefOrBorrowMut<[T]> for Vec<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct AccountLoaderDynamic<'info, D: DynamicAccountType> {
|
pub struct AccountLoaderDynamic<'info, D: DynamicAccountType> {
|
||||||
|
/// CHECK: is checked below
|
||||||
acc_info: AccountInfo<'info>,
|
acc_info: AccountInfo<'info>,
|
||||||
phantom1: PhantomData<&'info D>,
|
phantom1: PhantomData<&'info D>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,8 @@ set -ex pipefail
|
||||||
WALLET_WITH_FUNDS=~/.config/solana/mango-devnet.json
|
WALLET_WITH_FUNDS=~/.config/solana/mango-devnet.json
|
||||||
PROGRAM_ID=m43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD
|
PROGRAM_ID=m43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD
|
||||||
|
|
||||||
# TODO fix need for --skip-lint
|
|
||||||
# build program,
|
# 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
|
# patch types, which we want in rust, but anchor client doesn't support
|
||||||
./idl-fixup.sh
|
./idl-fixup.sh
|
||||||
|
|
|
@ -5,9 +5,8 @@ set -ex pipefail
|
||||||
WALLET_WITH_FUNDS=~/.config/solana/mango-mainnet.json
|
WALLET_WITH_FUNDS=~/.config/solana/mango-mainnet.json
|
||||||
PROGRAM_ID=m43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD
|
PROGRAM_ID=m43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD
|
||||||
|
|
||||||
# TODO fix need for --skip-lint
|
|
||||||
# build program,
|
# 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
|
# patch types, which we want in rust, but anchor client doesn't support
|
||||||
./idl-fixup.sh
|
./idl-fixup.sh
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
|
|
||||||
set -e pipefail
|
set -e pipefail
|
||||||
|
|
||||||
# TODO fix need for --skip-lint
|
|
||||||
# build program,
|
# 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
|
# patch types, which we want in rust, but anchor client doesn't support
|
||||||
./idl-fixup.sh
|
./idl-fixup.sh
|
||||||
|
|
Loading…
Reference in New Issue