-
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
[protocol][feat] add RPC query endpoint for withdrawal gating information #964
[protocol][feat] add RPC query endpoint for withdrawal gating information #964
Conversation
WalkthroughThe updates introduce new functionalities to query and handle withdrawal and transfer block information within a blockchain protocol. A method Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
chainOutageSeenAtBlock, chainOutageExists := downtimeInfo.BlockInfo.Height, downtimeInfo.BlockInfo.Height > 0 | ||
negativeTncSubaccountSeenAtBlock, negativeTncSubaccountSeenAtBlockExists := k.GetNegativeTncSubaccountSeenAtBlock(ctx) | ||
|
||
// Withdrawals and transfers are blocked at the |
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.
finish your thought 👑
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.
😭
negativeTncSubaccountSeenAtBlock, negativeTncSubaccountSeenAtBlockExists := k.GetNegativeTncSubaccountSeenAtBlock(ctx) | ||
|
||
// Withdrawals and transfers are blocked at the | ||
withdrawalsAndTransfersBlockedUntilBlock := uint32(0) |
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.
Blocked until block 0 means no blocking right?
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.
Yep, essentially means withdrawals and transfers are unblocked at block 0 (not blocked)
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.
blocktime usage looks good to me.
7470ff8
to
dab4323
Compare
d4c6e40
to
0647bcd
Compare
05343c5
to
7b565ff
Compare
4e6e7da
to
ef56034
Compare
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.
Review Status
Actionable comments generated: 10
Configuration used: CodeRabbit UI
Files ignored due to path filters (2)
protocol/x/subaccounts/types/query.pb.go
is excluded by:!**/*.pb.go
protocol/x/subaccounts/types/query.pb.gw.go
is excluded by:!**/*.pb.gw.go
Files selected for processing (11)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/subaccounts/query.lcd.ts (3 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/subaccounts/query.rpc.Query.ts (5 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/subaccounts/query.ts (2 hunks)
- proto/dydxprotocol/subaccounts/query.proto (2 hunks)
- protocol/mocks/MemClob.go (17 hunks)
- protocol/mocks/MemClobKeeper.go (13 hunks)
- protocol/mocks/QueryClient.go (1 hunks)
- protocol/x/subaccounts/keeper/grpc_query_withdrawal_and_transfers_blocked_info.go (1 hunks)
- protocol/x/subaccounts/keeper/grpc_query_withdrawal_and_transfers_blocked_info_test.go (1 hunks)
- protocol/x/subaccounts/keeper/subaccount.go (1 hunks)
- protocol/x/subaccounts/types/update.go (2 hunks)
Additional comments: 17
protocol/x/subaccounts/keeper/grpc_query_withdrawal_and_transfers_blocked_info.go (1)
- 13-44: The implementation of
GetWithdrawalAndTransfersBlockedInfo
method seems correct. It checks for a nil request, retrieves the downtime information, and calculates the block until which withdrawals and transfers are blocked based on the existence of a chain outage or a negative TNC subaccount. The response is constructed appropriately with the relevant block information.indexer/packages/v4-protos/src/codegen/dydxprotocol/subaccounts/query.lcd.ts (1)
- 38-50: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [3-48]
The addition of the
getWithdrawalAndTransfersBlockedInfo
method to theLCDQueryClient
class is implemented correctly. It binds the method to the class instance and defines the async function to make the appropriate GET request to the endpoint. The method signature and endpoint match the expected functionality described in the PR objectives.proto/dydxprotocol/subaccounts/query.proto (2)
- 26-33: The new RPC method
GetWithdrawalAndTransfersBlockedInfo
is defined correctly in thequery.proto
file. The method has the correct HTTP GET annotation and does not require any request parameters, which aligns with the expected functionality.- 58-68: The message
QueryGetWithdrawalAndTransfersBlockedInfoResponse
is defined correctly with the appropriate fields to convey the block information for withdrawal and transfer gating. The field names are clear and consistent with the domain language.indexer/packages/v4-protos/src/codegen/dydxprotocol/subaccounts/query.rpc.Query.ts (2)
- 10-21: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [4-47]
The
Query
interface and its implementationQueryClientImpl
have been correctly updated to include the newgetWithdrawalAndTransfersBlockedInfo
method. The method is bound to the instance and uses the correct RPC request and response types.
- 63-64: The
createRpcQueryExtension
function is correctly extended to include thegetWithdrawalAndTransfersBlockedInfo
method, allowing for the proper extension of theQueryClient
.protocol/x/subaccounts/types/update.go (1)
- 127-127: The new constant
WITHDRAWAL_AND_TRANSFERS_BLOCKED_AFTER_CHAIN_OUTAGE_DURATION
is set to 5 minutes, which is consistent with the PR objectives. The import of thetime
package is necessary for this constant definition.protocol/x/subaccounts/keeper/grpc_query_withdrawal_and_transfers_blocked_info_test.go (1)
- 19-214: The test cases for
TestQueryWithdrawalAndTransfersBlockedInfo
are comprehensive and cover various scenarios, including nil requests, no negative TNC subaccount or chain outage, and the presence of either or both conditions. The setup functions and assertions are correctly implemented to validate the behavior of theGetWithdrawalAndTransfersBlockedInfo
method.indexer/packages/v4-protos/src/codegen/dydxprotocol/subaccounts/query.ts (2)
- 54-79: The interfaces
QueryGetWithdrawalAndTransfersBlockedInfoRequest
andQueryGetWithdrawalAndTransfersBlockedInfoResponse
are defined correctly. They match the expected structure for the query request and response types, with appropriate field names and types.- 282-377: The functions
createBaseQueryGetWithdrawalAndTransfersBlockedInfoRequest
andcreateBaseQueryGetWithdrawalAndTransfersBlockedInfoResponse
along with their associated encode, decode, and fromPartial methods are implemented correctly. They follow the established patterns for working with Protobuf messages in TypeScript.protocol/mocks/MemClobKeeper.go (4)
- 98-102: The return signature of
CanDeleverageSubaccount
has not changed, but the mock function's implementation has been modified. Ensure that this change is intentional and correctly reflects the desired behavior of the mock.Please verify that the changes to the mock function
CanDeleverageSubaccount
are intentional and correctly implemented.
- 230-233: The return signature of
IsLiquidatable
has not changed, but the mock function's implementation has been modified. Ensure that this change is intentional and correctly reflects the desired behavior of the mock.Please verify that the changes to the mock function
IsLiquidatable
are intentional and correctly implemented.
- 303-309: The return signature of
ProcessSingleMatch
has not changed, but the mock function's implementation has been modified. Ensure that this change is intentional and correctly reflects the desired behavior of the mock.Please verify that the changes to the mock function
ProcessSingleMatch
are intentional and correctly implemented.
- 350-355: The return signature of
ReplayPlaceOrder
has not changed, but the mock function's implementation has been modified. Ensure that this change is intentional and correctly reflects the desired behavior of the mock.Please verify that the changes to the mock function
ReplayPlaceOrder
are intentional and correctly implemented.protocol/mocks/MemClob.go (1)
- 177-180: The return signature of
GetOperationsToReplay
has not changed, but the mock function's implementation has been modified. Ensure that this change is intentional and correctly reflects the desired behavior of the mock.Please verify that the changes to the mock function
GetOperationsToReplay
are intentional and correctly implemented.protocol/x/subaccounts/keeper/subaccount.go (1)
- 508-511: The
GetDowntimeInfoFor
method is now called with an additional argument,types.WITHDRAWAL_AND_TRANSFERS_BLOCKED_AFTER_CHAIN_OUTAGE_DURATION
. This constant should be defined elsewhere in the codebase, and its usage here implies a change in the logic for handling chain outages.Verification successful
The constant
WITHDRAWAL_AND_TRANSFERS_BLOCKED_AFTER_CHAIN_OUTAGE_DURATION
is indeed defined in the codebase, specifically in the fileprotocol/x/subaccounts/types/update.go
, and it is set to 5 minutes. The usage of this constant is found in two places within thesubaccounts
module:
- In
subaccount.go
, where it is passed as an argument to theGetDowntimeInfoFor
method.- In
grpc_query_withdrawal_and_transfers_blocked_info.go
, suggesting it is also used in the context of a gRPC query related to withdrawal and transfers blocking information.The review comment is consistent with the codebase, confirming that the
internalCanUpdateSubaccounts
method has been modified to include this constant as a parameter in a method call, which aligns with the PR's objective to handle withdrawal gating logic.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify the constant is defined and check for its usage across the codebase. rg 'WITHDRAWAL_AND_TRANSFERS_BLOCKED_AFTER_CHAIN_OUTAGE_DURATION' --type goLength of output: 466
protocol/mocks/QueryClient.go (1)
- 396-427: The new mock function
GetWithdrawalAndTransfersBlockedInfo
is consistent with the existing mock functions in terms of structure and parameter handling. Ensure that the actual RPC implementation matches this mock signature.
var r1 map[subaccountstypes.SubaccountId]subaccountstypes.UpdateResult | ||
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.ClobPairId, map[subaccountstypes.SubaccountId][]clobtypes.PendingOpenOrder) (bool, map[subaccountstypes.SubaccountId]subaccountstypes.UpdateResult)); ok { | ||
return rf(ctx, clobPairId, subaccountOpenOrders) | ||
} |
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 return signature of AddOrderToOrderbookCollatCheck
has been changed to include an error, but the actual return statement in the mock function has not been updated to reflect this change.
- return r0, r1
+ return r0, r1, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
var r1 map[subaccountstypes.SubaccountId]subaccountstypes.UpdateResult | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.ClobPairId, map[subaccountstypes.SubaccountId][]clobtypes.PendingOpenOrder) (bool, map[subaccountstypes.SubaccountId]subaccountstypes.UpdateResult)); ok { | |
return rf(ctx, clobPairId, subaccountOpenOrders) | |
} | |
var r1 map[subaccountstypes.SubaccountId]subaccountstypes.UpdateResult | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.ClobPairId, map[subaccountstypes.SubaccountId][]clobtypes.PendingOpenOrder) (bool, map[subaccountstypes.SubaccountId]subaccountstypes.UpdateResult, error)); ok { | |
return rf(ctx, clobPairId, subaccountOpenOrders) | |
} |
var r1 clobtypes.OrderStatus | ||
var r2 *clobtypes.OffchainUpdates | ||
var r3 error | ||
if rf, ok := ret.Get(0).(func(types.Context, *clobtypes.Order, clobtypes.MemClob) (subaccountstypes.BaseQuantums, clobtypes.OrderStatus, *clobtypes.OffchainUpdates, error)); ok { | ||
return rf(ctx, order, memclob) | ||
} |
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 return signature of AddPreexistingStatefulOrder
has been changed to include multiple return types and an error, but the actual return statement in the mock function has not been updated to reflect this change.
- return r0, r1, r2, r3
+ return r0, r1, r2, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
var r1 clobtypes.OrderStatus | |
var r2 *clobtypes.OffchainUpdates | |
var r3 error | |
if rf, ok := ret.Get(0).(func(types.Context, *clobtypes.Order, clobtypes.MemClob) (subaccountstypes.BaseQuantums, clobtypes.OrderStatus, *clobtypes.OffchainUpdates, error)); ok { | |
return rf(ctx, order, memclob) | |
} | |
var r1 clobtypes.OrderStatus | |
var r2 *clobtypes.OffchainUpdates | |
var r3 error | |
if rf, ok := ret.Get(0).(func(types.Context, *clobtypes.Order, clobtypes.MemClob) (subaccountstypes.BaseQuantums, clobtypes.OrderStatus, *clobtypes.OffchainUpdates, error)); ok { | |
return rf(ctx, order, memclob) | |
} | |
return r0, r1, r2, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic |
var r1 bool | ||
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.OrderId) (clobtypes.LongTermOrderPlacement, bool)); ok { | ||
return rf(ctx, orderId) | ||
} |
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 return signature of GetLongTermOrderPlacement
has been changed to include an error, but the actual return statement in the mock function has not been updated to reflect this change.
- return r0, r1
+ return r0, r1, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
var r1 bool | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.OrderId) (clobtypes.LongTermOrderPlacement, bool)); ok { | |
return rf(ctx, orderId) | |
} | |
var r1 bool | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.OrderId) (clobtypes.LongTermOrderPlacement, bool)); ok { | |
r0, r1 := rf(ctx, orderId) | |
return r0, r1, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic | |
} |
var r1 *big.Int | ||
if rf, ok := ret.Get(0).(func(types.Context, subaccountstypes.SubaccountId, uint32, *big.Int, bool) ([]clobtypes.MatchPerpetualDeleveraging_Fill, *big.Int)); ok { | ||
return rf(ctx, liquidatedSubaccountId, perpetualId, deltaQuantumsTotal, isFinalSettlement) | ||
} |
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 return signature of OffsetSubaccountPerpetualPosition
has been changed to include an error, but the actual return statement in the mock function has not been updated to reflect this change.
- return r0, r1
+ return r0, r1, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
var r1 *big.Int | |
if rf, ok := ret.Get(0).(func(types.Context, subaccountstypes.SubaccountId, uint32, *big.Int, bool) ([]clobtypes.MatchPerpetualDeleveraging_Fill, *big.Int)); ok { | |
return rf(ctx, liquidatedSubaccountId, perpetualId, deltaQuantumsTotal, isFinalSettlement) | |
} | |
var r1 *big.Int | |
if rf, ok := ret.Get(0).(func(types.Context, subaccountstypes.SubaccountId, uint32, *big.Int, bool) ([]clobtypes.MatchPerpetualDeleveraging_Fill, *big.Int, error)); ok { | |
return rf(ctx, liquidatedSubaccountId, perpetualId, deltaQuantumsTotal, isFinalSettlement) | |
} |
var r1 error | ||
if rf, ok := ret.Get(0).(func(types.Context, *clobtypes.MsgCancelOrder) (*clobtypes.OffchainUpdates, error)); ok { | ||
return rf(ctx, msgCancelOrder) | ||
} |
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 return signature of CancelOrder
has been changed to include an error, but the actual return statement in the mock function has not been updated to reflect this change.
- return r0, r1
+ return r0, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
var r1 error | |
if rf, ok := ret.Get(0).(func(types.Context, *clobtypes.MsgCancelOrder) (*clobtypes.OffchainUpdates, error)); ok { | |
return rf(ctx, msgCancelOrder) | |
} | |
var r1 error | |
if rf, ok := ret.Get(0).(func(types.Context, *clobtypes.MsgCancelOrder) (*clobtypes.OffchainUpdates, error)); ok { | |
return rf(ctx, msgCancelOrder), nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic | |
} |
var r1 error | ||
if rf, ok := ret.Get(0).(func(types.Context, subaccountstypes.SubaccountId, uint32, *big.Int, bool) (*big.Int, error)); ok { | ||
return rf(ctx, subaccountId, perpetualId, deltaQuantums, isFinalSettlement) | ||
} |
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 return signature of DeleverageSubaccount
has been changed to include an error, but the actual return statement in the mock function has not been updated to reflect this change.
- return r0, r1
+ return r0, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
var r1 error | |
if rf, ok := ret.Get(0).(func(types.Context, subaccountstypes.SubaccountId, uint32, *big.Int, bool) (*big.Int, error)); ok { | |
return rf(ctx, subaccountId, perpetualId, deltaQuantums, isFinalSettlement) | |
} | |
var r1 error | |
if rf, ok := ret.Get(0).(func(types.Context, subaccountstypes.SubaccountId, uint32, *big.Int, bool) (*big.Int, error)); ok { | |
return rf(ctx, subaccountId, perpetualId, deltaQuantums, isFinalSettlement), nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic | |
} |
var r1 error | ||
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.ClobPair, perpetualstypes.GetPricePremiumParams) (int32, error)); ok { | ||
return rf(ctx, clobPair, params) | ||
} |
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 return signature of GetPricePremium
has been changed to include an error, but the actual return statement in the mock function has not been updated to reflect this change.
- return r0, r1
+ return r0, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
var r1 error | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.ClobPair, perpetualstypes.GetPricePremiumParams) (int32, error)); ok { | |
return rf(ctx, clobPair, params) | |
} | |
var r1 error | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.ClobPair, perpetualstypes.GetPricePremiumParams) (int32, error)); ok { | |
return rf(ctx, clobPair, params), nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic | |
} |
var r1 error | ||
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.ClobPairId, subaccountstypes.SubaccountId, clobtypes.Order_Side) ([]clobtypes.Order, error)); ok { | ||
return rf(ctx, clobPairId, subaccountId, side) | ||
} |
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 return signature of GetSubaccountOrders
has been changed to include an error, but the actual return statement in the mock function has not been updated to reflect this change.
- return r0, r1
+ return r0, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
var r1 error | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.ClobPairId, subaccountstypes.SubaccountId, clobtypes.Order_Side) ([]clobtypes.Order, error)); ok { | |
return rf(ctx, clobPairId, subaccountId, side) | |
} | |
var r1 error | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.ClobPairId, subaccountstypes.SubaccountId, clobtypes.Order_Side) ([]clobtypes.Order, error)); ok { | |
return rf(ctx, clobPairId, subaccountId, side), nil | |
} |
var r1 clobtypes.OrderStatus | ||
var r2 *clobtypes.OffchainUpdates | ||
var r3 error | ||
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.Order) (subaccountstypes.BaseQuantums, clobtypes.OrderStatus, *clobtypes.OffchainUpdates, error)); ok { | ||
return rf(ctx, order) | ||
} |
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 return signature of PlaceOrder
has been changed to include an error, but the actual return statement in the mock function has not been updated to reflect this change.
- return r0, r1, r2, r3
+ return r0, r1, r2, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
var r1 clobtypes.OrderStatus | |
var r2 *clobtypes.OffchainUpdates | |
var r3 error | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.Order) (subaccountstypes.BaseQuantums, clobtypes.OrderStatus, *clobtypes.OffchainUpdates, error)); ok { | |
return rf(ctx, order) | |
} | |
var r1 clobtypes.OrderStatus | |
var r2 *clobtypes.OffchainUpdates | |
var r3 error | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.Order) (subaccountstypes.BaseQuantums, clobtypes.OrderStatus, *clobtypes.OffchainUpdates, error)); ok { | |
return rf(ctx, order) | |
} | |
// Assuming default nil error for the mock, adjust as needed based on the mock's logic | |
return r0, r1, r2, nil |
var r1 clobtypes.OrderStatus | ||
var r2 *clobtypes.OffchainUpdates | ||
var r3 error | ||
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.LiquidationOrder) (subaccountstypes.BaseQuantums, clobtypes.OrderStatus, *clobtypes.OffchainUpdates, error)); ok { | ||
return rf(ctx, liquidationOrder) | ||
} |
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 return signature of PlacePerpetualLiquidation
has been changed to include an error, but the actual return statement in the mock function has not been updated to reflect this change.
- return r0, r1, r2, r3
+ return r0, r1, r2, nil // Assuming default nil error for the mock, adjust as needed based on the mock's logic
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
var r1 clobtypes.OrderStatus | |
var r2 *clobtypes.OffchainUpdates | |
var r3 error | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.LiquidationOrder) (subaccountstypes.BaseQuantums, clobtypes.OrderStatus, *clobtypes.OffchainUpdates, error)); ok { | |
return rf(ctx, liquidationOrder) | |
} | |
var r1 clobtypes.OrderStatus | |
var r2 *clobtypes.OffchainUpdates | |
var r3 error | |
if rf, ok := ret.Get(0).(func(types.Context, clobtypes.LiquidationOrder) (subaccountstypes.BaseQuantums, clobtypes.OrderStatus, *clobtypes.OffchainUpdates, error)); ok { | |
return rf(ctx, liquidationOrder) | |
} | |
// Assuming default nil error for the mock, adjust as needed based on the mock's logic | |
return r0, r1, r2, nil |
Changelist
Add RPC query endpoint for withdrawal gating information.
Test Plan
Added unit tests, and will use when testing withdrawal gating E2E in
dev
/staging
env.Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.