Skip to content

Commit

Permalink
Merge pull request #485 from tonlabs/1.23.0-rc
Browse files Browse the repository at this point in the history
Version 1.23.0
  • Loading branch information
d3p authored Oct 5, 2021
2 parents e773f53 + cd288f7 commit 746c8ed
Show file tree
Hide file tree
Showing 43 changed files with 2,065 additions and 170 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file.

## [1.23.0] – 2021-10-05

### New
- `boc.get_code_salt` and `boc.set_code_salt` functions for contract code salt management.
- `boc.encode_tvc` and `boc.decode_tvc` functions for TVC image encoding and decoding
- `boc.get_compiler_version` function extracting compiler version from contract code
- `abi.update_initial_data` and `abi.decode_initial_data` function for pre-deployment contract data management

## [1.22.0] – 2021-09-20

### New
Expand Down
2 changes: 1 addition & 1 deletion api/derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "api_derive"
version = "1.22.0"
version = "1.23.0"
authors = ["TON DEV SOLUTIONS LTD <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion api/info/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "api_info"
version = "1.22.0"
version = "1.23.0"
authors = ["TON DEV SOLUTIONS LTD <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion api/test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "api_test"
version = "1.22.0"
version = "1.23.0"
authors = ["TON DEV SOLUTIONS LTD <[email protected]>"]
edition = "2018"

Expand Down
134 changes: 133 additions & 1 deletion docs/mod_abi.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Provides message encoding and decoding according to the ABI specification.

[decode_account_data](#decode_account_data) – Decodes account data using provided data BOC and ABI.

[update_initial_data](#update_initial_data) – Updates initial account data with initial values for the contract's static variables and owner's public key. This operation is applicable only for initial account data (before deploy). If the contract is already deployed, its data doesn't contain this data section any more.

[decode_initial_data](#decode_initial_data) – Decodes initial values of a contract's static variables and owner's public key from account initial data This operation is applicable only for initial account data (before deploy). If the contract is already deployed, its data doesn't contain this data section any more.

## Types
[AbiErrorCode](#AbiErrorCode)

Expand Down Expand Up @@ -89,6 +93,14 @@ Provides message encoding and decoding according to the ABI specification.

[ResultOfDecodeData](#ResultOfDecodeData)

[ParamsOfUpdateInitialData](#ParamsOfUpdateInitialData)

[ResultOfUpdateInitialData](#ResultOfUpdateInitialData)

[ParamsOfDecodeInitialData](#ParamsOfDecodeInitialData)

[ResultOfDecodeInitialData](#ResultOfDecodeInitialData)


# Functions
## encode_message_body
Expand Down Expand Up @@ -481,6 +493,73 @@ function decode_account_data(
- `data`: _any_ – Decoded data as a JSON structure.


## update_initial_data

Updates initial account data with initial values for the contract's static variables and owner's public key. This operation is applicable only for initial account data (before deploy). If the contract is already deployed, its data doesn't contain this data section any more.

```ts
type ParamsOfUpdateInitialData = {
abi?: Abi,
data: string,
initial_data?: any,
initial_pubkey?: string,
boc_cache?: BocCacheType
}

type ResultOfUpdateInitialData = {
data: string
}

function update_initial_data(
params: ParamsOfUpdateInitialData,
): Promise<ResultOfUpdateInitialData>;
```
### Parameters
- `abi`?: _[Abi](mod_abi.md#Abi)_ – Contract ABI
- `data`: _string_ – Data BOC or BOC handle
- `initial_data`?: _any_ – List of initial values for contract's static variables.
<br>`abi` parameter should be provided to set initial data
- `initial_pubkey`?: _string_ – Initial account owner's public key to set into account data
- `boc_cache`?: _[BocCacheType](mod_boc.md#BocCacheType)_ – Cache type to put the result. The BOC itself returned if no cache type provided.


### Result

- `data`: _string_ – Updated data BOC or BOC handle


## decode_initial_data

Decodes initial values of a contract's static variables and owner's public key from account initial data This operation is applicable only for initial account data (before deploy). If the contract is already deployed, its data doesn't contain this data section any more.

```ts
type ParamsOfDecodeInitialData = {
abi?: Abi,
data: string
}

type ResultOfDecodeInitialData = {
initial_data?: any,
initial_pubkey: string
}

function decode_initial_data(
params: ParamsOfDecodeInitialData,
): Promise<ResultOfDecodeInitialData>;
```
### Parameters
- `abi`?: _[Abi](mod_abi.md#Abi)_ – Contract ABI.
<br>Initial data is decoded if this parameter is provided
- `data`: _string_ – Data BOC or BOC handle


### Result

- `initial_data`?: _any_ – List of initial values of contract's public variables.
<br>Initial data is decoded if `abi` input parameter is provided
- `initial_pubkey`: _string_ – Initial account owner's public key


# Types
## AbiErrorCode
```ts
Expand All @@ -497,7 +576,8 @@ enum AbiErrorCode {
InvalidSigner = 310,
InvalidAbi = 311,
InvalidFunctionId = 312,
InvalidData = 313
InvalidData = 313,
EncodeInitialDataFailed = 314
}
```
One of the following value:
Expand All @@ -515,6 +595,7 @@ One of the following value:
- `InvalidAbi = 311`
- `InvalidFunctionId = 312`
- `InvalidData = 313`
- `EncodeInitialDataFailed = 314`


## Abi
Expand Down Expand Up @@ -1138,3 +1219,54 @@ type ResultOfDecodeData = {
- `data`: _any_ – Decoded data as a JSON structure.
## ParamsOfUpdateInitialData
```ts
type ParamsOfUpdateInitialData = {
abi?: Abi,
data: string,
initial_data?: any,
initial_pubkey?: string,
boc_cache?: BocCacheType
}
```
- `abi`?: _[Abi](mod_abi.md#Abi)_ – Contract ABI
- `data`: _string_ – Data BOC or BOC handle
- `initial_data`?: _any_ – List of initial values for contract's static variables.
<br>`abi` parameter should be provided to set initial data
- `initial_pubkey`?: _string_ – Initial account owner's public key to set into account data
- `boc_cache`?: _[BocCacheType](mod_boc.md#BocCacheType)_ – Cache type to put the result. The BOC itself returned if no cache type provided.
## ResultOfUpdateInitialData
```ts
type ResultOfUpdateInitialData = {
data: string
}
```
- `data`: _string_ – Updated data BOC or BOC handle
## ParamsOfDecodeInitialData
```ts
type ParamsOfDecodeInitialData = {
abi?: Abi,
data: string
}
```
- `abi`?: _[Abi](mod_abi.md#Abi)_ – Contract ABI.
<br>Initial data is decoded if this parameter is provided
- `data`: _string_ – Data BOC or BOC handle
## ResultOfDecodeInitialData
```ts
type ResultOfDecodeInitialData = {
initial_data?: any,
initial_pubkey: string
}
```
- `initial_data`?: _any_ – List of initial values of contract's public variables.
<br>Initial data is decoded if `abi` input parameter is provided
- `initial_pubkey`: _string_ – Initial account owner's public key
Loading

0 comments on commit 746c8ed

Please sign in to comment.