Skip to content

Commit

Permalink
Merge pull request #118 from tonlabs/0.23.1-rc
Browse files Browse the repository at this point in the history
Version 0.23.1
  • Loading branch information
diserere authored May 21, 2020
2 parents 5a0c121 + e9a2097 commit d8d7243
Show file tree
Hide file tree
Showing 27 changed files with 1,864 additions and 1,398 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
USE_NODE_SE=true
TON_NETWORK_ADDRESS=http://0.0.0.0:8081
TON_NETWORK_ADDRESS=http://0.0.0.0:8080
#USE_NODE_SE=false
#TON_NETWORK_ADDRESS=cinet.tonlabs.io
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Release Notes
All notable changes to this project will be documented in this file.

## 0.23.0 - May 7, 2020
## 0.23.1 - May 21, 2020
### New
- Methods `serverNow()` and `serverTimeDelta()` of `TONClient` returns current server time.
- Check for a clock is out of sync before sending a message (fail if out of sync).
- Method `waitForRunTransaction` of `contracts` module.
- Method `waitForDeployTransaction` of `contracts` module.
- Method `isDeployed` of `contracts` module.

## 0.23.0 - May 15, 2020
### New
- Method `runGet` of `contracts` module executes get method on a local tvm.
- Method `arrayFromCONS` of `contracts` module converts CONS-list to JS arrays.
Expand Down
14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,4 @@ Shared JavaScript TON Labs Client Library
See https://docs.ton.dev for documentation

---
Copyright 2018-2020 TON DEV SOLUTIONS LTD.

Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
this file except in compliance with the License.

You may obtain a copy of the
License at: https://www.ton.dev/licenses

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific TON DEV software governing permissions and
limitations under the License.
Copyright 2018-2020 TON DEV SOLUTIONS LTD.
6 changes: 3 additions & 3 deletions __tests__/_/binaries.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {version, binaries_version} from '../../package.json';
import {version} from '../../package.json';

const fs = require('fs');
const path = require('path');
Expand All @@ -8,7 +8,7 @@ const zlib = require('zlib');


export const p = os.platform();
export const bv = (binaries_version || version).split('.')[0];
export const bv = process.env.TON_SDK_BIN_VERSION || (version).split('.')[0];
const binariesHost = 'sdkbinaries-ws.tonlabs.io';
export const binariesPath = path.resolve(__dirname, '..');

Expand All @@ -17,7 +17,7 @@ function downloadAndGunzip(dest, url) {
const request = http.get(url, response => {
if (response.statusCode !== 200) {
reject({
message: `Download failed with ${response.statusCode}: ${response.statusMessage}`,
message: `Download from ${url} failed with ${response.statusCode}: ${response.statusMessage}`,
});
return;
}
Expand Down
324 changes: 324 additions & 0 deletions __tests__/aggregations.js

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions __tests__/auth.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
/*
* Copyright 2018-2020 TON DEV SOLUTIONS LTD.
*
* Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of the
* License at:
*
* http://www.ton.dev/licenses
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific TON DEV software governing permissions and
* limitations under the License.
*/

// @flow
Expand Down
37 changes: 21 additions & 16 deletions __tests__/contracts.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
/*
* Copyright 2018-2020 TON DEV SOLUTIONS LTD.
*
* Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of the
* License at:
*
* http://www.ton.dev/licenses
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific TON DEV software governing permissions and
* limitations under the License.
*/

// @flow
Expand All @@ -24,6 +12,7 @@ import {TONClient, TONClientError} from '../src/TONClient';

import type {TONContractABI, TONContractLoadResult, TONKeyPairData} from '../types';
import {bv} from './_/binaries';
import {version} from '../package.json';
import {ABIVersions, tests} from './_/init-tests';

const CheckInitParamsPackage = tests.loadPackage('CheckInitParams');
Expand Down Expand Up @@ -67,11 +56,12 @@ test('removeProps', () => {
});
});

test('basic', async () => {
const version = await tests.client.config.getVersion();
test('Test versions compatibility', async () => {
const ver_builtin = await tests.client.config.getVersion();
expect(version.split('.')[0])
.toEqual(bv);
console.log(`Client uses expected binaries version: ${version}`);
.toEqual(ver_builtin.split('.')[0]);
console.log(`Client version ${version} uses compatible binaries version: ${ver_builtin}`,
`\n(requested version to download: ${bv})`);
});

test('load', async () => {
Expand Down Expand Up @@ -99,6 +89,21 @@ test('load', async () => {
});
});


test('out of sync', async () => {
const cfg = tests.client.config.data;
const saveOutOfSyncThreshold = cfg.outOfSyncThreshold;
cfg.outOfSyncThreshold = -1;
try {
await expectError(TONClientError.code.CLOCK_OUT_OF_SYNC, TONClientError.source.CLIENT, async () => {
await tests.get_grams_from_giver(walletAddress);
});
} finally {
cfg.outOfSyncThreshold = saveOutOfSyncThreshold;
}
});


test.each(ABIVersions)('Test hello contract from docs.ton.dev (ABI v%i)', async (abiVersion) => {
const { contracts, crypto } = tests.client;
const helloKeys = await crypto.ed25519Keypair();
Expand Down
9 changes: 8 additions & 1 deletion __tests__/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,17 @@ test('crypto', async () => {
expect(ton_public).toEqual('PubDdJkMyss2qHywFuVP1vzww0TpsLxnRNnbifTCcu-XEgW0');


const phrase = await crypto.mnemonicFromRandom();
let phrase = await crypto.mnemonicFromRandom();
expect(phrase.split(' ').length).toEqual(24);


phrase = await crypto.mnemonicFromRandom({ dictionary: 0, wordCount: 12});
expect(phrase.split(' ').length).toEqual(12);

phrase = await crypto.mnemonicFromRandom({ dictionary: 1, wordCount: 12});
expect(phrase.split(' ').length).toEqual(12);


const entropy = '2199ebe996f14d9e4e2595113ad1e6276bd05e2e147e16c8ab8ad5d47d13b44fcf';
const phrase2 = await crypto.mnemonicFromEntropy({
entropy: { hex: entropy }
Expand Down
12 changes: 0 additions & 12 deletions __tests__/deploy-ex.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
/*
* Copyright 2018-2020 TON DEV SOLUTIONS LTD.
*
* Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of the
* License at:
*
* http://www.ton.dev/licenses
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific TON DEV software governing permissions and
* limitations under the License.
*/
// @flow

Expand Down
Loading

0 comments on commit d8d7243

Please sign in to comment.