Skip to content

Commit 6a26c51

Browse files
authored
Merge pull request #156 from aeternity/release/3.0.0
Release 3.0.0
2 parents f65e377 + 345064c commit 6a26c51

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+4374
-12629
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
NODE_TAG=v5.5.4
2-
COMPILER_TAG=v4.2.0
1+
NODE_TAG=v6.0.0
2+
COMPILER_TAG=v6.0.0

.github/workflows/nodejs.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
name: Node.js CI
4+
5+
on: [push]
6+
7+
jobs:
8+
build-and-test:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@master
15+
- name: Use Node.js 14.x
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 14.x
19+
before_install:
20+
- run: docker-compose up -d
21+
- run: npm install
22+
- run: npm run test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
2+
docs
23
/test-results.xml
34
.tern-port
45
.tern-project

.travis.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

Dockerfile.ci

Lines changed: 0 additions & 10 deletions
This file was deleted.

babel.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const config = {
22
presets: ['@babel/preset-env'],
33
plugins: [
4-
"@babel/plugin-transform-runtime",
5-
"@babel/plugin-proposal-object-rest-spread",
6-
"@babel/plugin-proposal-export-default-from",
7-
"ramda"
4+
'@babel/plugin-transform-runtime',
5+
'@babel/plugin-proposal-object-rest-spread',
6+
'@babel/plugin-proposal-export-default-from',
7+
'ramda'
88
]
99
}
1010

bin/aecli-account.js

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
// Also we need `esm` package to handle `ES imports`
2424
const program = require('commander')
2525

26-
require = require('esm')(module/*, options*/) //use to handle es6 import/export
27-
const utils = require('./utils/index')
28-
const { Account } = require('./commands')
26+
const requireEsm = require('esm')(module/*, options */) // use to handle es6 import/export
27+
const utils = requireEsm('./utils/index')
28+
const { Account } = requireEsm('./commands')
2929

3030
// ## Initialize `options`
3131
program
@@ -54,8 +54,7 @@ program
5454
.option('-T, --ttl [ttl]', 'Validity of the spend transaction in number of blocks (default forever)', utils.constant.TX_TTL)
5555
.option('-N, --nonce [nonce]', 'Override the nonce that the transaction is going to be sent with')
5656
.option('-D, --denomination [denomination]', 'Denomination of amount', utils.constant.DENOMINATION)
57-
.action(async (walletPath, receiverIdOrName, amount, ...arguments) => await Account.spend(walletPath, receiverIdOrName, amount, utils.cli.getCmdFromArguments(arguments)))
58-
57+
.action(async (walletPath, receiverIdOrName, amount, ...args) => await Account.spend(walletPath, receiverIdOrName, amount, utils.cli.getCmdFromArguments(args)))
5958

6059
// ## Initialize `transfer` command
6160
//
@@ -75,8 +74,7 @@ program
7574
.option('-T, --ttl [ttl]', 'Validity of the spend transaction in number of blocks (default forever)', utils.constant.TX_TTL)
7675
.option('-N, --nonce [nonce]', 'Override the nonce that the transaction is going to be sent with')
7776
.option('-D, --denomination [denomination]', 'Denomination of amount', utils.constant.DENOMINATION)
78-
.action(async (walletPath, receiver, percentage, ...arguments) => await Account.transferFunds(walletPath, receiver, percentage, utils.cli.getCmdFromArguments(arguments)))
79-
77+
.action(async (walletPath, receiver, percentage, ...args) => await Account.transferFunds(walletPath, receiver, percentage, utils.cli.getCmdFromArguments(args)))
8078

8179
// ## Initialize `sign` command
8280
//
@@ -87,8 +85,7 @@ program
8785
.command('sign <wallet_path> <tx>')
8886
.option('--networkId [networkId]', 'Network id (default: ae_mainnet)')
8987
.description('Create a transaction to another wallet')
90-
.action(async (walletPath, tx, ...arguments) => await Account.sign(walletPath, tx, utils.cli.getCmdFromArguments(arguments)))
91-
88+
.action(async (walletPath, tx, ...args) => await Account.sign(walletPath, tx, utils.cli.getCmdFromArguments(args)))
9289

