-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLOB-1043] replicate IsLiquidatable logic on daemon #873
Changes from all commits
d446a89
d9fa678
7180bd1
6a36196
1d38b49
d12f799
85bb561
1d7facb
577500c
2294683
b90c55b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { PageRequest, PageRequestSDKType, PageResponse, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; | ||
import { SubaccountId, SubaccountIdSDKType } from "../subaccounts/subaccount"; | ||
import { ValidatorMevMatches, ValidatorMevMatchesSDKType, MevNodeToNodeMetrics, MevNodeToNodeMetricsSDKType } from "./mev"; | ||
import { ClobPair, ClobPairSDKType } from "./clob_pair"; | ||
import { EquityTierLimitConfiguration, EquityTierLimitConfigurationSDKType } from "./equity_tier_limit_config"; | ||
|
@@ -51,52 +50,6 @@ export interface QueryClobPairAllResponseSDKType { | |
clob_pair: ClobPairSDKType[]; | ||
pagination?: PageResponseSDKType; | ||
} | ||
/** | ||
* AreSubaccountsLiquidatableRequest is a request message used to check whether | ||
* the given subaccounts are liquidatable. | ||
* The subaccount ids should not contain duplicates. | ||
*/ | ||
|
||
export interface AreSubaccountsLiquidatableRequest { | ||
subaccountIds: SubaccountId[]; | ||
} | ||
/** | ||
* AreSubaccountsLiquidatableRequest is a request message used to check whether | ||
* the given subaccounts are liquidatable. | ||
* The subaccount ids should not contain duplicates. | ||
*/ | ||
|
||
export interface AreSubaccountsLiquidatableRequestSDKType { | ||
subaccount_ids: SubaccountIdSDKType[]; | ||
} | ||
/** | ||
* AreSubaccountsLiquidatableResponse is a response message that contains the | ||
* liquidation status for each subaccount. | ||
*/ | ||
|
||
export interface AreSubaccountsLiquidatableResponse { | ||
results: AreSubaccountsLiquidatableResponse_Result[]; | ||
} | ||
/** | ||
* AreSubaccountsLiquidatableResponse is a response message that contains the | ||
* liquidation status for each subaccount. | ||
*/ | ||
|
||
export interface AreSubaccountsLiquidatableResponseSDKType { | ||
results: AreSubaccountsLiquidatableResponse_ResultSDKType[]; | ||
} | ||
/** Result returns whether a subaccount should be liquidated. */ | ||
|
||
export interface AreSubaccountsLiquidatableResponse_Result { | ||
subaccountId?: SubaccountId; | ||
isLiquidatable: boolean; | ||
} | ||
/** Result returns whether a subaccount should be liquidated. */ | ||
|
||
export interface AreSubaccountsLiquidatableResponse_ResultSDKType { | ||
subaccount_id?: SubaccountIdSDKType; | ||
is_liquidatable: boolean; | ||
} | ||
/** | ||
* MevNodeToNodeCalculationRequest is a request message used to run the | ||
* MEV node <> node calculation. | ||
|
@@ -436,151 +389,6 @@ export const QueryClobPairAllResponse = { | |
|
||
}; | ||
|
||
function createBaseAreSubaccountsLiquidatableRequest(): AreSubaccountsLiquidatableRequest { | ||
return { | ||
subaccountIds: [] | ||
}; | ||
} | ||
|
||
export const AreSubaccountsLiquidatableRequest = { | ||
encode(message: AreSubaccountsLiquidatableRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
for (const v of message.subaccountIds) { | ||
SubaccountId.encode(v!, writer.uint32(10).fork()).ldelim(); | ||
} | ||
|
||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): AreSubaccountsLiquidatableRequest { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseAreSubaccountsLiquidatableRequest(); | ||
|
||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
|
||
switch (tag >>> 3) { | ||
case 1: | ||
message.subaccountIds.push(SubaccountId.decode(reader, reader.uint32())); | ||
break; | ||
|
||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
|
||
return message; | ||
}, | ||
|
||
fromPartial(object: DeepPartial<AreSubaccountsLiquidatableRequest>): AreSubaccountsLiquidatableRequest { | ||
const message = createBaseAreSubaccountsLiquidatableRequest(); | ||
message.subaccountIds = object.subaccountIds?.map(e => SubaccountId.fromPartial(e)) || []; | ||
return message; | ||
} | ||
|
||
}; | ||
|
||
function createBaseAreSubaccountsLiquidatableResponse(): AreSubaccountsLiquidatableResponse { | ||
return { | ||
results: [] | ||
}; | ||
} | ||
|
||
export const AreSubaccountsLiquidatableResponse = { | ||
encode(message: AreSubaccountsLiquidatableResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
for (const v of message.results) { | ||
AreSubaccountsLiquidatableResponse_Result.encode(v!, writer.uint32(10).fork()).ldelim(); | ||
} | ||
|
||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): AreSubaccountsLiquidatableResponse { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseAreSubaccountsLiquidatableResponse(); | ||
|
||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
|
||
switch (tag >>> 3) { | ||
case 1: | ||
message.results.push(AreSubaccountsLiquidatableResponse_Result.decode(reader, reader.uint32())); | ||
break; | ||
|
||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
|
||
return message; | ||
}, | ||
|
||
fromPartial(object: DeepPartial<AreSubaccountsLiquidatableResponse>): AreSubaccountsLiquidatableResponse { | ||
const message = createBaseAreSubaccountsLiquidatableResponse(); | ||
message.results = object.results?.map(e => AreSubaccountsLiquidatableResponse_Result.fromPartial(e)) || []; | ||
return message; | ||
} | ||
|
||
}; | ||
|
||
function createBaseAreSubaccountsLiquidatableResponse_Result(): AreSubaccountsLiquidatableResponse_Result { | ||
return { | ||
subaccountId: undefined, | ||
isLiquidatable: false | ||
}; | ||
} | ||
|
||
export const AreSubaccountsLiquidatableResponse_Result = { | ||
encode(message: AreSubaccountsLiquidatableResponse_Result, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
if (message.subaccountId !== undefined) { | ||
SubaccountId.encode(message.subaccountId, writer.uint32(10).fork()).ldelim(); | ||
} | ||
|
||
if (message.isLiquidatable === true) { | ||
writer.uint32(16).bool(message.isLiquidatable); | ||
} | ||
|
||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): AreSubaccountsLiquidatableResponse_Result { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseAreSubaccountsLiquidatableResponse_Result(); | ||
|
||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
|
||
switch (tag >>> 3) { | ||
case 1: | ||
message.subaccountId = SubaccountId.decode(reader, reader.uint32()); | ||
break; | ||
|
||
case 2: | ||
message.isLiquidatable = reader.bool(); | ||
break; | ||
|
||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
|
||
return message; | ||
}, | ||
|
||
fromPartial(object: DeepPartial<AreSubaccountsLiquidatableResponse_Result>): AreSubaccountsLiquidatableResponse_Result { | ||
const message = createBaseAreSubaccountsLiquidatableResponse_Result(); | ||
message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? SubaccountId.fromPartial(object.subaccountId) : undefined; | ||
message.isLiquidatable = object.isLiquidatable ?? false; | ||
return message; | ||
} | ||
|
||
}; | ||
|
||
function createBaseMevNodeToNodeCalculationRequest(): MevNodeToNodeCalculationRequest { | ||
return { | ||
blockProposerMatches: undefined, | ||
Comment on lines
392
to
394
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The search results indicate that the function Given this information, it is clear that the removal of Here is the concise response: The function
A fix would involve either restoring the function or updating the code to remove or replace these references. Analysis chainThe function Scripts ExecutedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for any remaining references to createBaseMevNodeToNodeCalculationRequest in the codebase.
rg 'createBaseMevNodeToNodeCalculationRequest'
Length of output: 462 |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided context from the
swagger.yaml
file confirms that there are still references toAreSubaccountsLiquidatableResponse
and itsResult
type in the Swagger documentation. These references are part of the API documentation and should be updated or removed to reflect the changes made in the codebase where the corresponding interfaces and functions were removed.Given this information, the review comment is valid, and the references in the Swagger documentation should be addressed to ensure consistency with the updated codebase.
The removal of interfaces and functions related to
AreSubaccountsLiquidatable
has not been fully propagated throughout the codebase. References to these entities still exist in the Swagger documentation (swagger.yaml
). These should be updated or removed to reflect the changes in the codebase.protocol/client/docs/swagger-ui/swagger.yaml
: Contains outdated references toAreSubaccountsLiquidatableResponse
andAreSubaccountsLiquidatableResponse.Result
.Analysis chain
Confirm that the removal of interfaces and functions related to
AreSubaccountsLiquidatable
has been fully propagated throughout the codebase, ensuring no dangling references or calls to these removed entities remain.The search results indicate that there are still references to
AreSubaccountsLiquidatableResponse
and itsResult
in theswagger.yaml
file within theprotocol/client/docs/swagger-ui
directory. These references should be checked and potentially removed or updated to reflect the changes made in the PR.Scripts Executed
The following scripts were executed for the analysis:
Script:
Length of output: 496
Script:
Length of output: 1016