Skip to content

Commit

Permalink
[v1.35.1-rc] Add support for SDK 1.35.1
Browse files Browse the repository at this point in the history
  • Loading branch information
risentveber committed Jul 9, 2022
1 parent bead2c8 commit 9dca9d4
Show file tree
Hide file tree
Showing 16 changed files with 148 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ linters:
- gci
- forcetypeassert
- exhaustruct
- revive
- stylecheck
enable-all: true
linters-settings:
goimports:
Expand Down
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TON SDK client Golang

[![EVER-SDK](https://img.shields.io/badge/EVER_SDK-1.34.3-green.svg)](https://github.com/tonlabs/EVER-SDK/tree/1.34.3)
[![TON local-node docker image](https://img.shields.io/badge/TON_local_node-0.30.1-green.svg)](https://hub.docker.com/layers/local-node/tonlabs/local-node/0.30.1/images/sha256-e51f289a3e9f31f1c9f7fdb825060b11026a331ee7fd1a7cd243cf925ce9b5dd)
[![EVER-SDK](https://img.shields.io/badge/EVER_SDK-1.35.1-green.svg)](https://github.com/tonlabs/EVER-SDK/tree/1.35.1)
[![TON local-node docker image](https://img.shields.io/badge/TON_local_node-0.32.0-green.svg)](https://hub.docker.com/layers/local-node/tonlabs/local-node/0.32.0/images/sha256-cdd54376eac60ef8d9e43fcaea7e6b9152b62920310a92b3fdac3066efd8c24e)
[![Chat Telegram](https://img.shields.io/badge/chat-Telegram-9cf.svg)](https://t.me/RADIANCE_EVER_SDK)
[![Documentation](https://godoc.org/github.com/radianceteam/everscale-client-go/client?status.svg)](https://godoc.org/github.com/radianceteam/everscale-client-go/client)
![CI tests and linters](https://github.com/radianceteam/everscale-client-go/workflows/CI/badge.svg)
Expand Down Expand Up @@ -73,7 +73,7 @@ All non-generated code has test coverage at least of 70% - one can see it via `t

```shell script
export CGO_LDFLAGS="-L$EVER_SDK_INSTALLATION_PATH -lton_client"
docker run -d --name local-node -p80:80 tonlabs/local-node:0.30.1
docker run -d --name local-node -p80:80 tonlabs/local-node:0.32.0
task test # tests without node
task full_test # tests including with node
task coverage # full_test with coverage
Expand Down
102 changes: 101 additions & 1 deletion api-spec.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.34.3",
"version": "1.35.0",
"modules": [
{
"name": "client",
Expand Down Expand Up @@ -5374,6 +5374,13 @@
"value": "314",
"summary": null,
"description": null
},
{
"name": "InvalidFunctionName",
"type": "Number",
"value": "315",
"summary": null,
"description": null
}
],
"summary": null,
Expand Down Expand Up @@ -6950,6 +6957,52 @@
],
"summary": null,
"description": null
},
{
"name": "ParamsOfCalcFunctionId",
"type": "Struct",
"struct_fields": [
{
"name": "abi",
"type": "Ref",
"ref_name": "abi.Abi",
"summary": "Contract ABI.",
"description": null
},
{
"name": "function_name",
"type": "String",
"summary": "Contract function name",
"description": null
},
{
"name": "output",
"type": "Optional",
"optional_inner": {
"type": "Boolean"
},
"summary": "If set to `true` output function ID will be returned which is used in contract response. Default is `false`",
"description": null
}
],
"summary": null,
"description": null
},
{
"name": "ResultOfCalcFunctionId",
"type": "Struct",
"struct_fields": [
{
"name": "function_id",
"type": "Number",
"number_type": "UInt",
"number_size": 32,
"summary": "Contract function ID",
"description": null
}
],
"summary": null,
"description": null
}
],
"functions": [
Expand Down Expand Up @@ -7484,6 +7537,44 @@
]
},
"errors": null
},
{
"name": "calc_function_id",
"summary": "Calculates contract function ID by contract ABI",
"description": null,
"params": [
{
"name": "_context",
"type": "Generic",
"generic_name": "Arc",
"generic_args": [
{
"type": "Ref",
"ref_name": "ClientContext"
}
],
"summary": null,
"description": null
},
{
"name": "params",
"type": "Ref",
"ref_name": "abi.ParamsOfCalcFunctionId",
"summary": null,
"description": null
}
],
"result": {
"type": "Generic",
"generic_name": "ClientResult",
"generic_args": [
{
"type": "Ref",
"ref_name": "abi.ResultOfCalcFunctionId"
}
]
},
"errors": null
}
]
},
Expand Down Expand Up @@ -10512,6 +10603,15 @@
},
"summary": "transaction logical time",
"description": null
},
{
"name": "chksig_always_succeed",
"type": "Optional",
"optional_inner": {
"type": "Boolean"
},
"summary": "Overrides standard TVM behaviour. If set to `true` then CHKSIG always will return `true`.",
"description": null
}
],
"summary": null,
Expand Down
27 changes: 26 additions & 1 deletion client/mod_abi.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 11 Jun 22 07:51 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 22 15:07 UTC
//
// Mod abi
//
Expand Down Expand Up @@ -29,6 +29,7 @@ const (
InvalidFunctionIDAbiErrorCode = 312
InvalidDataAbiErrorCode = 313
EncodeInitialDataFailedAbiErrorCode = 314
InvalidFunctionNameAbiErrorCode = 315
)

func init() { // nolint gochecknoinits
Expand All @@ -46,6 +47,7 @@ func init() { // nolint gochecknoinits
errorCodesToErrorTypes[InvalidFunctionIDAbiErrorCode] = "InvalidFunctionIDAbiErrorCode"
errorCodesToErrorTypes[InvalidDataAbiErrorCode] = "InvalidDataAbiErrorCode"
errorCodesToErrorTypes[EncodeInitialDataFailedAbiErrorCode] = "EncodeInitialDataFailedAbiErrorCode"
errorCodesToErrorTypes[InvalidFunctionNameAbiErrorCode] = "InvalidFunctionNameAbiErrorCode"
}

type AbiHandle uint32
Expand Down Expand Up @@ -745,6 +747,20 @@ type ResultOfAbiEncodeBoc struct {
Boc string `json:"boc"`
}

type ParamsOfCalcFunctionId struct {
// Contract ABI.
Abi Abi `json:"abi"`
// Contract function name.
FunctionName string `json:"function_name"`
// If set to `true` output function ID will be returned which is used in contract response. Default is `false`.
Output null.Bool `json:"output"` // optional
}

type ResultOfCalcFunctionId struct {
// Contract function ID.
FunctionID uint32 `json:"function_id"`
}

// Encodes message body according to ABI function call.
func (c *Client) AbiEncodeMessageBody(p *ParamsOfEncodeMessageBody) (*ResultOfEncodeMessageBody, error) {
result := new(ResultOfEncodeMessageBody)
Expand Down Expand Up @@ -933,3 +949,12 @@ func (c *Client) AbiEncodeBoc(p *ParamsOfAbiEncodeBoc) (*ResultOfAbiEncodeBoc, e

return result, err
}

// Calculates contract function ID by contract ABI.
func (c *Client) AbiCalcFunctionId(p *ParamsOfCalcFunctionId) (*ResultOfCalcFunctionId, error) {
result := new(ResultOfCalcFunctionId)

err := c.dllClient.waitErrorOrResultUnmarshal("abi.calc_function_id", p, result)

return result, err
}
2 changes: 1 addition & 1 deletion client/mod_boc.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 11 Jun 22 07:51 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 22 15:07 UTC
//
// Mod boc
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_client.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 11 Jun 22 07:51 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 22 15:07 UTC
//
// Mod client
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_crypto.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 11 Jun 22 07:51 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 22 15:07 UTC
//
// Mod crypto
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_debot.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 11 Jun 22 07:51 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 22 15:07 UTC
//
// Mod debot
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_net.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 11 Jun 22 07:51 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 22 15:07 UTC
//
// Mod net
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_processing.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 11 Jun 22 07:51 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 22 15:07 UTC
//
// Mod processing
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_proofs.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 11 Jun 22 07:51 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 22 15:07 UTC
//
// Mod proofs
//
Expand Down
4 changes: 3 additions & 1 deletion client/mod_tvm.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 11 Jun 22 07:51 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 22 15:07 UTC
//
// Mod tvm
//
Expand Down Expand Up @@ -56,6 +56,8 @@ type ExecutionOptions struct {
BlockLt *big.Int `json:"block_lt"` // optional
// transaction logical time.
TransactionLt *big.Int `json:"transaction_lt"` // optional
// Overrides standard TVM behaviour. If set to `true` then CHKSIG always will return `true`.
ChksigAlwaysSucceed null.Bool `json:"chksig_always_succeed"` // optional
}

// Non-existing account to run a creation internal message. Should be used with `skip_transaction_check = true` if the message has no deploy data since transactions on the uninitialized account are always aborted.
Expand Down
2 changes: 1 addition & 1 deletion client/mod_utils.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 11 Jun 22 07:51 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 22 15:07 UTC
//
// Mod utils
//
Expand Down
2 changes: 2 additions & 0 deletions cmd/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import (
"log"
"os"

"github.com/iancoleman/strcase"
"github.com/radianceteam/everscale-client-go/spec"
)

func main() {
strcase.ConfigureAcronym("ID", "id")
file, err := os.Open("./api-spec.json")
if err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.17

require (
github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2
github.com/iancoleman/strcase v0.1.2
github.com/iancoleman/strcase v0.2.0
github.com/spf13/cobra v1.1.3
github.com/stretchr/testify v1.7.0
github.com/volatiletech/null v8.0.0+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hokaccha/go-prettyjson v0.0.0-20190818114111-108c894c2c0e h1:0aewS5NTyxftZHSnFaJmWE5oCCrj4DyEXkAiMa1iZJM=
github.com/hokaccha/go-prettyjson v0.0.0-20190818114111-108c894c2c0e/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI=
github.com/iancoleman/strcase v0.1.2 h1:gnomlvw9tnV3ITTAxzKSgTF+8kFWcU/f+TgttpXGz1U=
github.com/iancoleman/strcase v0.1.2/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0=
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
Expand Down

0 comments on commit 9dca9d4

Please sign in to comment.