diff --git a/api/openapi.json b/api/openapi.json index 9534c1a3..348ecaf5 100644 --- a/api/openapi.json +++ b/api/openapi.json @@ -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": [ { @@ -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": { @@ -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": [ { @@ -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": [ { @@ -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": [ { diff --git a/api/openapi.yml b/api/openapi.yml index 7f0d8166..2634e8a3 100644 --- a/api/openapi.yml +++ b/api/openapi.yml @@ -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 diff --git a/pkg/api/account_handlers.go b/pkg/api/account_handlers.go index bd2d11c8..2131d285 100644 --- a/pkg/api/account_handlers.go +++ b/pkg/api/account_handlers.go @@ -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" @@ -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) diff --git a/pkg/oas/oas_handlers_gen.go b/pkg/oas/oas_handlers_gen.go index 5496811a..9964951b 100644 --- a/pkg/oas/oas_handlers_gen.go +++ b/pkg/oas/oas_handlers_gen.go @@ -608,7 +608,7 @@ func (s *Server) handleDnsResolveRequest(args [1]string, argsEscaped bool, w htt // handleEmulateMessageToAccountEventRequest handles emulateMessageToAccountEvent operation. // -// Emulate sending message to blockchain. +// Emulate sending message to retrieve account-specific events. // // POST /v2/accounts/{account_id}/events/emulate func (s *Server) handleEmulateMessageToAccountEventRequest(args [1]string, argsEscaped bool, w http.ResponseWriter, r *http.Request) { @@ -748,7 +748,7 @@ func (s *Server) handleEmulateMessageToAccountEventRequest(args [1]string, argsE // handleEmulateMessageToEventRequest handles emulateMessageToEvent operation. // -// Emulate sending message to blockchain. +// Emulate sending message to retrieve general blockchain events. // // POST /v2/events/emulate func (s *Server) handleEmulateMessageToEventRequest(args [0]string, argsEscaped bool, w http.ResponseWriter, r *http.Request) { @@ -884,7 +884,7 @@ func (s *Server) handleEmulateMessageToEventRequest(args [0]string, argsEscaped // handleEmulateMessageToTraceRequest handles emulateMessageToTrace operation. // -// Emulate sending message to blockchain. +// Emulate sending message to retrieve with a detailed execution trace. // // POST /v2/traces/emulate func (s *Server) handleEmulateMessageToTraceRequest(args [0]string, argsEscaped bool, w http.ResponseWriter, r *http.Request) { @@ -1016,7 +1016,7 @@ func (s *Server) handleEmulateMessageToTraceRequest(args [0]string, argsEscaped // handleEmulateMessageToWalletRequest handles emulateMessageToWallet operation. // -// Emulate sending message to blockchain. +// Emulate sending message to retrieve the resulting wallet state. // // POST /v2/wallet/emulate func (s *Server) handleEmulateMessageToWalletRequest(args [0]string, argsEscaped bool, w http.ResponseWriter, r *http.Request) { @@ -1220,10 +1220,6 @@ func (s *Server) handleExecGetMethodForBlockchainAccountRequest(args [2]string, Name: "args", In: "query", }: params.Args, - { - Name: "fix_order", - In: "query", - }: params.FixOrder, }, Raw: r, } diff --git a/pkg/oas/oas_parameters_gen.go b/pkg/oas/oas_parameters_gen.go index 108bd843..0d40cfd9 100644 --- a/pkg/oas/oas_parameters_gen.go +++ b/pkg/oas/oas_parameters_gen.go @@ -709,7 +709,6 @@ type ExecGetMethodForBlockchainAccountParams struct { // Contract get method name. MethodName string Args []string - FixOrder OptBool } func unpackExecGetMethodForBlockchainAccountParams(packed middleware.Parameters) (params ExecGetMethodForBlockchainAccountParams) { @@ -736,15 +735,6 @@ func unpackExecGetMethodForBlockchainAccountParams(packed middleware.Parameters) params.Args = v.([]string) } } - { - key := middleware.ParameterKey{ - Name: "fix_order", - In: "query", - } - if v, ok := packed[key]; ok { - params.FixOrder = v.(OptBool) - } - } return params } @@ -883,52 +873,6 @@ func decodeExecGetMethodForBlockchainAccountParams(args [2]string, argsEscaped b Err: err, } } - // Set default value for query: fix_order. - { - val := bool(true) - params.FixOrder.SetTo(val) - } - // Decode query: fix_order. - if err := func() error { - cfg := uri.QueryParameterDecodingConfig{ - Name: "fix_order", - Style: uri.QueryStyleForm, - Explode: true, - } - - if err := q.HasParam(cfg); err == nil { - if err := q.DecodeParam(cfg, func(d uri.Decoder) error { - var paramsDotFixOrderVal bool - if err := func() error { - val, err := d.DecodeValue() - if err != nil { - return err - } - - c, err := conv.ToBool(val) - if err != nil { - return err - } - - paramsDotFixOrderVal = c - return nil - }(); err != nil { - return err - } - params.FixOrder.SetTo(paramsDotFixOrderVal) - return nil - }); err != nil { - return err - } - } - return nil - }(); err != nil { - return params, &ogenerrors.DecodeParamError{ - Name: "fix_order", - In: "query", - Err: err, - } - } return params, nil } diff --git a/pkg/oas/oas_server_gen.go b/pkg/oas/oas_server_gen.go index 6947616d..feb6f104 100644 --- a/pkg/oas/oas_server_gen.go +++ b/pkg/oas/oas_server_gen.go @@ -42,25 +42,25 @@ type Handler interface { DnsResolve(ctx context.Context, params DnsResolveParams) (*DnsRecord, error) // EmulateMessageToAccountEvent implements emulateMessageToAccountEvent operation. // - // Emulate sending message to blockchain. + // Emulate sending message to retrieve account-specific events. // // POST /v2/accounts/{account_id}/events/emulate EmulateMessageToAccountEvent(ctx context.Context, req *EmulateMessageToAccountEventReq, params EmulateMessageToAccountEventParams) (*AccountEvent, error) // EmulateMessageToEvent implements emulateMessageToEvent operation. // - // Emulate sending message to blockchain. + // Emulate sending message to retrieve general blockchain events. // // POST /v2/events/emulate EmulateMessageToEvent(ctx context.Context, req *EmulateMessageToEventReq, params EmulateMessageToEventParams) (*Event, error) // EmulateMessageToTrace implements emulateMessageToTrace operation. // - // Emulate sending message to blockchain. + // Emulate sending message to retrieve with a detailed execution trace. // // POST /v2/traces/emulate EmulateMessageToTrace(ctx context.Context, req *EmulateMessageToTraceReq, params EmulateMessageToTraceParams) (*Trace, error) // EmulateMessageToWallet implements emulateMessageToWallet operation. // - // Emulate sending message to blockchain. + // Emulate sending message to retrieve the resulting wallet state. // // POST /v2/wallet/emulate EmulateMessageToWallet(ctx context.Context, req *EmulateMessageToWalletReq, params EmulateMessageToWalletParams) (*MessageConsequences, error) diff --git a/pkg/oas/oas_unimplemented_gen.go b/pkg/oas/oas_unimplemented_gen.go index 4d81e570..010e2c0b 100644 --- a/pkg/oas/oas_unimplemented_gen.go +++ b/pkg/oas/oas_unimplemented_gen.go @@ -62,7 +62,7 @@ func (UnimplementedHandler) DnsResolve(ctx context.Context, params DnsResolvePar // EmulateMessageToAccountEvent implements emulateMessageToAccountEvent operation. // -// Emulate sending message to blockchain. +// Emulate sending message to retrieve account-specific events. // // POST /v2/accounts/{account_id}/events/emulate func (UnimplementedHandler) EmulateMessageToAccountEvent(ctx context.Context, req *EmulateMessageToAccountEventReq, params EmulateMessageToAccountEventParams) (r *AccountEvent, _ error) { @@ -71,7 +71,7 @@ func (UnimplementedHandler) EmulateMessageToAccountEvent(ctx context.Context, re // EmulateMessageToEvent implements emulateMessageToEvent operation. // -// Emulate sending message to blockchain. +// Emulate sending message to retrieve general blockchain events. // // POST /v2/events/emulate func (UnimplementedHandler) EmulateMessageToEvent(ctx context.Context, req *EmulateMessageToEventReq, params EmulateMessageToEventParams) (r *Event, _ error) { @@ -80,7 +80,7 @@ func (UnimplementedHandler) EmulateMessageToEvent(ctx context.Context, req *Emul // EmulateMessageToTrace implements emulateMessageToTrace operation. // -// Emulate sending message to blockchain. +// Emulate sending message to retrieve with a detailed execution trace. // // POST /v2/traces/emulate func (UnimplementedHandler) EmulateMessageToTrace(ctx context.Context, req *EmulateMessageToTraceReq, params EmulateMessageToTraceParams) (r *Trace, _ error) { @@ -89,7 +89,7 @@ func (UnimplementedHandler) EmulateMessageToTrace(ctx context.Context, req *Emul // EmulateMessageToWallet implements emulateMessageToWallet operation. // -// Emulate sending message to blockchain. +// Emulate sending message to retrieve the resulting wallet state. // // POST /v2/wallet/emulate func (UnimplementedHandler) EmulateMessageToWallet(ctx context.Context, req *EmulateMessageToWalletReq, params EmulateMessageToWalletParams) (r *MessageConsequences, _ error) {