Skip to content

Commit

Permalink
Upgrade to SDK version 1.36.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-a-o committed Jul 24, 2022
1 parent fb876f8 commit 0be9022
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 29 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ jobs:

- name: Download PHP Installer
run: |
php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.35.1/installer.php', 'installer.php');"
php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.36.0/installer.php', 'installer.php');"
php -r "if (hash_file('sha384', 'installer.php') === '03586e200bc1c87f000c5a0eea27aa688eb451a5b946579205ca918bbffda7234359e2d0e176aa53e841c6a77b8de959') { echo 'Installer verified'; } else { echo 'Installer corrupt'; } echo PHP_EOL;"
- name: Install PHP Extension (Windows)
if: matrix.operating-system == 'windows-2019'
run: php installer.php -v 1.35.1
run: php installer.php -v 1.36.0

- name: Install PHP Extension (Ubuntu/Mac)
if: matrix.operating-system != 'windows-2019'
run: sudo php installer.php -v 1.35.1
run: sudo php installer.php -v 1.36.0

- name: Test PHP Extension
run: php installer.php -v 1.35.1 -T
run: php installer.php -v 1.36.0 -T

- name: Check PHP Extensions
run: php -m
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ Use [radianceteam/ton-client-php](https://hub.docker.com/r/radianceteam/ton-clie
as a base image in your `Dockerfile`:

```bash
FROM radianceteam/ton-client-php:1.35.1-php7.4-cli
FROM radianceteam/ton-client-php:1.36.0-php7.4-cli
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
CMD [ "php", "./your-script.php" ]
```

Basically, do anything you can do with the [original PHP image](https://hub.docker.com/_/php)
by just replacing `FROM php:<PHP_VERSION>-<PHP_IMAGE_VARIANT>` with
`FROM radianceteam/ton-client-php:1.35.1-php<PHP_VERSION>-<PHP_IMAGE_VARIANT>`.
`FROM radianceteam/ton-client-php:1.36.0-php<PHP_VERSION>-<PHP_IMAGE_VARIANT>`.

Note: only `cli`, `fpm` and `zts` variants are supported ATM.

Expand Down
11 changes: 10 additions & 1 deletion api.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.35.1",
"version": "1.36.0",
"modules": [
{
"name": "client",
Expand Down Expand Up @@ -6118,6 +6118,15 @@
},
"summary": "Processing try index.",
"description": "Used in message processing with retries.\n\nEncoder uses the provided try index to calculate message\nexpiration time.\n\nExpiration timeouts will grow with every retry.\n\nDefault value is 0."
},
{
"name": "address",
"type": "Optional",
"optional_inner": {
"type": "String"
},
"summary": "Destination address of the message",
"description": "Since ABI version 2.3 destination address of external inbound message is used in message\nbody signature calculation. Should be provided when signed external inbound message body is\ncreated. Otherwise can be omitted."
}
],
"summary": null,
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"require": {
"php": ">=7.4",
"ext-json": "*",
"ext-ton_client": ">=1.35.1",
"ext-ton_client": ">=1.36.0",
"psr/log": "^1.1"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

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

6 changes: 3 additions & 3 deletions docker/7.4/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM php:7.4-cli

RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.35.1/installer.php', 'installer.php');"
RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.36.0/installer.php', 'installer.php');"
RUN php -r "if (hash_file('sha384', 'installer.php') === '03586e200bc1c87f000c5a0eea27aa688eb451a5b946579205ca918bbffda7234359e2d0e176aa53e841c6a77b8de959') { echo 'Installer verified'; } else { echo 'Installer corrupt'; exit(1); } echo PHP_EOL;"
RUN php installer.php -v 1.35.1
RUN php installer.php -v 1.35.1 -T
RUN php installer.php -v 1.36.0
RUN php installer.php -v 1.36.0 -T
RUN rm installer.php
6 changes: 3 additions & 3 deletions docker/7.4/fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM php:7.4-fpm

RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.35.1/installer.php', 'installer.php');"
RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.36.0/installer.php', 'installer.php');"
RUN php -r "if (hash_file('sha384', 'installer.php') === '03586e200bc1c87f000c5a0eea27aa688eb451a5b946579205ca918bbffda7234359e2d0e176aa53e841c6a77b8de959') { echo 'Installer verified'; } else { echo 'Installer corrupt'; exit(1); } echo PHP_EOL;"
RUN php installer.php -v 1.35.1
RUN php installer.php -v 1.35.1 -T
RUN php installer.php -v 1.36.0
RUN php installer.php -v 1.36.0 -T
RUN rm installer.php
6 changes: 3 additions & 3 deletions docker/7.4/zts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM php:7.4-zts

RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.35.1/installer.php', 'installer.php');"
RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.36.0/installer.php', 'installer.php');"
RUN php -r "if (hash_file('sha384', 'installer.php') === '03586e200bc1c87f000c5a0eea27aa688eb451a5b946579205ca918bbffda7234359e2d0e176aa53e841c6a77b8de959') { echo 'Installer verified'; } else { echo 'Installer corrupt'; exit(1); } echo PHP_EOL;"
RUN php installer.php -v 1.35.1
RUN php installer.php -v 1.35.1 -T
RUN php installer.php -v 1.36.0
RUN php installer.php -v 1.36.0 -T
RUN rm installer.php
6 changes: 3 additions & 3 deletions docker/8.0/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM php:8.0-cli

RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.35.1/installer.php', 'installer.php');"
RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.36.0/installer.php', 'installer.php');"
RUN php -r "if (hash_file('sha384', 'installer.php') === '03586e200bc1c87f000c5a0eea27aa688eb451a5b946579205ca918bbffda7234359e2d0e176aa53e841c6a77b8de959') { echo 'Installer verified'; } else { echo 'Installer corrupt'; exit(1); } echo PHP_EOL;"
RUN php installer.php -v 1.35.1
RUN php installer.php -v 1.35.1 -T
RUN php installer.php -v 1.36.0
RUN php installer.php -v 1.36.0 -T
RUN rm installer.php
6 changes: 3 additions & 3 deletions docker/8.0/fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM php:8.0-fpm

RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.35.1/installer.php', 'installer.php');"
RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.36.0/installer.php', 'installer.php');"
RUN php -r "if (hash_file('sha384', 'installer.php') === '03586e200bc1c87f000c5a0eea27aa688eb451a5b946579205ca918bbffda7234359e2d0e176aa53e841c6a77b8de959') { echo 'Installer verified'; } else { echo 'Installer corrupt'; exit(1); } echo PHP_EOL;"
RUN php installer.php -v 1.35.1
RUN php installer.php -v 1.35.1 -T
RUN php installer.php -v 1.36.0
RUN php installer.php -v 1.36.0 -T
RUN rm installer.php
6 changes: 3 additions & 3 deletions docker/8.0/zts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM php:8.0-zts

RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.35.1/installer.php', 'installer.php');"
RUN php -r "copy('https://raw.githubusercontent.com/radianceteam/ton-client-php-ext/1.36.0/installer.php', 'installer.php');"
RUN php -r "if (hash_file('sha384', 'installer.php') === '03586e200bc1c87f000c5a0eea27aa688eb451a5b946579205ca918bbffda7234359e2d0e176aa53e841c6a77b8de959') { echo 'Installer verified'; } else { echo 'Installer corrupt'; exit(1); } echo PHP_EOL;"
RUN php installer.php -v 1.35.1
RUN php installer.php -v 1.35.1 -T
RUN php installer.php -v 1.36.0
RUN php installer.php -v 1.36.0 -T
RUN rm installer.php
31 changes: 31 additions & 0 deletions src/TON/Abi/ParamsOfEncodeMessageBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ class ParamsOfEncodeMessageBody implements JsonSerializable
*/
private ?int $_processingTryIndex;

/**
* Since ABI version 2.3 destination address of external inbound message is used in message
* body signature calculation. Should be provided when signed external inbound message body is
* created. Otherwise can be omitted.
*/
private ?string $_address;

public function __construct(?array $dto = null)
{
if (!$dto) $dto = [];
Expand All @@ -44,6 +51,7 @@ public function __construct(?array $dto = null)
$this->_isInternal = $dto['is_internal'] ?? false;
$this->_signer = isset($dto['signer']) ? Signer::create($dto['signer']) : null;
$this->_processingTryIndex = $dto['processing_try_index'] ?? null;
$this->_address = $dto['address'] ?? null;
}

public function getAbi(): ?Abi
Expand Down Expand Up @@ -86,6 +94,16 @@ public function getProcessingTryIndex(): ?int
return $this->_processingTryIndex;
}

/**
* Since ABI version 2.3 destination address of external inbound message is used in message
* body signature calculation. Should be provided when signed external inbound message body is
* created. Otherwise can be omitted.
*/
public function getAddress(): ?string
{
return $this->_address;
}

/**
* @return self
*/
Expand Down Expand Up @@ -142,6 +160,18 @@ public function setProcessingTryIndex(?int $processingTryIndex): self
return $this;
}

/**
* Since ABI version 2.3 destination address of external inbound message is used in message
* body signature calculation. Should be provided when signed external inbound message body is
* created. Otherwise can be omitted.
* @return self
*/
public function setAddress(?string $address): self
{
$this->_address = $address;
return $this;
}

public function jsonSerialize()
{
$result = [];
Expand All @@ -150,6 +180,7 @@ public function jsonSerialize()
if ($this->_isInternal !== null) $result['is_internal'] = $this->_isInternal;
if ($this->_signer !== null) $result['signer'] = $this->_signer;
if ($this->_processingTryIndex !== null) $result['processing_try_index'] = $this->_processingTryIndex;
if ($this->_address !== null) $result['address'] = $this->_address;
return !empty($result) ? $result : new stdClass();
}
}
2 changes: 1 addition & 1 deletion tests/TON/Client/ClientModuleTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testVersion()
$result = $this->_client->version();
$this->assertNotNull($result);
$this->assertMatchesRegularExpression('/^\d+\.\d+\.\d+$/', $result->getVersion());
$this->assertEquals('1.35.1', $result->getVersion());
$this->assertEquals('1.36.0', $result->getVersion());
}

public function testGetApiReference()
Expand Down

0 comments on commit 0be9022

Please sign in to comment.