9390
// ## Initialize `sign-message` command
9491
//
@@ -99,8 +96,7 @@ program
9996
.command('sign-message <wallet_path> [data...]')
10097
.option('--filePath [path]', 'Specify the path to the file for signing(ignore command message argument and use file instead)')
10198
.description('Create a transaction to another wallet')
102-
.action(async (walletPath, data, ...arguments) => await Account.signMessage(walletPath, data, utils.cli.getCmdFromArguments(arguments)))
103-
99+
.action(async (walletPath, data, ...args) => await Account.signMessage(walletPath, data, utils.cli.getCmdFromArguments(args)))
104100

105101
// ## Initialize `verify-message` command
106102
//
@@ -111,8 +107,7 @@ program
111107
.command('verify-message <wallet_path> <hexSignature> [data...]')
112108
.option('--filePath [path]', 'Specify the path to the file(ignore comm and message argument and use file instead)')
113109
.description('Create a transaction to another wallet')
114-
.action(async (walletPath, hexSignature, data, ...arguments) => await Account.verifyMessage(walletPath, hexSignature, data, utils.cli.getCmdFromArguments(arguments)))
115-
110+
.action(async (walletPath, hexSignature, data, ...args) => await Account.verifyMessage(walletPath, hexSignature, data, utils.cli.getCmdFromArguments(args)))
116111

117112
// ## Initialize `balance` command
118113
//
@@ -124,7 +119,7 @@ program
124119
.option('--height [height]', 'Specific block height')
125120
.option('--hash [hash]', 'Specific block hash')
126121
.description('Get wallet balance')
127-
.action(async (walletPath, ...arguments) => await Account.getBalance(walletPath, utils.cli.getCmdFromArguments(arguments)))
122+
.action(async (walletPath, ...args) => await Account.getBalance(walletPath, utils.cli.getCmdFromArguments(args)))
128123

129124
// ## Initialize `address` command
130125
//
@@ -138,7 +133,7 @@ program
138133
.option('--privateKey', 'Print private key')
139134
.option('--forcePrompt', 'Force prompting')
140135
.description('Get wallet address')
141-
.action(async (walletPath, ...arguments) => await Account.getAddress(walletPath, utils.cli.getCmdFromArguments(arguments)))
136+
.action(async (walletPath, ...args) => await Account.getAddress(walletPath, utils.cli.getCmdFromArguments(args)))
142137

143138
// ## Initialize `create` command
144139
//
@@ -155,7 +150,7 @@ program
155150
.option('-O, --output [output]', 'Output directory', '.')
156151
.option('--overwrite', 'Overwrite if exist')
157152
.description('Create a secure wallet')
158-
.action(async (name, ...arguments) => await Account.createSecureWallet(name, utils.cli.getCmdFromArguments(arguments)))
153+
.action(async (name, ...args) => await Account.createSecureWallet(name, utils.cli.getCmdFromArguments(args)))
159154

160155
// ## Initialize `save` command
161156
//
@@ -172,7 +167,7 @@ program
172167
.option('-O, --output [output]', 'Output directory', '.')
173168
.option('--overwrite', 'Overwrite if exist')
174169
.description('Save a private keys string to a password protected file wallet')
175-
.action(async (name, priv, ...arguments) => await Account.createSecureWalletByPrivKey(name, priv, utils.cli.getCmdFromArguments(arguments)))
170+
.action(async (name, priv, ...args) => await Account.createSecureWalletByPrivKey(name, priv, utils.cli.getCmdFromArguments(args)))
176171

177172
// ## Initialize `nonce` command
178173
//
@@ -184,7 +179,7 @@ program
184179
program
185180
.command('nonce <wallet_path>')
186181
.description('Get account nonce')
187-
.action(async (walletPath, ...arguments) => await Account.getAccountNonce(walletPath, utils.cli.getCmdFromArguments(arguments)))
182+
.action(async (walletPath, ...args) => await Account.getAccountNonce(walletPath, utils.cli.getCmdFromArguments(args)))
188183

