From dbc79646141751efa07d1c503f72322762fdb922 Mon Sep 17 00:00:00 2001 From: Sergei Voronezhskii <76666924+d3p@users.noreply.github.com> Date: Tue, 3 May 2022 12:03:03 +0300 Subject: [PATCH] Version 1.33.0 (#407) * Version 1.33.0 * Fix react-native tests (#406) --- CHANGELOG.md | 8 + lerna.json | 2 +- packages/core/package.json | 5 +- packages/core/src/modules.ts | 174 +- packages/lib-node/package.json | 2 +- packages/lib-react-native-jsi/package.json | 2 +- packages/lib-react-native/package.json | 2 +- packages/lib-web/package.json | 2 +- packages/tests-node/package.json | 2 +- packages/tests-react-native-jsi/package.json | 2 +- packages/tests-react-native/.bundle/config | 2 + packages/tests-react-native/.gitattributes | 1 - packages/tests-react-native/.gitignore | 27 +- packages/tests-react-native/.ruby-version | 1 + packages/tests-react-native/App.jsx | 65 - packages/tests-react-native/App.tsx | 57 + packages/tests-react-native/Gemfile | 4 + packages/tests-react-native/Gemfile.lock | 100 + packages/tests-react-native/README.md | 54 - packages/tests-react-native/android/app/_BUCK | 4 +- .../android/app/build.gradle | 28 +- .../android/app/src/debug/AndroidManifest.xml | 7 +- .../ReactNativeFlipper.java | 2 +- .../android/app/src/main/AndroidManifest.xml | 8 +- .../MainActivity.java | 4 +- .../MainApplication.java | 4 +- .../res/drawable/rn_edit_text_material.xml | 29 + .../app/src/main/res/values/strings.xml | 2 +- .../app/src/main/res/values/styles.xml | 4 +- .../tests-react-native/android/build.gradle | 33 +- .../android/gradle.properties | 7 +- .../android/gradle/wrapper/gradle-wrapper.jar | Bin 58910 -> 59203 bytes .../gradle/wrapper/gradle-wrapper.properties | 10 +- packages/tests-react-native/android/gradlew | 2 +- .../tests-react-native/android/gradlew.bat | 21 +- .../android/settings.gradle | 2 +- packages/tests-react-native/app.json | 4 +- packages/tests-react-native/entry.js | 2 +- packages/tests-react-native/index.js | 20 +- .../tests-react-native/install-using-pack.js | 65 - packages/tests-react-native/ios/Podfile | 31 +- .../ios/TestSDK.xcodeproj/project.pbxproj | 687 + .../xcshareddata/xcschemes/TestSDK.xcscheme} | 26 +- .../{tests_runner => TestSDK}/AppDelegate.h | 0 .../{tests_runner => TestSDK}/AppDelegate.m | 12 +- .../AppIcon.appiconset/Contents.json | 0 .../Images.xcassets/Contents.json | 0 .../{tests_runner-tvOS => TestSDK}/Info.plist | 2 + .../ios/TestSDK/LaunchScreen.storyboard | 47 + .../ios/{tests_runner => TestSDK}/main.m | 0 .../Info.plist | 0 .../TestSDKTests.m} | 4 +- .../ios/tests_runner-tvOSTests/Info.plist | 24 - .../tests_runner.xcodeproj/project.pbxproj | 1028 -- .../xcschemes/tests_runner-tvOS.xcscheme | 88 - .../contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../tests_runner/Base.lproj/LaunchScreen.xib | 41 - .../ios/tests_runner/Info.plist | 57 - packages/tests-react-native/metro.config.js | 41 +- .../node-mock/constants/index.js | 30 +- .../tests-react-native/node-mock/fs/index.js | 30 +- .../node-mock/module/index.js | 28 +- .../node-mock/path/index.js | 30 +- .../node-mock/process/index.js | 15 - .../node-mock/stream/index.js | 30 +- .../node-mock/util/index.js | 30 +- .../tests-react-native/npm-shrinkwrap.json | 11450 ---------------- packages/tests-react-native/package.json | 44 +- packages/tests-react-native/run.js | 16 +- .../tests-react-native/test-transformer.js | 17 +- packages/tests-react-native/tsconfig.json | 64 + packages/tests-web/package.json | 2 +- packages/tests/package.json | 87 +- 74 files changed, 1482 insertions(+), 13267 deletions(-) create mode 100644 packages/tests-react-native/.bundle/config delete mode 100644 packages/tests-react-native/.gitattributes create mode 100644 packages/tests-react-native/.ruby-version delete mode 100644 packages/tests-react-native/App.jsx create mode 100644 packages/tests-react-native/App.tsx create mode 100644 packages/tests-react-native/Gemfile create mode 100644 packages/tests-react-native/Gemfile.lock delete mode 100644 packages/tests-react-native/README.md rename packages/tests-react-native/android/app/src/debug/java/com/{testapp => testsdk}/ReactNativeFlipper.java (99%) rename packages/tests-react-native/android/app/src/main/java/com/{tests_runner => testsdk}/MainActivity.java (84%) rename packages/tests-react-native/android/app/src/main/java/com/{tests_runner => testsdk}/MainApplication.java (95%) create mode 100644 packages/tests-react-native/android/app/src/main/res/drawable/rn_edit_text_material.xml mode change 100755 => 100644 packages/tests-react-native/android/gradle/wrapper/gradle-wrapper.jar mode change 100755 => 100644 packages/tests-react-native/android/gradle/wrapper/gradle-wrapper.properties mode change 100755 => 100644 packages/tests-react-native/android/gradlew delete mode 100644 packages/tests-react-native/install-using-pack.js create mode 100644 packages/tests-react-native/ios/TestSDK.xcodeproj/project.pbxproj rename packages/tests-react-native/ios/{tests_runner.xcodeproj/xcshareddata/xcschemes/tests_runner.xcscheme => TestSDK.xcodeproj/xcshareddata/xcschemes/TestSDK.xcscheme} (78%) rename packages/tests-react-native/ios/{tests_runner => TestSDK}/AppDelegate.h (100%) rename packages/tests-react-native/ios/{tests_runner => TestSDK}/AppDelegate.m (89%) rename packages/tests-react-native/ios/{tests_runner => TestSDK}/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename packages/tests-react-native/ios/{tests_runner => TestSDK}/Images.xcassets/Contents.json (100%) rename packages/tests-react-native/ios/{tests_runner-tvOS => TestSDK}/Info.plist (96%) create mode 100644 packages/tests-react-native/ios/TestSDK/LaunchScreen.storyboard rename packages/tests-react-native/ios/{tests_runner => TestSDK}/main.m (100%) rename packages/tests-react-native/ios/{tests_runnerTests => TestSDKTests}/Info.plist (100%) rename packages/tests-react-native/ios/{tests_runnerTests/tests_runnerTests.m => TestSDKTests/TestSDKTests.m} (95%) delete mode 100644 packages/tests-react-native/ios/tests_runner-tvOSTests/Info.plist delete mode 100644 packages/tests-react-native/ios/tests_runner.xcodeproj/project.pbxproj delete mode 100644 packages/tests-react-native/ios/tests_runner.xcodeproj/xcshareddata/xcschemes/tests_runner-tvOS.xcscheme delete mode 100644 packages/tests-react-native/ios/tests_runner.xcworkspace/contents.xcworkspacedata delete mode 100644 packages/tests-react-native/ios/tests_runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 packages/tests-react-native/ios/tests_runner/Base.lproj/LaunchScreen.xib delete mode 100644 packages/tests-react-native/ios/tests_runner/Info.plist delete mode 100644 packages/tests-react-native/node-mock/process/index.js delete mode 100644 packages/tests-react-native/npm-shrinkwrap.json create mode 100644 packages/tests-react-native/tsconfig.json diff --git a/CHANGELOG.md b/CHANGELOG.md index c93150ce..82b50cdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ All notable changes to this project will be documented in this file. +## [1.33.0] – 2022-05-02 + +### New + +- `allow_partial` flag in all `abi.decode_*` functions. This flag controls decoder behaviour whether return error or not in case of incomplete BOC decoding +- `REMP` supported. `ProcessingEvent` enum is extended with `REMP` statuses (enum of events posted into `processing.wait_for_transaction` function callback ) +- UNSTABLE. `first_remp_status_timeout` and `next_remp_status_timeout` parameters in network config + ## [1.32.0] – 2022-03-22 ### New diff --git a/lerna.json b/lerna.json index d9083ff1..94148b42 100644 --- a/lerna.json +++ b/lerna.json @@ -3,7 +3,7 @@ "packages": [ "packages/*" ], - "version": "1.32.0", + "version": "1.33.0", "command": { "version": { "message": "Release" diff --git a/packages/core/package.json b/packages/core/package.json index b120869a..d7bda37b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@eversdk/core", - "version": "1.32.0", + "version": "1.33.0", "description": "TON Client for Java Script", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -9,7 +9,8 @@ "url": "https://github.com/tonlabs/ever-sdk-js.git" }, "scripts": { - "prepublishOnly": "npm i && tsc" + "prepublishOnly": "npm i && tsc", + "build": "tsc" }, "publishConfig": { "access": "public" diff --git a/packages/core/src/modules.ts b/packages/core/src/modules.ts index 3cfd4712..84e292c9 100644 --- a/packages/core/src/modules.ts +++ b/packages/core/src/modules.ts @@ -99,7 +99,7 @@ export type ClientConfig = { export type NetworkConfig = { /** - * DApp Server public address. For instance, for `net.ton.dev/graphql` GraphQL endpoint the server address will be net.ton.dev + * **This field is deprecated, but left for backward-compatibility.** DApp Server public address. */ server_address?: string, @@ -107,7 +107,8 @@ export type NetworkConfig = { * List of DApp Server addresses. * * @remarks - * Any correct URL format can be specified, including IP addresses This parameter is prevailing over `server_address`. + * Any correct URL format can be specified, including IP addresses. This parameter is prevailing over `server_address`. + * Check the full list of [supported network endpoints](../ton-os-api/networks.md). */ endpoints?: string[], @@ -171,7 +172,7 @@ export type NetworkConfig = { * Maximum number of randomly chosen endpoints the library uses to broadcast a message. * * @remarks - * Default is 2. + * Default is 1. */ sending_endpoint_count?: number, @@ -215,6 +216,26 @@ export type NetworkConfig = { */ queries_protocol?: NetworkQueriesProtocol, + /** + * UNSTABLE. + * + * @remarks + * First REMP status awaiting timeout. If no status recieved during the timeout than fallback transaction scenario is activated. + * + * Must be specified in milliseconds. Default is 1000 (1 sec). + */ + first_remp_status_timeout?: number, + + /** + * UNSTABLE. + * + * @remarks + * Subsequent REMP status awaiting timeout. If no status recieved during the timeout than fallback transaction scenario is activated. + * + * Must be specified in milliseconds. Default is 5000 (5 sec). + */ + next_remp_status_timeout?: number, + /** * Access key to GraphQL API. * @@ -472,7 +493,8 @@ export enum CryptoErrorCode { CryptoBoxNotRegistered = 130, InvalidCryptoBoxType = 131, CryptoBoxSecretSerializationError = 132, - CryptoBoxSecretDeserializationError = 133 + CryptoBoxSecretDeserializationError = 133, + InvalidNonceSize = 134 } export type SigningBoxHandle = number @@ -3298,7 +3320,12 @@ export type ParamsOfDecodeMessage = { /** * Message BOC */ - message: string + message: string, + + /** + * Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default) + */ + allow_partial?: boolean } export type DecodedMessageBody = { @@ -3339,7 +3366,12 @@ export type ParamsOfDecodeMessageBody = { /** * True if the body belongs to the internal message. */ - is_internal: boolean + is_internal: boolean, + + /** + * Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default) + */ + allow_partial?: boolean } export type ParamsOfEncodeAccount = { @@ -3396,7 +3428,12 @@ export type ParamsOfDecodeAccountData = { /** * Data BOC or BOC handle */ - data: string + data: string, + + /** + * Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default) + */ + allow_partial?: boolean } export type ResultOfDecodeAccountData = { @@ -3493,7 +3530,12 @@ export type ParamsOfDecodeInitialData = { /** * Data BOC or BOC handle */ - data: string + data: string, + + /** + * Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default) + */ + allow_partial?: boolean } export type ResultOfDecodeInitialData = { @@ -4583,7 +4625,10 @@ export enum ProcessingErrorCode { CanNotCheckBlockShard = 510, BlockNotFound = 511, InvalidData = 512, - ExternalSignerMustNotBeUsed = 513 + ExternalSignerMustNotBeUsed = 513, + MessageRejected = 514, + InvalidRempStatus = 515, + NextRempStatusTimeout = 516 } export type ProcessingEvent = { @@ -4683,6 +4728,68 @@ export type ProcessingEvent = { */ message: string, + /** + */ + error: ClientError +} | { + type: 'RempSentToValidators' + + /** + */ + message_id: string, + + /** + */ + timestamp: bigint, + + /** + */ + json: any +} | { + type: 'RempIncludedIntoBlock' + + /** + */ + message_id: string, + + /** + */ + timestamp: bigint, + + /** + */ + json: any +} | { + type: 'RempIncludedIntoAcceptedBlock' + + /** + */ + message_id: string, + + /** + */ + timestamp: bigint, + + /** + */ + json: any +} | { + type: 'RempOther' + + /** + */ + message_id: string, + + /** + */ + timestamp: bigint, + + /** + */ + json: any +} | { + type: 'RempError' + /** */ error: ClientError @@ -4757,6 +4864,49 @@ export function processingEventMessageExpired(message_id: string, message: strin }; } +export function processingEventRempSentToValidators(message_id: string, timestamp: bigint, json: any): ProcessingEvent { + return { + type: 'RempSentToValidators', + message_id, + timestamp, + json, + }; +} + +export function processingEventRempIncludedIntoBlock(message_id: string, timestamp: bigint, json: any): ProcessingEvent { + return { + type: 'RempIncludedIntoBlock', + message_id, + timestamp, + json, + }; +} + +export function processingEventRempIncludedIntoAcceptedBlock(message_id: string, timestamp: bigint, json: any): ProcessingEvent { + return { + type: 'RempIncludedIntoAcceptedBlock', + message_id, + timestamp, + json, + }; +} + +export function processingEventRempOther(message_id: string, timestamp: bigint, json: any): ProcessingEvent { + return { + type: 'RempOther', + message_id, + timestamp, + json, + }; +} + +export function processingEventRempError(error: ClientError): ProcessingEvent { + return { + type: 'RempError', + error, + }; +} + export type ResultOfProcessMessage = { /** @@ -6583,8 +6733,8 @@ export class NetModule { * * @remarks * *Attention* this query retrieves data from 'Counterparties' service which is not supported in - * the opensource version of DApp Server (and will not be supported) as well as in TON OS SE (will be supported in SE in future), - * but is always accessible via [TON OS Devnet/Mainnet Clouds](https://docs.ton.dev/86757ecb2/p/85c869-networks) + * the opensource version of DApp Server (and will not be supported) as well as in Evernode SE (will be supported in SE in future), + * but is always accessible via [EVER OS Clouds](../ton-os-api/networks.md) * * @param {ParamsOfQueryCounterparties} params * @returns ResultOfQueryCollection @@ -7572,7 +7722,7 @@ export class ProofsModule { * a trusted validator set. So we need to check all key-blocks' proofs, started from the zero-state * and until the block, which we want to prove. But it can take a lot of time and traffic to * download and prove all key-blocks on a client. For solving this, special trusted blocks are used - * in TON-SDK. + * in Ever-SDK. * * The trusted block is the authority root, as well, as the zero-state. Each trusted block is the * `id` (e.g. `root_hash`) of the already proven key-block. There can be plenty of trusted diff --git a/packages/lib-node/package.json b/packages/lib-node/package.json index 7e7d8318..62e422bc 100644 --- a/packages/lib-node/package.json +++ b/packages/lib-node/package.json @@ -1,6 +1,6 @@ { "name": "@eversdk/lib-node", - "version": "1.32.0", + "version": "1.33.0", "description": "TON Client NodeJs AddOn", "repository": { "type": "git", diff --git a/packages/lib-react-native-jsi/package.json b/packages/lib-react-native-jsi/package.json index 010605e0..35812bd1 100644 --- a/packages/lib-react-native-jsi/package.json +++ b/packages/lib-react-native-jsi/package.json @@ -1,6 +1,6 @@ { "name": "@eversdk/lib-react-native-jsi", - "version": "1.32.0", + "version": "1.33.0", "description": "TON Client React Native JSI Module", "main": "lib/commonjs/index", "module": "lib/module/index", diff --git a/packages/lib-react-native/package.json b/packages/lib-react-native/package.json index 851723ab..c647c245 100644 --- a/packages/lib-react-native/package.json +++ b/packages/lib-react-native/package.json @@ -1,6 +1,6 @@ { "name": "@eversdk/lib-react-native", - "version": "1.32.0", + "version": "1.33.0", "description": "TON Client React Native Module", "main": "index.js", "repository": { diff --git a/packages/lib-web/package.json b/packages/lib-web/package.json index 497de833..fc017953 100644 --- a/packages/lib-web/package.json +++ b/packages/lib-web/package.json @@ -1,6 +1,6 @@ { "name": "@eversdk/lib-web", - "version": "1.32.0", + "version": "1.33.0", "description": "TON Client WASM module for browsers", "main": "index.js", "repository": { diff --git a/packages/tests-node/package.json b/packages/tests-node/package.json index fcd84405..559e5b18 100644 --- a/packages/tests-node/package.json +++ b/packages/tests-node/package.json @@ -1,6 +1,6 @@ { "name": "@eversdk/tests-node", - "version": "1.32.0", + "version": "1.33.0", "private": true, "description": "TON Client Tests runner on NodeJs", "main": "index.js", diff --git a/packages/tests-react-native-jsi/package.json b/packages/tests-react-native-jsi/package.json index 5170cf1a..fb0f2397 100644 --- a/packages/tests-react-native-jsi/package.json +++ b/packages/tests-react-native-jsi/package.json @@ -1,6 +1,6 @@ { "name": "@eversdk/tests-react-native-jsi", - "version": "1.32.0", + "version": "1.33.0", "private": true, "main": "index.js", "browser": true, diff --git a/packages/tests-react-native/.bundle/config b/packages/tests-react-native/.bundle/config new file mode 100644 index 00000000..d137d242 --- /dev/null +++ b/packages/tests-react-native/.bundle/config @@ -0,0 +1,2 @@ +BUNDLE_PATH: "vendor/bundle" +BUNDLE_FORCE_RUBY_PLATFORM: 1 \ No newline at end of file diff --git a/packages/tests-react-native/.gitattributes b/packages/tests-react-native/.gitattributes deleted file mode 100644 index d42ff183..00000000 --- a/packages/tests-react-native/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.pbxproj -text diff --git a/packages/tests-react-native/.gitignore b/packages/tests-react-native/.gitignore index e7f69ae6..941c7316 100644 --- a/packages/tests-react-native/.gitignore +++ b/packages/tests-react-native/.gitignore @@ -28,6 +28,7 @@ build/ .gradle local.properties *.iml +*.hprof # node.js # @@ -41,34 +42,8 @@ buck-out/ *.keystore !debug.keystore -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/ - -*/fastlane/report.xml -*/fastlane/Preview.html -*/fastlane/screenshots - # Bundle artifact *.jsbundle # CocoaPods /ios/Pods/ -/yarn.lock -/ios/Podfile.lock -/android/gradle/wrapper/ -/suite/_/assets.js -/suite/_/giver.js -/suite/_/init-tests.js -/suite/aggregations.js -/suite/auth.js -/suite/client.js -/suite/contracts.js -/suite/crypto.js -/suite/deploy-ex.js -/suite/queries.js -/suite/run-local.js -/suite/test-error-messages.js diff --git a/packages/tests-react-native/.ruby-version b/packages/tests-react-native/.ruby-version new file mode 100644 index 00000000..a4dd9dba --- /dev/null +++ b/packages/tests-react-native/.ruby-version @@ -0,0 +1 @@ +2.7.4 diff --git a/packages/tests-react-native/App.jsx b/packages/tests-react-native/App.jsx deleted file mode 100644 index 32ba0d85..00000000 --- a/packages/tests-react-native/App.jsx +++ /dev/null @@ -1,65 +0,0 @@ -import { TonClient } from "@eversdk/core"; -import React, { Component } from 'react'; -import { - View, - Text, Button, -} from 'react-native'; -import { TestsRunner } from "@eversdk/tests"; - -class App extends Component { - async componentDidMount() { - const client = new TonClient({ - network: { - server_address: 'net.ton.dev' - } - }); - const version = (await client.client.version()).version; - this.setState({ - version - }); - TestsRunner.run( - state => this.setState(state), - (...args) => console.log(...args), - ).then(_ => { - }); - } - - render() { - const state = this.state || {}; - return ( - <> - - Core - Version: {state.version || 'loading...'} - Tests Passed: {state.passed || 0} - Tests Failed: {state.failed || 0} - {state.finished ? 'Complete' : 'Testing...'} - Clicks: {state.clicks || 0} -