From a88042e7db1277631d420e58ff4265b30354b95f Mon Sep 17 00:00:00 2001
From: naz_dou <41945483+nduchak@users.noreply.github.com>
Date: Fri, 4 Oct 2019 14:31:46 +0300
Subject: [PATCH] feat(Lima): Lima compatibility (#683)
* feat(Lima): Create Lima branch
* feat(Compiler): Compiler 4.0.0 compatibility (#632)
* feat(newCompiler): Increase compiler version. Add `backend` option to compiler API
* fix(TX): Add fate vm version
* feat(Contract): Make Contract works with node 5.0.0 rc1 (lima hard-fork) and compiler 4.0.0 rc2
* chore(test): Debug channel test
* fix(channel): fix contract in channel test
* chore(test): Remove logs
* feat(ACI): Add `payable` to contract call
* feat(ACI): Add test for payable
* fix(Linter): Fix linter error
* feat(Compiler): Point to compiler 3.2.0. Improve `payble` to support old compiler
* feat(Compiler): disable payable test
* feat(Lima): Point compiler to 4.0.0. Enable tests for `payable`
* feat(Lima): Make contact for channel test payable
* chore(test): Enable tests
* feat(Contract/ACI): Add ability to use contract with external deps(`include "someLib"`) (#653)
* docs(Contract): Adjust contract docs (#658)
* Release 4.7.0-next.1 (#660)
* chore(release): Generate CHANGELOG. Bump version
* chore(test): Test backward compatibility
* chore(test): revert
* feat(SCHEMA): Add fate constants
* chore(release): bump version to 5.0.0-next.1
* feat(Lima): add check for compiler <-> consensus protocol version check
* feat(Lima): add check for abi/vm <-> backend(FATE/AEVM) (#680)
* feat(Lima): add check for abi/vm <-> backend(FATE/AEVM)
* feat(Lima): add check for abi/vm <-> backend(FATE/AEVM)
* feat(Contract): Add fate tests
* feat(Contract): enable all tests
* feat(Node): Add check in dry-run endpoint(node cross compatibility)
* feat(Contract): enable all tests
* feat(Contract): enable all tests
* feat(Contract): fix docker file run command
* feat(Swagger): Resolve refs
* feat(tests): Skip Channel and AENS
* feat(Node): Change compatibility range from 4.x.x to 5.x.x
* feat(Node): Change compatibility range from 4.x.x to 6.0.0
* fix(Oracle): fix abi field resolving
* chrome(build): Regenerate lock
* feat(Compiler): make FATE by default (#693)
* feat(Contract): Use FATE by default
* feat(AENS): Lima compatibility (#687)
* Aens lima compatibility
* Make aens cross compatible with pre-lima releases
* Remove .only
* Fix native build of claim tx test
* feat(GA): Make GA compatible with Lima. Add cross compiler compatibility
* fix(Test): Fix test for cross compatibility. Add test for AEVM
* fix(AE): Add pointers verification for spend by name. Improve AENS cross node tests
* build(Node): Point node to 5.0.0-rc3
* chore(Test): Test name which not trigger auction
* fix(ACI): Fix compiler options. Fix test for AEVM
---
.env | 4 +-
CHANGELOG.md | 18 +-
docker-compose.yml | 2 +-
docker/aeternity_node_mean16.yaml | 1 +
docs/api/ae/contract.md | 115 ++--
docs/api/contract.md | 84 ++-
docs/api/contract/aci.md | 15 +-
es/ae/aens.js | 20 +-
es/ae/contract.js | 48 +-
es/ae/index.js | 14 +-
es/chain/node.js | 6 +
es/contract/aci/index.js | 24 +-
es/contract/compiler.js | 29 +-
es/contract/ga/helpers.js | 7 +-
es/contract/ga/index.js | 6 +-
es/contract/index.js | 34 +-
es/node.js | 4 +-
es/tx/builder/helpers.js | 28 +-
es/tx/builder/index.js | 28 +-
es/tx/builder/schema.js | 40 +-
es/tx/tx.js | 52 +-
es/utils/swagger.js | 38 +-
package-lock.json | 1036 ++++++++++-------------------
package.json | 2 +-
test/integration/aens.js | 74 ++-
test/integration/channel.js | 7 +-
test/integration/contract.js | 124 +++-
test/integration/transaction.js | 10 +-
28 files changed, 948 insertions(+), 922 deletions(-)
diff --git a/.env b/.env
index 55c3f5b15e..12fbf6e279 100644
--- a/.env
+++ b/.env
@@ -1,2 +1,2 @@
-TAG=v5.0.0-rc.1
-COMPILER_TAG=v3.2.0
+TAG=v5.0.0-rc.3
+COMPILER_TAG=v4.0.0-rc5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1592d1a1cc..ff0bc29701 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,21 @@
-# [4.7.0](https://github.com/aeternity/aepp-sdk-js/compare/2.4.0...4.7.0) (2019-09-11)
+# [5.0.0-next.1](https://github.com/aeternity/aepp-sdk-js/compare/4.6.0...4.7.0-next.1) (2019-09-10)
+
+
+### Bug Fixes
+* **package:** update serialize-javascript to version 2.0.0 ([#647](https://github.com/aeternity/aepp-sdk-js/issues/647)) ([1ddb392](https://github.com/aeternity/aepp-sdk-js/commit/1ddb392))
+
+
+### Features
+
+* **Contract/ACI** Add `payable` feature
+* **Compiler:** Compiler 4.0.0 compatibility ([#632](https://github.com/aeternity/aepp-sdk-js/issues/632)) ([d5f1632](https://github.com/aeternity/aepp-sdk-js/commit/d5f1632))
+* **Contract/ACI:** Add ability to use contract with external namespaces(`include "someLib"`) ([#653](https://github.com/aeternity/aepp-sdk-js/issues/653)) ([9708b43](https://github.com/aeternity/aepp-sdk-js/commit/9708b43))
+
+
+
+
+# [4.7.0](https://github.com/aeternity/aepp-sdk-js/compare/2.4.0...4.7.0) (2019-09-11)
### Features
diff --git a/docker-compose.yml b/docker-compose.yml
index 153c6c96b1..3e2d28726d 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -20,7 +20,7 @@ services:
expose: [3013, 3113, 3014, 3114]
environment:
EPOCH_CONFIG: /home/aeternity/aeternity_node.yaml
- command: -aecore expected_mine_rate ${EPOCH_MINE_RATE:-5000}
+ command: bin/aeternity console -noinput -aecore expected_mine_rate ${EPOCH_MINE_RATE:-5000}
volumes:
- ${PWD}/docker/aeternity_node_mean16.yaml:/home/aeternity/aeternity_node.yaml
- ${PWD}/docker/keys/node:/home/aeternity/node/keys
diff --git a/docker/aeternity_node_mean16.yaml b/docker/aeternity_node_mean16.yaml
index a580c0198f..321023a4ba 100644
--- a/docker/aeternity_node_mean16.yaml
+++ b/docker/aeternity_node_mean16.yaml
@@ -24,6 +24,7 @@ chain:
"1": 0
"2": 2
"3": 4
+ "4": 6
mining:
autostart: true
diff --git a/docs/api/ae/contract.md b/docs/api/ae/contract.md
index 2d0ce74b73..21de19f06e 100644
--- a/docs/api/ae/contract.md
+++ b/docs/api/ae/contract.md
@@ -17,19 +17,19 @@ import { Contract } from '@aeternity/aepp-sdk' (Using bundle)
```
* [@aeternity/aepp-sdk/es/ae/contract](#module_@aeternity/aepp-sdk/es/ae/contract)
- * [exports.Contract([options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--exports.Contract) ⇒ `Object` ⏏
+ * [exports.ContractAPI([options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--exports.ContractAPI) ⇒ `Object` ⏏
* _async_
* [handleCallError(result)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--handleCallError) ⇒ `Promise.<void>` ⏏
- * [contractEncodeCall(source, name, args)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractEncodeCall) ⇒ `Promise.<String>` ⏏
- * [contractDecodeData(source, fn, callValue, callResult, options)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractDecodeData) ⇒ `Promise.<String>` ⏏
- * [contractCallStatic(source, address, name, args, options, top, options)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCallStatic) ⇒ `Promise.<Object>` ⏏
- * [contractCall(source, address, name, args, options)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCall) ⇒ `Promise.<Object>` ⏏
- * [contractDeploy(code, source, initState, options)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractDeploy) ⇒ `Promise.<Object>` ⏏
- * [contractCompile(source, options)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCompile) ⇒ `Promise.<Object>` ⏏
+ * [contractEncodeCall(source, name, args, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractEncodeCall) ⇒ `Promise.<String>` ⏏
+ * [contractDecodeData(source, fn, callValue, callResult, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractDecodeData) ⇒ `Promise.<String>` ⏏
+ * [contractCallStatic(source, address, name, args, [options], bytecode, options, filesystem)](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCallStatic) ⇒ `Promise.<Object>` ⏏
+ * [contractCall(source, address, name, args, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCall) ⏏
+ * [contractDeploy(code, source, initState, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractDeploy) ⇒ `Promise.<Object>` ⏏
+ * [contractCompile(source, [options])](#exp_module_@aeternity/aepp-sdk/es/ae/contract--contractCompile) ⇒ `Promise.<Object>` ⏏
-
+
-### exports.Contract([options]) ⇒ `Object` ⏏
+### exports.ContractAPI([options]) ⇒ `Object` ⏏
Contract Stamp
Provide contract implementation
@@ -80,34 +80,37 @@ Handle contract call error
-### contractEncodeCall(source, name, args) ⇒ `Promise.<String>` ⏏
+### contractEncodeCall(source, name, args, [options]) ⇒ `Promise.<String>` ⏏
Encode call data for contract call
**Kind**: Exported function
**Category**: async
-| Param | Type | Description |
-| --- | --- | --- |
-| source | `String` | Contract source code |
-| name | `String` | Name of function to call |
-| args | `Array` | Argument's for call |
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| source | `String` | | Contract source code |
+| name | `String` | | Name of function to call |
+| args | `Array` | | Argument's for call |
+| [options] | `Object` | {}
| Options |
+| [options.filesystem] | `Object` | {}
| Contract external namespaces map |
-### contractDecodeData(source, fn, callValue, callResult, options) ⇒ `Promise.<String>` ⏏
+### contractDecodeData(source, fn, callValue, callResult, [options]) ⇒ `Promise.<String>` ⏏
Decode contract call result data
**Kind**: Exported function
**Returns**: `Promise.<String>` - Result object
**Category**: async
-| Param | Type | Description |
-| --- | --- | --- |
-| source | `String` | source code |
-| fn | `String` | function name |
-| callValue | `String` | result call data |
-| callResult | `String` | result status |
-| options | | |
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| source | `String` | | source code |
+| fn | `String` | | function name |
+| callValue | `String` | | result call data |
+| callResult | `String` | | result status |
+| [options] | `Object` | {}
| Options |
+| [options.filesystem] | `Object` | {}
| Contract external namespaces map |
**Example**
```js
@@ -115,22 +118,24 @@ const decodedData = await client.contractDecodeData(SourceCode ,'functionName',
```
-### contractCallStatic(source, address, name, args, options, top, options) ⇒ `Promise.<Object>` ⏏
+### contractCallStatic(source, address, name, args, [options], bytecode, options, filesystem) ⇒ `Promise.<Object>` ⏏
Static contract call(using dry-run)
**Kind**: Exported function
**Returns**: `Promise.<Object>` - Result object
**Category**: async
-| Param | Type | Description |
-| --- | --- | --- |
-| source | `String` | Contract source code |
-| address | `String` | Contract address |
-| name | `String` | Name of function to call |
-| args | `Array` | Argument's for call function |
-| options | `Object` | [options={}] Options |
-| top | `String` | [options.top] Block hash on which you want to call contract |
-| options | `String` | [options.options] Transaction options (fee, ttl, gas, amount, deposit) |
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| source | `String` | | Contract source code |
+| address | `String` | | Contract address |
+| name | `String` | | Name of function to call |
+| args | `Array` | | Argument's for call function |
+| [options] | `Object` | {}
| Options |
+| [options.top] | `String` | | Block hash on which you want to call contract |
+| bytecode | | | |
+| options | `String` | | [options.options] Transaction options (fee, ttl, gas, amount, deposit) |
+| filesystem | `Object` | | [options.options.filesystem] Contract external namespaces map |
**Example**
```js
@@ -142,20 +147,20 @@ const callResult = await client.contractCallStatic(source, address, fnName, args
```
-### contractCall(source, address, name, args, options) ⇒ `Promise.<Object>` ⏏
+### contractCall(source, address, name, args, [options]) ⏏
Call contract function
**Kind**: Exported function
-**Returns**: `Promise.<Object>` - Result object
**Category**: async
-| Param | Type | Description |
-| --- | --- | --- |
-| source | `String` | Contract source code |
-| address | `String` | Contract address |
-| name | `String` | Name of function to call |
-| args | `Array` | Argument's for call function |
-| options | `Object` | Transaction options (fee, ttl, gas, amount, deposit) |
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| source | `String` | | Contract source code |
+| address | `String` | | Contract address |
+| name | `String` | | Name of function to call |
+| args | `Array` | | Argument's for call function |
+| [options] | `Object` | {}
| Transaction options (fee, ttl, gas, amount, deposit) |
+| [options.filesystem] | `Object` | {}
| Contract external namespaces map* @return {Promise