189184
// ## Initialize `generateKeyPairs` command
190185
//
@@ -195,12 +190,7 @@ program
195190
.command('generate <count>')
196191
.option('--forcePrompt', 'Force prompting')
197192
.description('Generate keyPairs')
198-
.action(async (count, ...arguments) => await Account.generateKeyPairs(count, utils.cli.getCmdFromArguments(arguments)))
199-
200-
201-
// Handle unknown command's
202-
program.on('command:*', () => utils.errors.unknownCommandHandler(program)())
193+
.action(async (count, ...args) => await Account.generateKeyPairs(count, utils.cli.getCmdFromArguments(args)))
203194

204-
// Parse arguments or show `help` if argument's is empty
195+
// Parse arguments
205196
program.parse(process.argv)
206-
if (program.args.length === 0) program.help()

bin/aecli-chain.js

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
// Also we need `esm` package to handle `ES imports`
2424
const program = require('commander')
2525

26-
require = require('esm')(module/*, options*/) //use to handle es6 import/export
27-
const utils = require('./utils/index')
28-
const { Chain } = require('./commands')
26+
const requireEsm = require('esm')(module/*, options */) // use to handle es6 import/export
27+
const utils = requireEsm('./utils/index')
28+
const { Chain } = requireEsm('./commands')
2929

3030
// # Initialize `options`
3131
program
@@ -43,7 +43,7 @@ program
4343
program
4444
.command('top')
4545
.description('Get top of Chain')
46-
.action(async (...arguments) => await Chain.top(utils.cli.getCmdFromArguments(arguments)))
46+
.action(async (...args) => await Chain.top(utils.cli.getCmdFromArguments(args)))
4747

4848
// ## Initialize `status` command
4949
//
@@ -53,7 +53,7 @@ program
5353
program
5454
.command('status')
5555
.description('Get node version')
56-
.action(async (...arguments) => await Chain.version(utils.cli.getCmdFromArguments(arguments)))
56+
.action(async (...args) => await Chain.version(utils.cli.getCmdFromArguments(args)))
5757

5858
// ## Initialize `ttl` command
5959
//
@@ -63,7 +63,7 @@ program
6363
program
6464
.command('ttl <absoluteTtl>')
6565
.description('Get relative ttl')
66-
.action(async (absoluteTtl, ...arguments) => await Chain.ttl(absoluteTtl, utils.cli.getCmdFromArguments(arguments)))
66+
.action(async (absoluteTtl, ...args) => await Chain.ttl(absoluteTtl, utils.cli.getCmdFromArguments(args)))
6767

6868
// ## Initialize `ttl` command
6969
//
@@ -73,7 +73,7 @@ program
7373
program
7474
.command('network_id')
7575
.description('Get network ID')
76-
.action(async (...arguments) => await Chain.getNetworkId(utils.cli.getCmdFromArguments(arguments)))
76+
.action(async (...args) => await Chain.getNetworkId(utils.cli.getCmdFromArguments(args)))
7777

7878
// ## Initialize `play` command
7979
//
@@ -86,7 +86,7 @@ program
8686
.command('play')
8787
.option('-P --height [playToHeight]', 'Play to selected height')
8888
.description('Real-time block monitoring')
89-
.action(async (...arguments) => await Chain.play(utils.cli.getCmdFromArguments(arguments)))
89+
.action(async (...args) => await Chain.play(utils.cli.getCmdFromArguments(args)))
9090

9191
// ## Initialize `broadcast` command
9292
//
@@ -98,12 +98,7 @@ program
9898
.option('-W, --no-waitMined', 'Force waiting until transaction will be mined')
9999
.option('--verify', 'Verify Transaction before broadcast.')
100100
.description('Send transaction to the chain')
101-
.action(async (tx, ...arguments) => await Chain.broadcast(tx, utils.cli.getCmdFromArguments(arguments)))
101+
.action(async (tx, ...args) => await Chain.broadcast(tx, utils.cli.getCmdFromArguments(args)))
102102

103-
104-
// Handle unknown command's
105-
program.on('command:*', () => utils.errors.unknownCommandHandler(program)())
106-
107-
// Parse arguments or show `help` if argument's is empty
103+
// Parse arguments
108104
program.parse(process.argv)
109-
if (program.args.length === 0) program.help()

0 commit comments

Comments
 (0)