program; fix health check ix gate (#940)

This commit is contained in:
Serge Farny 2024-04-11 07:22:29 +02:00 committed by GitHub
parent d0125e9fdf
commit fe86295d3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -17,7 +17,7 @@ pub enum HealthCheckKind {
#[derive(Accounts)]
pub struct HealthCheck<'info> {
#[account(
constraint = group.load()?.is_ix_enabled(IxGate::SequenceCheck) @ MangoError::IxIsDisabled,
constraint = group.load()?.is_ix_enabled(IxGate::HealthCheck) @ MangoError::IxIsDisabled,
)]
pub group: AccountLoader<'info, Group>,

View File

@ -311,6 +311,7 @@ export interface IxGateParams {
Serum3PlaceOrderV2: boolean;
TokenForceWithdraw: boolean;
SequenceCheck: boolean;
HealthCheck: boolean;
}
// Default with all ixs enabled, use with buildIxGate
@ -392,6 +393,7 @@ export const TrueIxGateParams: IxGateParams = {
Serum3PlaceOrderV2: true,
TokenForceWithdraw: true,
SequenceCheck: true,
HealthCheck: true,
};
// build ix gate e.g. buildIxGate(Builder(TrueIxGateParams).TokenDeposit(false).build()).toNumber(),
@ -483,6 +485,7 @@ export function buildIxGate(p: IxGateParams): BN {
toggleIx(ixGate, p, 'Serum3PlaceOrderV2', 71);
toggleIx(ixGate, p, 'TokenForceWithdraw', 72);
toggleIx(ixGate, p, 'SequenceCheck', 73);
toggleIx(ixGate, p, 'HealthCheck', 74);
return ixGate;
}