Skip to content
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

get method order fix #602

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -6691,7 +6691,7 @@
},
"/v2/accounts/{account_id}/events/emulate": {
"post": {
"description": "Emulate sending message to blockchain",
"description": "Emulate sending message to retrieve account-specific events",
"operationId": "emulateMessageToAccountEvent",
"parameters": [
{
Expand Down Expand Up @@ -7546,16 +7546,6 @@
},
"type": "array"
}
},
{
"in": "query",
"name": "fix_order",
"required": false,
"schema": {
"default": true,
"description": "A temporary fix to switch to a scheme with direct ordering of arguments. \nIf equal to false, then the method takes arguments in direct order,\ne.g. for get_nft_content(int index, cell individual_content) we pass a list of arguments [index, individual_content].\nIf equal to true, then the method takes arguments in reverse order, e.g. [individual_content, index].",
"type": "boolean"
}
}
],
"responses": {
Expand Down Expand Up @@ -8181,7 +8171,7 @@
},
"/v2/events/emulate": {
"post": {
"description": "Emulate sending message to blockchain",
"description": "Emulate sending message to retrieve general blockchain events",
"operationId": "emulateMessageToEvent",
"parameters": [
{
Expand Down Expand Up @@ -10720,7 +10710,7 @@
},
"/v2/traces/emulate": {
"post": {
"description": "Emulate sending message to blockchain",
"description": "Emulate sending message to retrieve with a detailed execution trace",
"operationId": "emulateMessageToTrace",
"parameters": [
{
Expand Down Expand Up @@ -10823,7 +10813,7 @@
},
"/v2/wallet/emulate": {
"post": {
"description": "Emulate sending message to blockchain",
"description": "Emulate sending message to retrieve the resulting wallet state",
"operationId": "emulateMessageToWallet",
"parameters": [
{
Expand Down
11 changes: 0 additions & 11 deletions api/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,6 @@ paths:
items:
type: string
example: [ "0:9a33970f617bcd71acf2cd28357c067aa31859c02820d8f01d74c88063a8f4d8" ]
- name: fix_order
in: query
required: false
schema:
type: boolean
description: |-
A temporary fix to switch to a scheme with direct ordering of arguments.
If equal to false, then the method takes arguments in direct order,
e.g. for get_nft_content(int index, cell individual_content) we pass a list of arguments [index, individual_content].
If equal to true, then the method takes arguments in reverse order, e.g. [individual_content, index].
default: true
responses:
'200':
description: method execution result
Expand Down
8 changes: 1 addition & 7 deletions pkg/api/account_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ import (
"go.uber.org/zap"
"golang.org/x/exp/maps"

"github.com/tonkeeper/opentonapi/pkg/addressbook"
"golang.org/x/exp/slices"

"github.com/cespare/xxhash/v2"
"github.com/go-faster/jx"
"github.com/tonkeeper/opentonapi/internal/g"
"github.com/tonkeeper/opentonapi/pkg/addressbook"
"github.com/tonkeeper/opentonapi/pkg/core"
"github.com/tonkeeper/opentonapi/pkg/oas"
"github.com/tonkeeper/tongo"
Expand Down Expand Up @@ -210,10 +208,6 @@ func (h *Handler) ExecGetMethodForBlockchainAccount(ctx context.Context, params
}
return nil, toError(http.StatusInternalServerError, err)
}
// TODO: remove parameter after user migration
if params.FixOrder.IsSet() && params.FixOrder.Value == true && len(params.Args) > 1 {
slices.Reverse(params.Args)
}
key, err := getMethodCacheKey(account.ID, params.MethodName, contract.LastTransactionLt, params.Args)
if err != nil {
return nil, toError(http.StatusInternalServerError, err)
Expand Down
12 changes: 4 additions & 8 deletions pkg/oas/oas_handlers_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 0 additions & 56 deletions pkg/oas/oas_parameters_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/oas/oas_server_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/oas/oas_unimplemented_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading